aws_sdk_elementalinference/operation/create_dictionary/
_create_dictionary_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDictionaryInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub language: ::std::option::Option<crate::types::DictionaryLanguage>,
10 pub entries: ::std::option::Option<::std::string::String>,
12 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateDictionaryInput {
16 pub fn name(&self) -> ::std::option::Option<&str> {
18 self.name.as_deref()
19 }
20 pub fn language(&self) -> ::std::option::Option<&crate::types::DictionaryLanguage> {
22 self.language.as_ref()
23 }
24 pub fn entries(&self) -> ::std::option::Option<&str> {
26 self.entries.as_deref()
27 }
28 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30 self.tags.as_ref()
31 }
32}
33impl CreateDictionaryInput {
34 pub fn builder() -> crate::operation::create_dictionary::builders::CreateDictionaryInputBuilder {
36 crate::operation::create_dictionary::builders::CreateDictionaryInputBuilder::default()
37 }
38}
39
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateDictionaryInputBuilder {
44 pub(crate) name: ::std::option::Option<::std::string::String>,
45 pub(crate) language: ::std::option::Option<crate::types::DictionaryLanguage>,
46 pub(crate) entries: ::std::option::Option<::std::string::String>,
47 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl CreateDictionaryInputBuilder {
50 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.name = ::std::option::Option::Some(input.into());
54 self
55 }
56 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.name = input;
59 self
60 }
61 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63 &self.name
64 }
65 pub fn language(mut self, input: crate::types::DictionaryLanguage) -> Self {
68 self.language = ::std::option::Option::Some(input);
69 self
70 }
71 pub fn set_language(mut self, input: ::std::option::Option<crate::types::DictionaryLanguage>) -> Self {
73 self.language = input;
74 self
75 }
76 pub fn get_language(&self) -> &::std::option::Option<crate::types::DictionaryLanguage> {
78 &self.language
79 }
80 pub fn entries(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.entries = ::std::option::Option::Some(input.into());
83 self
84 }
85 pub fn set_entries(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.entries = input;
88 self
89 }
90 pub fn get_entries(&self) -> &::std::option::Option<::std::string::String> {
92 &self.entries
93 }
94 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
100 let mut hash_map = self.tags.unwrap_or_default();
101 hash_map.insert(k.into(), v.into());
102 self.tags = ::std::option::Option::Some(hash_map);
103 self
104 }
105 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
107 self.tags = input;
108 self
109 }
110 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
112 &self.tags
113 }
114 pub fn build(
116 self,
117 ) -> ::std::result::Result<crate::operation::create_dictionary::CreateDictionaryInput, ::aws_smithy_types::error::operation::BuildError> {
118 ::std::result::Result::Ok(crate::operation::create_dictionary::CreateDictionaryInput {
119 name: self.name,
120 language: self.language,
121 entries: self.entries,
122 tags: self.tags,
123 })
124 }
125}