Skip to main content

aws_sdk_elementalinference/operation/create_dictionary/
_create_dictionary_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 CreateDictionaryInput {
6    /// <p>A user-friendly name for this dictionary.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The language of the dictionary entries. Specify the language using an ISO 639-2/T three-letter code. Supported values: eng, fra, ita, deu, spa, por.</p>
9    pub language: ::std::option::Option<crate::types::DictionaryLanguage>,
10    /// <p>The dictionary entries payload. Contains the custom words and phrases for the dictionary. Maximum size is 40,960 characters.</p>
11    pub entries: ::std::option::Option<::std::string::String>,
12    /// <p>Optional tags to associate with the dictionary.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateDictionaryInput {
16    /// <p>A user-friendly name for this dictionary.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>The language of the dictionary entries. Specify the language using an ISO 639-2/T three-letter code. Supported values: eng, fra, ita, deu, spa, por.</p>
21    pub fn language(&self) -> ::std::option::Option<&crate::types::DictionaryLanguage> {
22        self.language.as_ref()
23    }
24    /// <p>The dictionary entries payload. Contains the custom words and phrases for the dictionary. Maximum size is 40,960 characters.</p>
25    pub fn entries(&self) -> ::std::option::Option<&str> {
26        self.entries.as_deref()
27    }
28    /// <p>Optional tags to associate with the dictionary.</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 CreateDictionaryInput {
34    /// Creates a new builder-style object to manufacture [`CreateDictionaryInput`](crate::operation::create_dictionary::CreateDictionaryInput).
35    pub fn builder() -> crate::operation::create_dictionary::builders::CreateDictionaryInputBuilder {
36        crate::operation::create_dictionary::builders::CreateDictionaryInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateDictionaryInput`](crate::operation::create_dictionary::CreateDictionaryInput).
41#[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    /// <p>A user-friendly name for this dictionary.</p>
51    /// This field is required.
52    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    /// <p>A user-friendly name for this dictionary.</p>
57    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.name = input;
59        self
60    }
61    /// <p>A user-friendly name for this dictionary.</p>
62    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.name
64    }
65    /// <p>The language of the dictionary entries. Specify the language using an ISO 639-2/T three-letter code. Supported values: eng, fra, ita, deu, spa, por.</p>
66    /// This field is required.
67    pub fn language(mut self, input: crate::types::DictionaryLanguage) -> Self {
68        self.language = ::std::option::Option::Some(input);
69        self
70    }
71    /// <p>The language of the dictionary entries. Specify the language using an ISO 639-2/T three-letter code. Supported values: eng, fra, ita, deu, spa, por.</p>
72    pub fn set_language(mut self, input: ::std::option::Option<crate::types::DictionaryLanguage>) -> Self {
73        self.language = input;
74        self
75    }
76    /// <p>The language of the dictionary entries. Specify the language using an ISO 639-2/T three-letter code. Supported values: eng, fra, ita, deu, spa, por.</p>
77    pub fn get_language(&self) -> &::std::option::Option<crate::types::DictionaryLanguage> {
78        &self.language
79    }
80    /// <p>The dictionary entries payload. Contains the custom words and phrases for the dictionary. Maximum size is 40,960 characters.</p>
81    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    /// <p>The dictionary entries payload. Contains the custom words and phrases for the dictionary. Maximum size is 40,960 characters.</p>
86    pub fn set_entries(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.entries = input;
88        self
89    }
90    /// <p>The dictionary entries payload. Contains the custom words and phrases for the dictionary. Maximum size is 40,960 characters.</p>
91    pub fn get_entries(&self) -> &::std::option::Option<::std::string::String> {
92        &self.entries
93    }
94    /// Adds a key-value pair to `tags`.
95    ///
96    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
97    ///
98    /// <p>Optional tags to associate with the dictionary.</p>
99    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    /// <p>Optional tags to associate with the dictionary.</p>
106    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    /// <p>Optional tags to associate with the dictionary.</p>
111    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
112        &self.tags
113    }
114    /// Consumes the builder and constructs a [`CreateDictionaryInput`](crate::operation::create_dictionary::CreateDictionaryInput).
115    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}