aws_sdk_iotsitewise/operation/create_project/
_create_project_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateProjectInput {
6 pub portal_id: ::std::option::Option<::std::string::String>,
8 pub project_name: ::std::option::Option<::std::string::String>,
10 pub project_description: ::std::option::Option<::std::string::String>,
12 pub client_token: ::std::option::Option<::std::string::String>,
14 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16}
17impl CreateProjectInput {
18 pub fn portal_id(&self) -> ::std::option::Option<&str> {
20 self.portal_id.as_deref()
21 }
22 pub fn project_name(&self) -> ::std::option::Option<&str> {
24 self.project_name.as_deref()
25 }
26 pub fn project_description(&self) -> ::std::option::Option<&str> {
28 self.project_description.as_deref()
29 }
30 pub fn client_token(&self) -> ::std::option::Option<&str> {
32 self.client_token.as_deref()
33 }
34 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
36 self.tags.as_ref()
37 }
38}
39impl CreateProjectInput {
40 pub fn builder() -> crate::operation::create_project::builders::CreateProjectInputBuilder {
42 crate::operation::create_project::builders::CreateProjectInputBuilder::default()
43 }
44}
45
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateProjectInputBuilder {
50 pub(crate) portal_id: ::std::option::Option<::std::string::String>,
51 pub(crate) project_name: ::std::option::Option<::std::string::String>,
52 pub(crate) project_description: ::std::option::Option<::std::string::String>,
53 pub(crate) client_token: ::std::option::Option<::std::string::String>,
54 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
55}
56impl CreateProjectInputBuilder {
57 pub fn portal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 self.portal_id = ::std::option::Option::Some(input.into());
61 self
62 }
63 pub fn set_portal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.portal_id = input;
66 self
67 }
68 pub fn get_portal_id(&self) -> &::std::option::Option<::std::string::String> {
70 &self.portal_id
71 }
72 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 self.project_name = ::std::option::Option::Some(input.into());
76 self
77 }
78 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.project_name = input;
81 self
82 }
83 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
85 &self.project_name
86 }
87 pub fn project_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.project_description = ::std::option::Option::Some(input.into());
90 self
91 }
92 pub fn set_project_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.project_description = input;
95 self
96 }
97 pub fn get_project_description(&self) -> &::std::option::Option<::std::string::String> {
99 &self.project_description
100 }
101 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.client_token = ::std::option::Option::Some(input.into());
104 self
105 }
106 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.client_token = input;
109 self
110 }
111 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
113 &self.client_token
114 }
115 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
121 let mut hash_map = self.tags.unwrap_or_default();
122 hash_map.insert(k.into(), v.into());
123 self.tags = ::std::option::Option::Some(hash_map);
124 self
125 }
126 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
128 self.tags = input;
129 self
130 }
131 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
133 &self.tags
134 }
135 pub fn build(
137 self,
138 ) -> ::std::result::Result<crate::operation::create_project::CreateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
139 ::std::result::Result::Ok(crate::operation::create_project::CreateProjectInput {
140 portal_id: self.portal_id,
141 project_name: self.project_name,
142 project_description: self.project_description,
143 client_token: self.client_token,
144 tags: self.tags,
145 })
146 }
147}