Skip to main content

aws_sdk_elementalinference/operation/update_dictionary/
_update_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 UpdateDictionaryInput {
6    /// <p>The ID of the dictionary to update.</p>
7    pub id: ::std::option::Option<::std::string::String>,
8    /// <p>A new name for the dictionary. If not specified, the name is not changed.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>A new language for the dictionary. If not specified, the language is not changed.</p>
11    pub language: ::std::option::Option<crate::types::DictionaryLanguage>,
12    /// <p>New dictionary entries. If not specified, the entries are not changed.</p>
13    pub entries: ::std::option::Option<::std::string::String>,
14}
15impl UpdateDictionaryInput {
16    /// <p>The ID of the dictionary to update.</p>
17    pub fn id(&self) -> ::std::option::Option<&str> {
18        self.id.as_deref()
19    }
20    /// <p>A new name for the dictionary. If not specified, the name is not changed.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>A new language for the dictionary. If not specified, the language is not changed.</p>
25    pub fn language(&self) -> ::std::option::Option<&crate::types::DictionaryLanguage> {
26        self.language.as_ref()
27    }
28    /// <p>New dictionary entries. If not specified, the entries are not changed.</p>
29    pub fn entries(&self) -> ::std::option::Option<&str> {
30        self.entries.as_deref()
31    }
32}
33impl UpdateDictionaryInput {
34    /// Creates a new builder-style object to manufacture [`UpdateDictionaryInput`](crate::operation::update_dictionary::UpdateDictionaryInput).
35    pub fn builder() -> crate::operation::update_dictionary::builders::UpdateDictionaryInputBuilder {
36        crate::operation::update_dictionary::builders::UpdateDictionaryInputBuilder::default()
37    }
38}
39
40/// A builder for [`UpdateDictionaryInput`](crate::operation::update_dictionary::UpdateDictionaryInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct UpdateDictionaryInputBuilder {
44    pub(crate) id: ::std::option::Option<::std::string::String>,
45    pub(crate) name: ::std::option::Option<::std::string::String>,
46    pub(crate) language: ::std::option::Option<crate::types::DictionaryLanguage>,
47    pub(crate) entries: ::std::option::Option<::std::string::String>,
48}
49impl UpdateDictionaryInputBuilder {
50    /// <p>The ID of the dictionary to update.</p>
51    /// This field is required.
52    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The ID of the dictionary to update.</p>
57    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.id = input;
59        self
60    }
61    /// <p>The ID of the dictionary to update.</p>
62    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.id
64    }
65    /// <p>A new name for the dictionary. If not specified, the name is not changed.</p>
66    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.name = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>A new name for the dictionary. If not specified, the name is not changed.</p>
71    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.name = input;
73        self
74    }
75    /// <p>A new name for the dictionary. If not specified, the name is not changed.</p>
76    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.name
78    }
79    /// <p>A new language for the dictionary. If not specified, the language is not changed.</p>
80    pub fn language(mut self, input: crate::types::DictionaryLanguage) -> Self {
81        self.language = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>A new language for the dictionary. If not specified, the language is not changed.</p>
85    pub fn set_language(mut self, input: ::std::option::Option<crate::types::DictionaryLanguage>) -> Self {
86        self.language = input;
87        self
88    }
89    /// <p>A new language for the dictionary. If not specified, the language is not changed.</p>
90    pub fn get_language(&self) -> &::std::option::Option<crate::types::DictionaryLanguage> {
91        &self.language
92    }
93    /// <p>New dictionary entries. If not specified, the entries are not changed.</p>
94    pub fn entries(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.entries = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>New dictionary entries. If not specified, the entries are not changed.</p>
99    pub fn set_entries(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.entries = input;
101        self
102    }
103    /// <p>New dictionary entries. If not specified, the entries are not changed.</p>
104    pub fn get_entries(&self) -> &::std::option::Option<::std::string::String> {
105        &self.entries
106    }
107    /// Consumes the builder and constructs a [`UpdateDictionaryInput`](crate::operation::update_dictionary::UpdateDictionaryInput).
108    pub fn build(
109        self,
110    ) -> ::std::result::Result<crate::operation::update_dictionary::UpdateDictionaryInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::update_dictionary::UpdateDictionaryInput {
112            id: self.id,
113            name: self.name,
114            language: self.language,
115            entries: self.entries,
116        })
117    }
118}