aws_sdk_codedeploy/operation/create_application/_create_application_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>CreateApplication</code> operation.</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. This name must be unique with the applicable user or Amazon Web Services account.</p>
8 pub application_name: ::std::option::Option<::std::string::String>,
9 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
10 pub compute_platform: ::std::option::Option<crate::types::ComputePlatform>,
11 /// <p>The metadata that you apply to CodeDeploy applications to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.</p>
12 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
13}
14impl CreateApplicationInput {
15 /// <p>The name of the application. This name must be unique with the applicable user or Amazon Web Services account.</p>
16 pub fn application_name(&self) -> ::std::option::Option<&str> {
17 self.application_name.as_deref()
18 }
19 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
20 pub fn compute_platform(&self) -> ::std::option::Option<&crate::types::ComputePlatform> {
21 self.compute_platform.as_ref()
22 }
23 /// <p>The metadata that you apply to CodeDeploy applications to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.</p>
24 ///
25 /// 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()`.
26 pub fn tags(&self) -> &[crate::types::Tag] {
27 self.tags.as_deref().unwrap_or_default()
28 }
29}
30impl CreateApplicationInput {
31 /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
32 pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
33 crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
34 }
35}
36
37/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct CreateApplicationInputBuilder {
41 pub(crate) application_name: ::std::option::Option<::std::string::String>,
42 pub(crate) compute_platform: ::std::option::Option<crate::types::ComputePlatform>,
43 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
44}
45impl CreateApplicationInputBuilder {
46 /// <p>The name of the application. This name must be unique with the applicable user or Amazon Web Services account.</p>
47 /// This field is required.
48 pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.application_name = ::std::option::Option::Some(input.into());
50 self
51 }
52 /// <p>The name of the application. This name must be unique with the applicable user or Amazon Web Services account.</p>
53 pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.application_name = input;
55 self
56 }
57 /// <p>The name of the application. This name must be unique with the applicable user or Amazon Web Services account.</p>
58 pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
59 &self.application_name
60 }
61 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
62 pub fn compute_platform(mut self, input: crate::types::ComputePlatform) -> Self {
63 self.compute_platform = ::std::option::Option::Some(input);
64 self
65 }
66 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
67 pub fn set_compute_platform(mut self, input: ::std::option::Option<crate::types::ComputePlatform>) -> Self {
68 self.compute_platform = input;
69 self
70 }
71 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
72 pub fn get_compute_platform(&self) -> &::std::option::Option<crate::types::ComputePlatform> {
73 &self.compute_platform
74 }
75 /// Appends an item to `tags`.
76 ///
77 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
78 ///
79 /// <p>The metadata that you apply to CodeDeploy applications to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.</p>
80 pub fn tags(mut self, input: crate::types::Tag) -> Self {
81 let mut v = self.tags.unwrap_or_default();
82 v.push(input);
83 self.tags = ::std::option::Option::Some(v);
84 self
85 }
86 /// <p>The metadata that you apply to CodeDeploy applications to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.</p>
87 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
88 self.tags = input;
89 self
90 }
91 /// <p>The metadata that you apply to CodeDeploy applications to help you organize and categorize them. Each tag consists of a key and an optional value, both of which you define.</p>
92 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
93 &self.tags
94 }
95 /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
96 pub fn build(
97 self,
98 ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
99 ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
100 application_name: self.application_name,
101 compute_platform: self.compute_platform,
102 tags: self.tags,
103 })
104 }
105}