aws_sdk_connect/operation/create_vocabulary/
_create_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 CreateVocabularyInput {
6    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>. If a create request is received more than once with same client token, subsequent requests return the previous response without creating a vocabulary again.</p>
7    pub client_token: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
9    pub instance_id: ::std::option::Option<::std::string::String>,
10    /// <p>A unique name of the custom vocabulary.</p>
11    pub vocabulary_name: ::std::option::Option<::std::string::String>,
12    /// <p>The language code of the vocabulary entries. For a list of languages and their corresponding language codes, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html">What is Amazon Transcribe?</a></p>
13    pub language_code: ::std::option::Option<crate::types::VocabularyLanguageCode>,
14    /// <p>The content of the custom vocabulary in plain-text format with a table of values. Each row in the table represents a word or a phrase, described with <code>Phrase</code>, <code>IPA</code>, <code>SoundsLike</code>, and <code>DisplayAs</code> fields. Separate the fields with TAB characters. The size limit is 50KB. For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html#create-vocabulary-table">Create a custom vocabulary using a table</a>.</p>
15    pub content: ::std::option::Option<::std::string::String>,
16    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18}
19impl CreateVocabularyInput {
20    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>. If a create request is received more than once with same client token, subsequent requests return the previous response without creating a vocabulary again.</p>
21    pub fn client_token(&self) -> ::std::option::Option<&str> {
22        self.client_token.as_deref()
23    }
24    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
25    pub fn instance_id(&self) -> ::std::option::Option<&str> {
26        self.instance_id.as_deref()
27    }
28    /// <p>A unique name of the custom vocabulary.</p>
29    pub fn vocabulary_name(&self) -> ::std::option::Option<&str> {
30        self.vocabulary_name.as_deref()
31    }
32    /// <p>The language code of the vocabulary entries. For a list of languages and their corresponding language codes, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html">What is Amazon Transcribe?</a></p>
33    pub fn language_code(&self) -> ::std::option::Option<&crate::types::VocabularyLanguageCode> {
34        self.language_code.as_ref()
35    }
36    /// <p>The content of the custom vocabulary in plain-text format with a table of values. Each row in the table represents a word or a phrase, described with <code>Phrase</code>, <code>IPA</code>, <code>SoundsLike</code>, and <code>DisplayAs</code> fields. Separate the fields with TAB characters. The size limit is 50KB. For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html#create-vocabulary-table">Create a custom vocabulary using a table</a>.</p>
37    pub fn content(&self) -> ::std::option::Option<&str> {
38        self.content.as_deref()
39    }
40    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
41    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
42        self.tags.as_ref()
43    }
44}
45impl CreateVocabularyInput {
46    /// Creates a new builder-style object to manufacture [`CreateVocabularyInput`](crate::operation::create_vocabulary::CreateVocabularyInput).
47    pub fn builder() -> crate::operation::create_vocabulary::builders::CreateVocabularyInputBuilder {
48        crate::operation::create_vocabulary::builders::CreateVocabularyInputBuilder::default()
49    }
50}
51
52/// A builder for [`CreateVocabularyInput`](crate::operation::create_vocabulary::CreateVocabularyInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateVocabularyInputBuilder {
56    pub(crate) client_token: ::std::option::Option<::std::string::String>,
57    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
58    pub(crate) vocabulary_name: ::std::option::Option<::std::string::String>,
59    pub(crate) language_code: ::std::option::Option<crate::types::VocabularyLanguageCode>,
60    pub(crate) content: ::std::option::Option<::std::string::String>,
61    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
62}
63impl CreateVocabularyInputBuilder {
64    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>. If a create request is received more than once with same client token, subsequent requests return the previous response without creating a vocabulary again.</p>
65    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.client_token = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>. If a create request is received more than once with same client token, subsequent requests return the previous response without creating a vocabulary again.</p>
70    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.client_token = input;
72        self
73    }
74    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>. If a create request is received more than once with same client token, subsequent requests return the previous response without creating a vocabulary again.</p>
75    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
76        &self.client_token
77    }
78    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
79    /// This field is required.
80    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.instance_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
85    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.instance_id = input;
87        self
88    }
89    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
90    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.instance_id
92    }
93    /// <p>A unique name of the custom vocabulary.</p>
94    /// This field is required.
95    pub fn vocabulary_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.vocabulary_name = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>A unique name of the custom vocabulary.</p>
100    pub fn set_vocabulary_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.vocabulary_name = input;
102        self
103    }
104    /// <p>A unique name of the custom vocabulary.</p>
105    pub fn get_vocabulary_name(&self) -> &::std::option::Option<::std::string::String> {
106        &self.vocabulary_name
107    }
108    /// <p>The language code of the vocabulary entries. For a list of languages and their corresponding language codes, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html">What is Amazon Transcribe?</a></p>
109    /// This field is required.
110    pub fn language_code(mut self, input: crate::types::VocabularyLanguageCode) -> Self {
111        self.language_code = ::std::option::Option::Some(input);
112        self
113    }
114    /// <p>The language code of the vocabulary entries. For a list of languages and their corresponding language codes, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html">What is Amazon Transcribe?</a></p>
115    pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::VocabularyLanguageCode>) -> Self {
116        self.language_code = input;
117        self
118    }
119    /// <p>The language code of the vocabulary entries. For a list of languages and their corresponding language codes, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/transcribe-whatis.html">What is Amazon Transcribe?</a></p>
120    pub fn get_language_code(&self) -> &::std::option::Option<crate::types::VocabularyLanguageCode> {
121        &self.language_code
122    }
123    /// <p>The content of the custom vocabulary in plain-text format with a table of values. Each row in the table represents a word or a phrase, described with <code>Phrase</code>, <code>IPA</code>, <code>SoundsLike</code>, and <code>DisplayAs</code> fields. Separate the fields with TAB characters. The size limit is 50KB. For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html#create-vocabulary-table">Create a custom vocabulary using a table</a>.</p>
124    /// This field is required.
125    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.content = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The content of the custom vocabulary in plain-text format with a table of values. Each row in the table represents a word or a phrase, described with <code>Phrase</code>, <code>IPA</code>, <code>SoundsLike</code>, and <code>DisplayAs</code> fields. Separate the fields with TAB characters. The size limit is 50KB. For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html#create-vocabulary-table">Create a custom vocabulary using a table</a>.</p>
130    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.content = input;
132        self
133    }
134    /// <p>The content of the custom vocabulary in plain-text format with a table of values. Each row in the table represents a word or a phrase, described with <code>Phrase</code>, <code>IPA</code>, <code>SoundsLike</code>, and <code>DisplayAs</code> fields. Separate the fields with TAB characters. The size limit is 50KB. For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html#create-vocabulary-table">Create a custom vocabulary using a table</a>.</p>
135    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
136        &self.content
137    }
138    /// Adds a key-value pair to `tags`.
139    ///
140    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
141    ///
142    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
143    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
144        let mut hash_map = self.tags.unwrap_or_default();
145        hash_map.insert(k.into(), v.into());
146        self.tags = ::std::option::Option::Some(hash_map);
147        self
148    }
149    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
150    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
151        self.tags = input;
152        self
153    }
154    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
155    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
156        &self.tags
157    }
158    /// Consumes the builder and constructs a [`CreateVocabularyInput`](crate::operation::create_vocabulary::CreateVocabularyInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<crate::operation::create_vocabulary::CreateVocabularyInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::create_vocabulary::CreateVocabularyInput {
163            client_token: self.client_token,
164            instance_id: self.instance_id,
165            vocabulary_name: self.vocabulary_name,
166            language_code: self.language_code,
167            content: self.content,
168            tags: self.tags,
169        })
170    }
171}