aws_sdk_appconfig/operation/create_application/
_create_application_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateApplicationInput {
6    /// <p>A name for the application.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the application.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>Metadata to assign to the application. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl CreateApplicationInput {
14    /// <p>A name for the application.</p>
15    pub fn name(&self) -> ::std::option::Option<&str> {
16        self.name.as_deref()
17    }
18    /// <p>A description of the application.</p>
19    pub fn description(&self) -> ::std::option::Option<&str> {
20        self.description.as_deref()
21    }
22    /// <p>Metadata to assign to the application. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
23    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
24        self.tags.as_ref()
25    }
26}
27impl CreateApplicationInput {
28    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
29    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
30        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateApplicationInputBuilder {
38    pub(crate) name: ::std::option::Option<::std::string::String>,
39    pub(crate) description: ::std::option::Option<::std::string::String>,
40    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
41}
42impl CreateApplicationInputBuilder {
43    /// <p>A name for the application.</p>
44    /// This field is required.
45    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.name = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>A name for the application.</p>
50    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.name = input;
52        self
53    }
54    /// <p>A name for the application.</p>
55    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.name
57    }
58    /// <p>A description of the application.</p>
59    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.description = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>A description of the application.</p>
64    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.description = input;
66        self
67    }
68    /// <p>A description of the application.</p>
69    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
70        &self.description
71    }
72    /// Adds a key-value pair to `tags`.
73    ///
74    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
75    ///
76    /// <p>Metadata to assign to the application. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
77    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
78        let mut hash_map = self.tags.unwrap_or_default();
79        hash_map.insert(k.into(), v.into());
80        self.tags = ::std::option::Option::Some(hash_map);
81        self
82    }
83    /// <p>Metadata to assign to the application. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
84    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
85        self.tags = input;
86        self
87    }
88    /// <p>Metadata to assign to the application. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
89    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
90        &self.tags
91    }
92    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
93    pub fn build(
94        self,
95    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
96        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
97            name: self.name,
98            description: self.description,
99            tags: self.tags,
100        })
101    }
102}