aws_sdk_iot1clickprojects/operation/create_placement/
_create_placement_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreatePlacementInput {
6 pub placement_name: ::std::option::Option<::std::string::String>,
8 pub project_name: ::std::option::Option<::std::string::String>,
10 pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl CreatePlacementInput {
14 pub fn placement_name(&self) -> ::std::option::Option<&str> {
16 self.placement_name.as_deref()
17 }
18 pub fn project_name(&self) -> ::std::option::Option<&str> {
20 self.project_name.as_deref()
21 }
22 pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
24 self.attributes.as_ref()
25 }
26}
27impl CreatePlacementInput {
28 pub fn builder() -> crate::operation::create_placement::builders::CreatePlacementInputBuilder {
30 crate::operation::create_placement::builders::CreatePlacementInputBuilder::default()
31 }
32}
33
34#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreatePlacementInputBuilder {
38 pub(crate) placement_name: ::std::option::Option<::std::string::String>,
39 pub(crate) project_name: ::std::option::Option<::std::string::String>,
40 pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
41}
42impl CreatePlacementInputBuilder {
43 pub fn placement_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.placement_name = ::std::option::Option::Some(input.into());
47 self
48 }
49 pub fn set_placement_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.placement_name = input;
52 self
53 }
54 pub fn get_placement_name(&self) -> &::std::option::Option<::std::string::String> {
56 &self.placement_name
57 }
58 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.project_name = ::std::option::Option::Some(input.into());
62 self
63 }
64 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.project_name = input;
67 self
68 }
69 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
71 &self.project_name
72 }
73 pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
79 let mut hash_map = self.attributes.unwrap_or_default();
80 hash_map.insert(k.into(), v.into());
81 self.attributes = ::std::option::Option::Some(hash_map);
82 self
83 }
84 pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
86 self.attributes = input;
87 self
88 }
89 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
91 &self.attributes
92 }
93 pub fn build(
95 self,
96 ) -> ::std::result::Result<crate::operation::create_placement::CreatePlacementInput, ::aws_smithy_types::error::operation::BuildError> {
97 ::std::result::Result::Ok(crate::operation::create_placement::CreatePlacementInput {
98 placement_name: self.placement_name,
99 project_name: self.project_name,
100 attributes: self.attributes,
101 })
102 }
103}