aws_sdk_iot1clickprojects/operation/create_project/
_create_project_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 CreateProjectInput {
6    /// <p>The name of the project to create.</p>
7    pub project_name: ::std::option::Option<::std::string::String>,
8    /// <p>An optional description for the project.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The schema defining the placement to be created. A placement template defines placement default attributes and device templates. You cannot add or remove device templates after the project has been created. However, you can update <code>callbackOverrides</code> for the device templates using the <code>UpdateProject</code> API.</p>
11    pub placement_template: ::std::option::Option<crate::types::PlacementTemplate>,
12    /// <p>Optional tags (metadata key/value pairs) to be associated with the project. For example, <code>{ {"key1": "value1", "key2": "value2"} }</code>. For more information, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">AWS Tagging Strategies</a>.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateProjectInput {
16    /// <p>The name of the project to create.</p>
17    pub fn project_name(&self) -> ::std::option::Option<&str> {
18        self.project_name.as_deref()
19    }
20    /// <p>An optional description for the project.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>The schema defining the placement to be created. A placement template defines placement default attributes and device templates. You cannot add or remove device templates after the project has been created. However, you can update <code>callbackOverrides</code> for the device templates using the <code>UpdateProject</code> API.</p>
25    pub fn placement_template(&self) -> ::std::option::Option<&crate::types::PlacementTemplate> {
26        self.placement_template.as_ref()
27    }
28    /// <p>Optional tags (metadata key/value pairs) to be associated with the project. For example, <code>{ {"key1": "value1", "key2": "value2"} }</code>. For more information, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">AWS Tagging Strategies</a>.</p>
29    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30        self.tags.as_ref()
31    }
32}
33impl CreateProjectInput {
34    /// Creates a new builder-style object to manufacture [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
35    pub fn builder() -> crate::operation::create_project::builders::CreateProjectInputBuilder {
36        crate::operation::create_project::builders::CreateProjectInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateProjectInputBuilder {
44    pub(crate) project_name: ::std::option::Option<::std::string::String>,
45    pub(crate) description: ::std::option::Option<::std::string::String>,
46    pub(crate) placement_template: ::std::option::Option<crate::types::PlacementTemplate>,
47    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl CreateProjectInputBuilder {
50    /// <p>The name of the project to create.</p>
51    /// This field is required.
52    pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.project_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the project to create.</p>
57    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.project_name = input;
59        self
60    }
61    /// <p>The name of the project to create.</p>
62    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.project_name
64    }
65    /// <p>An optional description for the project.</p>
66    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.description = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>An optional description for the project.</p>
71    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.description = input;
73        self
74    }
75    /// <p>An optional description for the project.</p>
76    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
77        &self.description
78    }
79    /// <p>The schema defining the placement to be created. A placement template defines placement default attributes and device templates. You cannot add or remove device templates after the project has been created. However, you can update <code>callbackOverrides</code> for the device templates using the <code>UpdateProject</code> API.</p>
80    pub fn placement_template(mut self, input: crate::types::PlacementTemplate) -> Self {
81        self.placement_template = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>The schema defining the placement to be created. A placement template defines placement default attributes and device templates. You cannot add or remove device templates after the project has been created. However, you can update <code>callbackOverrides</code> for the device templates using the <code>UpdateProject</code> API.</p>
85    pub fn set_placement_template(mut self, input: ::std::option::Option<crate::types::PlacementTemplate>) -> Self {
86        self.placement_template = input;
87        self
88    }
89    /// <p>The schema defining the placement to be created. A placement template defines placement default attributes and device templates. You cannot add or remove device templates after the project has been created. However, you can update <code>callbackOverrides</code> for the device templates using the <code>UpdateProject</code> API.</p>
90    pub fn get_placement_template(&self) -> &::std::option::Option<crate::types::PlacementTemplate> {
91        &self.placement_template
92    }
93    /// Adds a key-value pair to `tags`.
94    ///
95    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
96    ///
97    /// <p>Optional tags (metadata key/value pairs) to be associated with the project. For example, <code>{ {"key1": "value1", "key2": "value2"} }</code>. For more information, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">AWS Tagging Strategies</a>.</p>
98    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
99        let mut hash_map = self.tags.unwrap_or_default();
100        hash_map.insert(k.into(), v.into());
101        self.tags = ::std::option::Option::Some(hash_map);
102        self
103    }
104    /// <p>Optional tags (metadata key/value pairs) to be associated with the project. For example, <code>{ {"key1": "value1", "key2": "value2"} }</code>. For more information, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">AWS Tagging Strategies</a>.</p>
105    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
106        self.tags = input;
107        self
108    }
109    /// <p>Optional tags (metadata key/value pairs) to be associated with the project. For example, <code>{ {"key1": "value1", "key2": "value2"} }</code>. For more information, see <a href="https://aws.amazon.com/answers/account-management/aws-tagging-strategies/">AWS Tagging Strategies</a>.</p>
110    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
111        &self.tags
112    }
113    /// Consumes the builder and constructs a [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
114    pub fn build(
115        self,
116    ) -> ::std::result::Result<crate::operation::create_project::CreateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
117        ::std::result::Result::Ok(crate::operation::create_project::CreateProjectInput {
118            project_name: self.project_name,
119            description: self.description,
120            placement_template: self.placement_template,
121            tags: self.tags,
122        })
123    }
124}