aws_sdk_kendra/operation/create_thesaurus/_create_thesaurus_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 CreateThesaurusInput {
6 /// <p>The identifier of the index for the thesaurus.</p>
7 pub index_id: ::std::option::Option<::std::string::String>,
8 /// <p>A name for the thesaurus.</p>
9 pub name: ::std::option::Option<::std::string::String>,
10 /// <p>A description for the thesaurus.</p>
11 pub description: ::std::option::Option<::std::string::String>,
12 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket that contains the thesaurus 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>
13 pub role_arn: ::std::option::Option<::std::string::String>,
14 /// <p>A list of key-value pairs that identify or categorize the thesaurus. You can also use tags to help control access to the thesaurus. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
15 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16 /// <p>The path to the thesaurus file in S3.</p>
17 pub source_s3_path: ::std::option::Option<crate::types::S3Path>,
18 /// <p>A token that you provide to identify the request to create a thesaurus. Multiple calls to the <code>CreateThesaurus</code> API with the same client token will create only one thesaurus.</p>
19 pub client_token: ::std::option::Option<::std::string::String>,
20}
21impl CreateThesaurusInput {
22 /// <p>The identifier of the index for the thesaurus.</p>
23 pub fn index_id(&self) -> ::std::option::Option<&str> {
24 self.index_id.as_deref()
25 }
26 /// <p>A name for the thesaurus.</p>
27 pub fn name(&self) -> ::std::option::Option<&str> {
28 self.name.as_deref()
29 }
30 /// <p>A description for the thesaurus.</p>
31 pub fn description(&self) -> ::std::option::Option<&str> {
32 self.description.as_deref()
33 }
34 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket that contains the thesaurus 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>
35 pub fn role_arn(&self) -> ::std::option::Option<&str> {
36 self.role_arn.as_deref()
37 }
38 /// <p>A list of key-value pairs that identify or categorize the thesaurus. You can also use tags to help control access to the thesaurus. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</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 `.tags.is_none()`.
41 pub fn tags(&self) -> &[crate::types::Tag] {
42 self.tags.as_deref().unwrap_or_default()
43 }
44 /// <p>The path to the thesaurus file in S3.</p>
45 pub fn source_s3_path(&self) -> ::std::option::Option<&crate::types::S3Path> {
46 self.source_s3_path.as_ref()
47 }
48 /// <p>A token that you provide to identify the request to create a thesaurus. Multiple calls to the <code>CreateThesaurus</code> API with the same client token will create only one thesaurus.</p>
49 pub fn client_token(&self) -> ::std::option::Option<&str> {
50 self.client_token.as_deref()
51 }
52}
53impl CreateThesaurusInput {
54 /// Creates a new builder-style object to manufacture [`CreateThesaurusInput`](crate::operation::create_thesaurus::CreateThesaurusInput).
55 pub fn builder() -> crate::operation::create_thesaurus::builders::CreateThesaurusInputBuilder {
56 crate::operation::create_thesaurus::builders::CreateThesaurusInputBuilder::default()
57 }
58}
59
60/// A builder for [`CreateThesaurusInput`](crate::operation::create_thesaurus::CreateThesaurusInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateThesaurusInputBuilder {
64 pub(crate) index_id: ::std::option::Option<::std::string::String>,
65 pub(crate) name: ::std::option::Option<::std::string::String>,
66 pub(crate) description: ::std::option::Option<::std::string::String>,
67 pub(crate) role_arn: ::std::option::Option<::std::string::String>,
68 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
69 pub(crate) source_s3_path: ::std::option::Option<crate::types::S3Path>,
70 pub(crate) client_token: ::std::option::Option<::std::string::String>,
71}
72impl CreateThesaurusInputBuilder {
73 /// <p>The identifier of the index for the thesaurus.</p>
74 /// This field is required.
75 pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.index_id = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The identifier of the index for the thesaurus.</p>
80 pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.index_id = input;
82 self
83 }
84 /// <p>The identifier of the index for the thesaurus.</p>
85 pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
86 &self.index_id
87 }
88 /// <p>A name for the thesaurus.</p>
89 /// This field is required.
90 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.name = ::std::option::Option::Some(input.into());
92 self
93 }
94 /// <p>A name for the thesaurus.</p>
95 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.name = input;
97 self
98 }
99 /// <p>A name for the thesaurus.</p>
100 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.name
102 }
103 /// <p>A description for the thesaurus.</p>
104 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.description = ::std::option::Option::Some(input.into());
106 self
107 }
108 /// <p>A description for the thesaurus.</p>
109 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.description = input;
111 self
112 }
113 /// <p>A description for the thesaurus.</p>
114 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
115 &self.description
116 }
117 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket that contains the thesaurus 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>
118 /// This field is required.
119 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.role_arn = ::std::option::Option::Some(input.into());
121 self
122 }
123 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket that contains the thesaurus 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>
124 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.role_arn = input;
126 self
127 }
128 /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket that contains the thesaurus 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>
129 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
130 &self.role_arn
131 }
132 /// Appends an item to `tags`.
133 ///
134 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
135 ///
136 /// <p>A list of key-value pairs that identify or categorize the thesaurus. You can also use tags to help control access to the thesaurus. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
137 pub fn tags(mut self, input: crate::types::Tag) -> Self {
138 let mut v = self.tags.unwrap_or_default();
139 v.push(input);
140 self.tags = ::std::option::Option::Some(v);
141 self
142 }
143 /// <p>A list of key-value pairs that identify or categorize the thesaurus. You can also use tags to help control access to the thesaurus. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
144 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
145 self.tags = input;
146 self
147 }
148 /// <p>A list of key-value pairs that identify or categorize the thesaurus. You can also use tags to help control access to the thesaurus. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
149 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
150 &self.tags
151 }
152 /// <p>The path to the thesaurus file in S3.</p>
153 /// This field is required.
154 pub fn source_s3_path(mut self, input: crate::types::S3Path) -> Self {
155 self.source_s3_path = ::std::option::Option::Some(input);
156 self
157 }
158 /// <p>The path to the thesaurus file in S3.</p>
159 pub fn set_source_s3_path(mut self, input: ::std::option::Option<crate::types::S3Path>) -> Self {
160 self.source_s3_path = input;
161 self
162 }
163 /// <p>The path to the thesaurus file in S3.</p>
164 pub fn get_source_s3_path(&self) -> &::std::option::Option<crate::types::S3Path> {
165 &self.source_s3_path
166 }
167 /// <p>A token that you provide to identify the request to create a thesaurus. Multiple calls to the <code>CreateThesaurus</code> API with the same client token will create only one thesaurus.</p>
168 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.client_token = ::std::option::Option::Some(input.into());
170 self
171 }
172 /// <p>A token that you provide to identify the request to create a thesaurus. Multiple calls to the <code>CreateThesaurus</code> API with the same client token will create only one thesaurus.</p>
173 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.client_token = input;
175 self
176 }
177 /// <p>A token that you provide to identify the request to create a thesaurus. Multiple calls to the <code>CreateThesaurus</code> API with the same client token will create only one thesaurus.</p>
178 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
179 &self.client_token
180 }
181 /// Consumes the builder and constructs a [`CreateThesaurusInput`](crate::operation::create_thesaurus::CreateThesaurusInput).
182 pub fn build(
183 self,
184 ) -> ::std::result::Result<crate::operation::create_thesaurus::CreateThesaurusInput, ::aws_smithy_types::error::operation::BuildError> {
185 ::std::result::Result::Ok(crate::operation::create_thesaurus::CreateThesaurusInput {
186 index_id: self.index_id,
187 name: self.name,
188 description: self.description,
189 role_arn: self.role_arn,
190 tags: self.tags,
191 source_s3_path: self.source_s3_path,
192 client_token: self.client_token,
193 })
194 }
195}