aws_sdk_rekognition/operation/create_collection/
_create_collection_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateCollectionInput {
6 pub collection_id: ::std::option::Option<::std::string::String>,
8 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10}
11impl CreateCollectionInput {
12 pub fn collection_id(&self) -> ::std::option::Option<&str> {
14 self.collection_id.as_deref()
15 }
16 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
18 self.tags.as_ref()
19 }
20}
21impl CreateCollectionInput {
22 pub fn builder() -> crate::operation::create_collection::builders::CreateCollectionInputBuilder {
24 crate::operation::create_collection::builders::CreateCollectionInputBuilder::default()
25 }
26}
27
28#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct CreateCollectionInputBuilder {
32 pub(crate) collection_id: ::std::option::Option<::std::string::String>,
33 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
34}
35impl CreateCollectionInputBuilder {
36 pub fn collection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39 self.collection_id = ::std::option::Option::Some(input.into());
40 self
41 }
42 pub fn set_collection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44 self.collection_id = input;
45 self
46 }
47 pub fn get_collection_id(&self) -> &::std::option::Option<::std::string::String> {
49 &self.collection_id
50 }
51 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
57 let mut hash_map = self.tags.unwrap_or_default();
58 hash_map.insert(k.into(), v.into());
59 self.tags = ::std::option::Option::Some(hash_map);
60 self
61 }
62 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
64 self.tags = input;
65 self
66 }
67 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
69 &self.tags
70 }
71 pub fn build(
73 self,
74 ) -> ::std::result::Result<crate::operation::create_collection::CreateCollectionInput, ::aws_smithy_types::error::operation::BuildError> {
75 ::std::result::Result::Ok(crate::operation::create_collection::CreateCollectionInput {
76 collection_id: self.collection_id,
77 tags: self.tags,
78 })
79 }
80}