aws_sdk_transcribe/operation/update_vocabulary/
_update_vocabulary_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 UpdateVocabularyInput {
6    /// <p>The name of the custom vocabulary you want to update. Custom vocabulary names are case sensitive.</p>
7    pub vocabulary_name: ::std::option::Option<::std::string::String>,
8    /// <p>The language code that represents the language of the entries in the custom vocabulary you want to update. Each custom vocabulary must contain terms in only one language.</p>
9    /// <p>A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For example, if you create a custom vocabulary using US English (<code>en-US</code>), you can only apply this custom vocabulary to files that contain English audio.</p>
10    /// <p>For a list of supported languages and their associated language codes, refer to the <a href="https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html">Supported languages</a> table.</p>
11    pub language_code: ::std::option::Option<crate::types::LanguageCode>,
12    /// <p>Use this parameter if you want to update your custom vocabulary by including all desired terms, as comma-separated values, within your request. The other option for updating your custom vocabulary is to save your entries in a text file and upload them to an Amazon S3 bucket, then specify the location of your file using the <code>VocabularyFileUri</code> parameter.</p>
13    /// <p>Note that if you include <code>Phrases</code> in your request, you cannot use <code>VocabularyFileUri</code>; you must choose one or the other.</p>
14    /// <p>Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary filter request fails. Refer to <a href="https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html">Character Sets for Custom Vocabularies</a> to get the character set for your language.</p>
15    pub phrases: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16    /// <p>The Amazon S3 location of the text file that contains your custom vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.</p>
17    /// <p>Here's an example URI path: <code>s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt</code></p>
18    /// <p>Note that if you include <code>VocabularyFileUri</code> in your request, you cannot use the <code>Phrases</code> flag; you must choose one or the other.</p>
19    pub vocabulary_file_uri: ::std::option::Option<::std::string::String>,
20    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files (in this case, your custom vocabulary). If the role that you specify doesn’t have the appropriate permissions to access the specified Amazon S3 location, your request fails.</p>
21    /// <p>IAM role ARNs have the format <code>arn:partition:iam::account:role/role-name-with-path</code>. For example: <code>arn:aws:iam::111122223333:role/Admin</code>.</p>
22    /// <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a>.</p>
23    pub data_access_role_arn: ::std::option::Option<::std::string::String>,
24}
25impl UpdateVocabularyInput {
26    /// <p>The name of the custom vocabulary you want to update. Custom vocabulary names are case sensitive.</p>
27    pub fn vocabulary_name(&self) -> ::std::option::Option<&str> {
28        self.vocabulary_name.as_deref()
29    }
30    /// <p>The language code that represents the language of the entries in the custom vocabulary you want to update. Each custom vocabulary must contain terms in only one language.</p>
31    /// <p>A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For example, if you create a custom vocabulary using US English (<code>en-US</code>), you can only apply this custom vocabulary to files that contain English audio.</p>
32    /// <p>For a list of supported languages and their associated language codes, refer to the <a href="https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html">Supported languages</a> table.</p>
33    pub fn language_code(&self) -> ::std::option::Option<&crate::types::LanguageCode> {
34        self.language_code.as_ref()
35    }
36    /// <p>Use this parameter if you want to update your custom vocabulary by including all desired terms, as comma-separated values, within your request. The other option for updating your custom vocabulary is to save your entries in a text file and upload them to an Amazon S3 bucket, then specify the location of your file using the <code>VocabularyFileUri</code> parameter.</p>
37    /// <p>Note that if you include <code>Phrases</code> in your request, you cannot use <code>VocabularyFileUri</code>; you must choose one or the other.</p>
38    /// <p>Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary filter request fails. Refer to <a href="https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html">Character Sets for Custom Vocabularies</a> to get the character set for your language.</p>
39    ///
40    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.phrases.is_none()`.
41    pub fn phrases(&self) -> &[::std::string::String] {
42        self.phrases.as_deref().unwrap_or_default()
43    }
44    /// <p>The Amazon S3 location of the text file that contains your custom vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.</p>
45    /// <p>Here's an example URI path: <code>s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt</code></p>
46    /// <p>Note that if you include <code>VocabularyFileUri</code> in your request, you cannot use the <code>Phrases</code> flag; you must choose one or the other.</p>
47    pub fn vocabulary_file_uri(&self) -> ::std::option::Option<&str> {
48        self.vocabulary_file_uri.as_deref()
49    }
50    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files (in this case, your custom vocabulary). If the role that you specify doesn’t have the appropriate permissions to access the specified Amazon S3 location, your request fails.</p>
51    /// <p>IAM role ARNs have the format <code>arn:partition:iam::account:role/role-name-with-path</code>. For example: <code>arn:aws:iam::111122223333:role/Admin</code>.</p>
52    /// <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a>.</p>
53    pub fn data_access_role_arn(&self) -> ::std::option::Option<&str> {
54        self.data_access_role_arn.as_deref()
55    }
56}
57impl UpdateVocabularyInput {
58    /// Creates a new builder-style object to manufacture [`UpdateVocabularyInput`](crate::operation::update_vocabulary::UpdateVocabularyInput).
59    pub fn builder() -> crate::operation::update_vocabulary::builders::UpdateVocabularyInputBuilder {
60        crate::operation::update_vocabulary::builders::UpdateVocabularyInputBuilder::default()
61    }
62}
63
64/// A builder for [`UpdateVocabularyInput`](crate::operation::update_vocabulary::UpdateVocabularyInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct UpdateVocabularyInputBuilder {
68    pub(crate) vocabulary_name: ::std::option::Option<::std::string::String>,
69    pub(crate) language_code: ::std::option::Option<crate::types::LanguageCode>,
70    pub(crate) phrases: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
71    pub(crate) vocabulary_file_uri: ::std::option::Option<::std::string::String>,
72    pub(crate) data_access_role_arn: ::std::option::Option<::std::string::String>,
73}
74impl UpdateVocabularyInputBuilder {
75    /// <p>The name of the custom vocabulary you want to update. Custom vocabulary names are case sensitive.</p>
76    /// This field is required.
77    pub fn vocabulary_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.vocabulary_name = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The name of the custom vocabulary you want to update. Custom vocabulary names are case sensitive.</p>
82    pub fn set_vocabulary_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.vocabulary_name = input;
84        self
85    }
86    /// <p>The name of the custom vocabulary you want to update. Custom vocabulary names are case sensitive.</p>
87    pub fn get_vocabulary_name(&self) -> &::std::option::Option<::std::string::String> {
88        &self.vocabulary_name
89    }
90    /// <p>The language code that represents the language of the entries in the custom vocabulary you want to update. Each custom vocabulary must contain terms in only one language.</p>
91    /// <p>A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For example, if you create a custom vocabulary using US English (<code>en-US</code>), you can only apply this custom vocabulary to files that contain English audio.</p>
92    /// <p>For a list of supported languages and their associated language codes, refer to the <a href="https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html">Supported languages</a> table.</p>
93    /// This field is required.
94    pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
95        self.language_code = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>The language code that represents the language of the entries in the custom vocabulary you want to update. Each custom vocabulary must contain terms in only one language.</p>
99    /// <p>A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For example, if you create a custom vocabulary using US English (<code>en-US</code>), you can only apply this custom vocabulary to files that contain English audio.</p>
100    /// <p>For a list of supported languages and their associated language codes, refer to the <a href="https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html">Supported languages</a> table.</p>
101    pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::LanguageCode>) -> Self {
102        self.language_code = input;
103        self
104    }
105    /// <p>The language code that represents the language of the entries in the custom vocabulary you want to update. Each custom vocabulary must contain terms in only one language.</p>
106    /// <p>A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For example, if you create a custom vocabulary using US English (<code>en-US</code>), you can only apply this custom vocabulary to files that contain English audio.</p>
107    /// <p>For a list of supported languages and their associated language codes, refer to the <a href="https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html">Supported languages</a> table.</p>
108    pub fn get_language_code(&self) -> &::std::option::Option<crate::types::LanguageCode> {
109        &self.language_code
110    }
111    /// Appends an item to `phrases`.
112    ///
113    /// To override the contents of this collection use [`set_phrases`](Self::set_phrases).
114    ///
115    /// <p>Use this parameter if you want to update your custom vocabulary by including all desired terms, as comma-separated values, within your request. The other option for updating your custom vocabulary is to save your entries in a text file and upload them to an Amazon S3 bucket, then specify the location of your file using the <code>VocabularyFileUri</code> parameter.</p>
116    /// <p>Note that if you include <code>Phrases</code> in your request, you cannot use <code>VocabularyFileUri</code>; you must choose one or the other.</p>
117    /// <p>Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary filter request fails. Refer to <a href="https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html">Character Sets for Custom Vocabularies</a> to get the character set for your language.</p>
118    pub fn phrases(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        let mut v = self.phrases.unwrap_or_default();
120        v.push(input.into());
121        self.phrases = ::std::option::Option::Some(v);
122        self
123    }
124    /// <p>Use this parameter if you want to update your custom vocabulary by including all desired terms, as comma-separated values, within your request. The other option for updating your custom vocabulary is to save your entries in a text file and upload them to an Amazon S3 bucket, then specify the location of your file using the <code>VocabularyFileUri</code> parameter.</p>
125    /// <p>Note that if you include <code>Phrases</code> in your request, you cannot use <code>VocabularyFileUri</code>; you must choose one or the other.</p>
126    /// <p>Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary filter request fails. Refer to <a href="https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html">Character Sets for Custom Vocabularies</a> to get the character set for your language.</p>
127    pub fn set_phrases(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
128        self.phrases = input;
129        self
130    }
131    /// <p>Use this parameter if you want to update your custom vocabulary by including all desired terms, as comma-separated values, within your request. The other option for updating your custom vocabulary is to save your entries in a text file and upload them to an Amazon S3 bucket, then specify the location of your file using the <code>VocabularyFileUri</code> parameter.</p>
132    /// <p>Note that if you include <code>Phrases</code> in your request, you cannot use <code>VocabularyFileUri</code>; you must choose one or the other.</p>
133    /// <p>Each language has a character set that contains all allowed characters for that specific language. If you use unsupported characters, your custom vocabulary filter request fails. Refer to <a href="https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html">Character Sets for Custom Vocabularies</a> to get the character set for your language.</p>
134    pub fn get_phrases(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
135        &self.phrases
136    }
137    /// <p>The Amazon S3 location of the text file that contains your custom vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.</p>
138    /// <p>Here's an example URI path: <code>s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt</code></p>
139    /// <p>Note that if you include <code>VocabularyFileUri</code> in your request, you cannot use the <code>Phrases</code> flag; you must choose one or the other.</p>
140    pub fn vocabulary_file_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.vocabulary_file_uri = ::std::option::Option::Some(input.into());
142        self
143    }
144    /// <p>The Amazon S3 location of the text file that contains your custom vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.</p>
145    /// <p>Here's an example URI path: <code>s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt</code></p>
146    /// <p>Note that if you include <code>VocabularyFileUri</code> in your request, you cannot use the <code>Phrases</code> flag; you must choose one or the other.</p>
147    pub fn set_vocabulary_file_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.vocabulary_file_uri = input;
149        self
150    }
151    /// <p>The Amazon S3 location of the text file that contains your custom vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.</p>
152    /// <p>Here's an example URI path: <code>s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt</code></p>
153    /// <p>Note that if you include <code>VocabularyFileUri</code> in your request, you cannot use the <code>Phrases</code> flag; you must choose one or the other.</p>
154    pub fn get_vocabulary_file_uri(&self) -> &::std::option::Option<::std::string::String> {
155        &self.vocabulary_file_uri
156    }
157    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files (in this case, your custom vocabulary). If the role that you specify doesn’t have the appropriate permissions to access the specified Amazon S3 location, your request fails.</p>
158    /// <p>IAM role ARNs have the format <code>arn:partition:iam::account:role/role-name-with-path</code>. For example: <code>arn:aws:iam::111122223333:role/Admin</code>.</p>
159    /// <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a>.</p>
160    pub fn data_access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.data_access_role_arn = ::std::option::Option::Some(input.into());
162        self
163    }
164    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files (in this case, your custom vocabulary). If the role that you specify doesn’t have the appropriate permissions to access the specified Amazon S3 location, your request fails.</p>
165    /// <p>IAM role ARNs have the format <code>arn:partition:iam::account:role/role-name-with-path</code>. For example: <code>arn:aws:iam::111122223333:role/Admin</code>.</p>
166    /// <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a>.</p>
167    pub fn set_data_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.data_access_role_arn = input;
169        self
170    }
171    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon S3 bucket that contains your input files (in this case, your custom vocabulary). If the role that you specify doesn’t have the appropriate permissions to access the specified Amazon S3 location, your request fails.</p>
172    /// <p>IAM role ARNs have the format <code>arn:partition:iam::account:role/role-name-with-path</code>. For example: <code>arn:aws:iam::111122223333:role/Admin</code>.</p>
173    /// <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a>.</p>
174    pub fn get_data_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
175        &self.data_access_role_arn
176    }
177    /// Consumes the builder and constructs a [`UpdateVocabularyInput`](crate::operation::update_vocabulary::UpdateVocabularyInput).
178    pub fn build(
179        self,
180    ) -> ::std::result::Result<crate::operation::update_vocabulary::UpdateVocabularyInput, ::aws_smithy_types::error::operation::BuildError> {
181        ::std::result::Result::Ok(crate::operation::update_vocabulary::UpdateVocabularyInput {
182            vocabulary_name: self.vocabulary_name,
183            language_code: self.language_code,
184            phrases: self.phrases,
185            vocabulary_file_uri: self.vocabulary_file_uri,
186            data_access_role_arn: self.data_access_role_arn,
187        })
188    }
189}