aws_sdk_qconnect/operation/create_content/_create_content_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 CreateContentInput {
6 /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
7 pub knowledge_base_id: ::std::option::Option<::std::string::String>,
8 /// <p>The name of the content. Each piece of content in a knowledge base must have a unique name. You can retrieve a piece of content using only its knowledge base and its name with the <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_SearchContent.html">SearchContent</a> API.</p>
9 pub name: ::std::option::Option<::std::string::String>,
10 /// <p>The title of the content. If not set, the title is equal to the name.</p>
11 pub title: ::std::option::Option<::std::string::String>,
12 /// <p>The URI you want to use for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content.</p>
13 pub override_link_out_uri: ::std::option::Option<::std::string::String>,
14 /// <p>A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Amazon Q in Connect, you can store an external version identifier as metadata to utilize for determining drift.</p>
15 pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16 /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
17 pub upload_id: ::std::option::Option<::std::string::String>,
18 /// <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="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
19 pub client_token: ::std::option::Option<::std::string::String>,
20 /// <p>The tags used to organize, track, or control access for this resource.</p>
21 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22}
23impl CreateContentInput {
24 /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
25 pub fn knowledge_base_id(&self) -> ::std::option::Option<&str> {
26 self.knowledge_base_id.as_deref()
27 }
28 /// <p>The name of the content. Each piece of content in a knowledge base must have a unique name. You can retrieve a piece of content using only its knowledge base and its name with the <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_SearchContent.html">SearchContent</a> API.</p>
29 pub fn name(&self) -> ::std::option::Option<&str> {
30 self.name.as_deref()
31 }
32 /// <p>The title of the content. If not set, the title is equal to the name.</p>
33 pub fn title(&self) -> ::std::option::Option<&str> {
34 self.title.as_deref()
35 }
36 /// <p>The URI you want to use for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content.</p>
37 pub fn override_link_out_uri(&self) -> ::std::option::Option<&str> {
38 self.override_link_out_uri.as_deref()
39 }
40 /// <p>A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Amazon Q in Connect, you can store an external version identifier as metadata to utilize for determining drift.</p>
41 pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
42 self.metadata.as_ref()
43 }
44 /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
45 pub fn upload_id(&self) -> ::std::option::Option<&str> {
46 self.upload_id.as_deref()
47 }
48 /// <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="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
49 pub fn client_token(&self) -> ::std::option::Option<&str> {
50 self.client_token.as_deref()
51 }
52 /// <p>The tags used to organize, track, or control access for this resource.</p>
53 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
54 self.tags.as_ref()
55 }
56}
57impl CreateContentInput {
58 /// Creates a new builder-style object to manufacture [`CreateContentInput`](crate::operation::create_content::CreateContentInput).
59 pub fn builder() -> crate::operation::create_content::builders::CreateContentInputBuilder {
60 crate::operation::create_content::builders::CreateContentInputBuilder::default()
61 }
62}
63
64/// A builder for [`CreateContentInput`](crate::operation::create_content::CreateContentInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CreateContentInputBuilder {
68 pub(crate) knowledge_base_id: ::std::option::Option<::std::string::String>,
69 pub(crate) name: ::std::option::Option<::std::string::String>,
70 pub(crate) title: ::std::option::Option<::std::string::String>,
71 pub(crate) override_link_out_uri: ::std::option::Option<::std::string::String>,
72 pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
73 pub(crate) upload_id: ::std::option::Option<::std::string::String>,
74 pub(crate) client_token: ::std::option::Option<::std::string::String>,
75 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
76}
77impl CreateContentInputBuilder {
78 /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
79 /// This field is required.
80 pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.knowledge_base_id = ::std::option::Option::Some(input.into());
82 self
83 }
84 /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
85 pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.knowledge_base_id = input;
87 self
88 }
89 /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
90 pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
91 &self.knowledge_base_id
92 }
93 /// <p>The name of the content. Each piece of content in a knowledge base must have a unique name. You can retrieve a piece of content using only its knowledge base and its name with the <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_SearchContent.html">SearchContent</a> API.</p>
94 /// This field is required.
95 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.name = ::std::option::Option::Some(input.into());
97 self
98 }
99 /// <p>The name of the content. Each piece of content in a knowledge base must have a unique name. You can retrieve a piece of content using only its knowledge base and its name with the <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_SearchContent.html">SearchContent</a> API.</p>
100 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.name = input;
102 self
103 }
104 /// <p>The name of the content. Each piece of content in a knowledge base must have a unique name. You can retrieve a piece of content using only its knowledge base and its name with the <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_SearchContent.html">SearchContent</a> API.</p>
105 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
106 &self.name
107 }
108 /// <p>The title of the content. If not set, the title is equal to the name.</p>
109 pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110 self.title = ::std::option::Option::Some(input.into());
111 self
112 }
113 /// <p>The title of the content. If not set, the title is equal to the name.</p>
114 pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115 self.title = input;
116 self
117 }
118 /// <p>The title of the content. If not set, the title is equal to the name.</p>
119 pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
120 &self.title
121 }
122 /// <p>The URI you want to use for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content.</p>
123 pub fn override_link_out_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.override_link_out_uri = ::std::option::Option::Some(input.into());
125 self
126 }
127 /// <p>The URI you want to use for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content.</p>
128 pub fn set_override_link_out_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.override_link_out_uri = input;
130 self
131 }
132 /// <p>The URI you want to use for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content.</p>
133 pub fn get_override_link_out_uri(&self) -> &::std::option::Option<::std::string::String> {
134 &self.override_link_out_uri
135 }
136 /// Adds a key-value pair to `metadata`.
137 ///
138 /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
139 ///
140 /// <p>A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Amazon Q in Connect, you can store an external version identifier as metadata to utilize for determining drift.</p>
141 pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
142 let mut hash_map = self.metadata.unwrap_or_default();
143 hash_map.insert(k.into(), v.into());
144 self.metadata = ::std::option::Option::Some(hash_map);
145 self
146 }
147 /// <p>A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Amazon Q in Connect, you can store an external version identifier as metadata to utilize for determining drift.</p>
148 pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
149 self.metadata = input;
150 self
151 }
152 /// <p>A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Amazon Q in Connect, you can store an external version identifier as metadata to utilize for determining drift.</p>
153 pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
154 &self.metadata
155 }
156 /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
157 /// This field is required.
158 pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.upload_id = ::std::option::Option::Some(input.into());
160 self
161 }
162 /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
163 pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.upload_id = input;
165 self
166 }
167 /// <p>A pointer to the uploaded asset. This value is returned by <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html">StartContentUpload</a>.</p>
168 pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
169 &self.upload_id
170 }
171 /// <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="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
172 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.client_token = ::std::option::Option::Some(input.into());
174 self
175 }
176 /// <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="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
177 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.client_token = input;
179 self
180 }
181 /// <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="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
182 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
183 &self.client_token
184 }
185 /// Adds a key-value pair to `tags`.
186 ///
187 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
188 ///
189 /// <p>The tags used to organize, track, or control access for this resource.</p>
190 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
191 let mut hash_map = self.tags.unwrap_or_default();
192 hash_map.insert(k.into(), v.into());
193 self.tags = ::std::option::Option::Some(hash_map);
194 self
195 }
196 /// <p>The tags used to organize, track, or control access for this resource.</p>
197 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
198 self.tags = input;
199 self
200 }
201 /// <p>The tags used to organize, track, or control access for this resource.</p>
202 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
203 &self.tags
204 }
205 /// Consumes the builder and constructs a [`CreateContentInput`](crate::operation::create_content::CreateContentInput).
206 pub fn build(
207 self,
208 ) -> ::std::result::Result<crate::operation::create_content::CreateContentInput, ::aws_smithy_types::error::operation::BuildError> {
209 ::std::result::Result::Ok(crate::operation::create_content::CreateContentInput {
210 knowledge_base_id: self.knowledge_base_id,
211 name: self.name,
212 title: self.title,
213 override_link_out_uri: self.override_link_out_uri,
214 metadata: self.metadata,
215 upload_id: self.upload_id,
216 client_token: self.client_token,
217 tags: self.tags,
218 })
219 }
220}