aws_sdk_kendra/operation/create_faq/_create_faq_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 CreateFaqInput {
6 /// <p>The identifier of the index for the FAQ.</p>
7 pub index_id: ::std::option::Option<::std::string::String>,
8 /// <p>A name for the FAQ.</p>
9 pub name: ::std::option::Option<::std::string::String>,
10 /// <p>A description for the FAQ.</p>
11 pub description: ::std::option::Option<::std::string::String>,
12 /// <p>The path to the FAQ file in S3.</p>
13 pub s3_path: ::std::option::Option<crate::types::S3Path>,
14 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
15 pub role_arn: ::std::option::Option<::std::string::String>,
16 /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
17 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18 /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
19 /// <p>The default format is CSV.</p>
20 /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
21 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
22 pub file_format: ::std::option::Option<crate::types::FaqFileFormat>,
23 /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
24 pub client_token: ::std::option::Option<::std::string::String>,
25 /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
26 pub language_code: ::std::option::Option<::std::string::String>,
27}
28impl CreateFaqInput {
29 /// <p>The identifier of the index for the FAQ.</p>
30 pub fn index_id(&self) -> ::std::option::Option<&str> {
31 self.index_id.as_deref()
32 }
33 /// <p>A name for the FAQ.</p>
34 pub fn name(&self) -> ::std::option::Option<&str> {
35 self.name.as_deref()
36 }
37 /// <p>A description for the FAQ.</p>
38 pub fn description(&self) -> ::std::option::Option<&str> {
39 self.description.as_deref()
40 }
41 /// <p>The path to the FAQ file in S3.</p>
42 pub fn s3_path(&self) -> ::std::option::Option<&crate::types::S3Path> {
43 self.s3_path.as_ref()
44 }
45 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
46 pub fn role_arn(&self) -> ::std::option::Option<&str> {
47 self.role_arn.as_deref()
48 }
49 /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
50 ///
51 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
52 pub fn tags(&self) -> &[crate::types::Tag] {
53 self.tags.as_deref().unwrap_or_default()
54 }
55 /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
56 /// <p>The default format is CSV.</p>
57 /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
58 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
59 pub fn file_format(&self) -> ::std::option::Option<&crate::types::FaqFileFormat> {
60 self.file_format.as_ref()
61 }
62 /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
63 pub fn client_token(&self) -> ::std::option::Option<&str> {
64 self.client_token.as_deref()
65 }
66 /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
67 pub fn language_code(&self) -> ::std::option::Option<&str> {
68 self.language_code.as_deref()
69 }
70}
71impl CreateFaqInput {
72 /// Creates a new builder-style object to manufacture [`CreateFaqInput`](crate::operation::create_faq::CreateFaqInput).
73 pub fn builder() -> crate::operation::create_faq::builders::CreateFaqInputBuilder {
74 crate::operation::create_faq::builders::CreateFaqInputBuilder::default()
75 }
76}
77
78/// A builder for [`CreateFaqInput`](crate::operation::create_faq::CreateFaqInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct CreateFaqInputBuilder {
82 pub(crate) index_id: ::std::option::Option<::std::string::String>,
83 pub(crate) name: ::std::option::Option<::std::string::String>,
84 pub(crate) description: ::std::option::Option<::std::string::String>,
85 pub(crate) s3_path: ::std::option::Option<crate::types::S3Path>,
86 pub(crate) role_arn: ::std::option::Option<::std::string::String>,
87 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
88 pub(crate) file_format: ::std::option::Option<crate::types::FaqFileFormat>,
89 pub(crate) client_token: ::std::option::Option<::std::string::String>,
90 pub(crate) language_code: ::std::option::Option<::std::string::String>,
91}
92impl CreateFaqInputBuilder {
93 /// <p>The identifier of the index for the FAQ.</p>
94 /// This field is required.
95 pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.index_id = ::std::option::Option::Some(input.into());
97 self
98 }
99 /// <p>The identifier of the index for the FAQ.</p>
100 pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.index_id = input;
102 self
103 }
104 /// <p>The identifier of the index for the FAQ.</p>
105 pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
106 &self.index_id
107 }
108 /// <p>A name for the FAQ.</p>
109 /// This field is required.
110 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.name = ::std::option::Option::Some(input.into());
112 self
113 }
114 /// <p>A name for the FAQ.</p>
115 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.name = input;
117 self
118 }
119 /// <p>A name for the FAQ.</p>
120 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
121 &self.name
122 }
123 /// <p>A description for the FAQ.</p>
124 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.description = ::std::option::Option::Some(input.into());
126 self
127 }
128 /// <p>A description for the FAQ.</p>
129 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.description = input;
131 self
132 }
133 /// <p>A description for the FAQ.</p>
134 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
135 &self.description
136 }
137 /// <p>The path to the FAQ file in S3.</p>
138 /// This field is required.
139 pub fn s3_path(mut self, input: crate::types::S3Path) -> Self {
140 self.s3_path = ::std::option::Option::Some(input);
141 self
142 }
143 /// <p>The path to the FAQ file in S3.</p>
144 pub fn set_s3_path(mut self, input: ::std::option::Option<crate::types::S3Path>) -> Self {
145 self.s3_path = input;
146 self
147 }
148 /// <p>The path to the FAQ file in S3.</p>
149 pub fn get_s3_path(&self) -> &::std::option::Option<crate::types::S3Path> {
150 &self.s3_path
151 }
152 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
153 /// This field is required.
154 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.role_arn = ::std::option::Option::Some(input.into());
156 self
157 }
158 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
159 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.role_arn = input;
161 self
162 }
163 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
164 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
165 &self.role_arn
166 }
167 /// Appends an item to `tags`.
168 ///
169 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
170 ///
171 /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
172 pub fn tags(mut self, input: crate::types::Tag) -> Self {
173 let mut v = self.tags.unwrap_or_default();
174 v.push(input);
175 self.tags = ::std::option::Option::Some(v);
176 self
177 }
178 /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
179 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
180 self.tags = input;
181 self
182 }
183 /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
184 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
185 &self.tags
186 }
187 /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
188 /// <p>The default format is CSV.</p>
189 /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
190 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
191 pub fn file_format(mut self, input: crate::types::FaqFileFormat) -> Self {
192 self.file_format = ::std::option::Option::Some(input);
193 self
194 }
195 /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
196 /// <p>The default format is CSV.</p>
197 /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
198 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
199 pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FaqFileFormat>) -> Self {
200 self.file_format = input;
201 self
202 }
203 /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
204 /// <p>The default format is CSV.</p>
205 /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
206 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
207 pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FaqFileFormat> {
208 &self.file_format
209 }
210 /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
211 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212 self.client_token = ::std::option::Option::Some(input.into());
213 self
214 }
215 /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
216 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217 self.client_token = input;
218 self
219 }
220 /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
221 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
222 &self.client_token
223 }
224 /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
225 pub fn language_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.language_code = ::std::option::Option::Some(input.into());
227 self
228 }
229 /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
230 pub fn set_language_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231 self.language_code = input;
232 self
233 }
234 /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
235 pub fn get_language_code(&self) -> &::std::option::Option<::std::string::String> {
236 &self.language_code
237 }
238 /// Consumes the builder and constructs a [`CreateFaqInput`](crate::operation::create_faq::CreateFaqInput).
239 pub fn build(self) -> ::std::result::Result<crate::operation::create_faq::CreateFaqInput, ::aws_smithy_types::error::operation::BuildError> {
240 ::std::result::Result::Ok(crate::operation::create_faq::CreateFaqInput {
241 index_id: self.index_id,
242 name: self.name,
243 description: self.description,
244 s3_path: self.s3_path,
245 role_arn: self.role_arn,
246 tags: self.tags,
247 file_format: self.file_format,
248 client_token: self.client_token,
249 language_code: self.language_code,
250 })
251 }
252}