aws_sdk_qconnect/operation/update_content/_update_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 UpdateContentInput {
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</p>
7 pub knowledge_base_id: ::std::option::Option<::std::string::String>,
8 /// <p>The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
9 pub content_id: ::std::option::Option<::std::string::String>,
10 /// <p>The <code>revisionId</code> of the content resource to update, taken from an earlier call to <code>GetContent</code>, <code>GetContentSummary</code>, <code>SearchContent</code>, or <code>ListContents</code>. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a <code>PreconditionFailedException</code>.</p>
11 pub revision_id: ::std::option::Option<::std::string::String>,
12 /// <p>The title of the content.</p>
13 pub title: ::std::option::Option<::std::string::String>,
14 /// <p>The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing <code>overrideLinkOurUri</code>, exclude this argument and set <code>removeOverrideLinkOutUri</code> to true.</p>
15 pub override_link_out_uri: ::std::option::Option<::std::string::String>,
16 /// <p>Unset the existing <code>overrideLinkOutUri</code> if it exists.</p>
17 pub remove_override_link_out_uri: ::std::option::Option<bool>,
18 /// <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>
19 pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20 /// <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>
21 pub upload_id: ::std::option::Option<::std::string::String>,
22}
23impl UpdateContentInput {
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</p>
25 pub fn knowledge_base_id(&self) -> ::std::option::Option<&str> {
26 self.knowledge_base_id.as_deref()
27 }
28 /// <p>The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
29 pub fn content_id(&self) -> ::std::option::Option<&str> {
30 self.content_id.as_deref()
31 }
32 /// <p>The <code>revisionId</code> of the content resource to update, taken from an earlier call to <code>GetContent</code>, <code>GetContentSummary</code>, <code>SearchContent</code>, or <code>ListContents</code>. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a <code>PreconditionFailedException</code>.</p>
33 pub fn revision_id(&self) -> ::std::option::Option<&str> {
34 self.revision_id.as_deref()
35 }
36 /// <p>The title of the content.</p>
37 pub fn title(&self) -> ::std::option::Option<&str> {
38 self.title.as_deref()
39 }
40 /// <p>The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing <code>overrideLinkOurUri</code>, exclude this argument and set <code>removeOverrideLinkOutUri</code> to true.</p>
41 pub fn override_link_out_uri(&self) -> ::std::option::Option<&str> {
42 self.override_link_out_uri.as_deref()
43 }
44 /// <p>Unset the existing <code>overrideLinkOutUri</code> if it exists.</p>
45 pub fn remove_override_link_out_uri(&self) -> ::std::option::Option<bool> {
46 self.remove_override_link_out_uri
47 }
48 /// <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>
49 pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
50 self.metadata.as_ref()
51 }
52 /// <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>
53 pub fn upload_id(&self) -> ::std::option::Option<&str> {
54 self.upload_id.as_deref()
55 }
56}
57impl UpdateContentInput {
58 /// Creates a new builder-style object to manufacture [`UpdateContentInput`](crate::operation::update_content::UpdateContentInput).
59 pub fn builder() -> crate::operation::update_content::builders::UpdateContentInputBuilder {
60 crate::operation::update_content::builders::UpdateContentInputBuilder::default()
61 }
62}
63
64/// A builder for [`UpdateContentInput`](crate::operation::update_content::UpdateContentInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct UpdateContentInputBuilder {
68 pub(crate) knowledge_base_id: ::std::option::Option<::std::string::String>,
69 pub(crate) content_id: ::std::option::Option<::std::string::String>,
70 pub(crate) revision_id: ::std::option::Option<::std::string::String>,
71 pub(crate) title: ::std::option::Option<::std::string::String>,
72 pub(crate) override_link_out_uri: ::std::option::Option<::std::string::String>,
73 pub(crate) remove_override_link_out_uri: ::std::option::Option<bool>,
74 pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
75 pub(crate) upload_id: ::std::option::Option<::std::string::String>,
76}
77impl UpdateContentInputBuilder {
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</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</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</p>
90 pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
91 &self.knowledge_base_id
92 }
93 /// <p>The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
94 /// This field is required.
95 pub fn content_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.content_id = ::std::option::Option::Some(input.into());
97 self
98 }
99 /// <p>The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
100 pub fn set_content_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.content_id = input;
102 self
103 }
104 /// <p>The identifier of the content. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
105 pub fn get_content_id(&self) -> &::std::option::Option<::std::string::String> {
106 &self.content_id
107 }
108 /// <p>The <code>revisionId</code> of the content resource to update, taken from an earlier call to <code>GetContent</code>, <code>GetContentSummary</code>, <code>SearchContent</code>, or <code>ListContents</code>. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a <code>PreconditionFailedException</code>.</p>
109 pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110 self.revision_id = ::std::option::Option::Some(input.into());
111 self
112 }
113 /// <p>The <code>revisionId</code> of the content resource to update, taken from an earlier call to <code>GetContent</code>, <code>GetContentSummary</code>, <code>SearchContent</code>, or <code>ListContents</code>. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a <code>PreconditionFailedException</code>.</p>
114 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115 self.revision_id = input;
116 self
117 }
118 /// <p>The <code>revisionId</code> of the content resource to update, taken from an earlier call to <code>GetContent</code>, <code>GetContentSummary</code>, <code>SearchContent</code>, or <code>ListContents</code>. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a <code>PreconditionFailedException</code>.</p>
119 pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
120 &self.revision_id
121 }
122 /// <p>The title of the content.</p>
123 pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.title = ::std::option::Option::Some(input.into());
125 self
126 }
127 /// <p>The title of the content.</p>
128 pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.title = input;
130 self
131 }
132 /// <p>The title of the content.</p>
133 pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
134 &self.title
135 }
136 /// <p>The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing <code>overrideLinkOurUri</code>, exclude this argument and set <code>removeOverrideLinkOutUri</code> to true.</p>
137 pub fn override_link_out_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.override_link_out_uri = ::std::option::Option::Some(input.into());
139 self
140 }
141 /// <p>The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing <code>overrideLinkOurUri</code>, exclude this argument and set <code>removeOverrideLinkOutUri</code> to true.</p>
142 pub fn set_override_link_out_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.override_link_out_uri = input;
144 self
145 }
146 /// <p>The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing <code>overrideLinkOurUri</code>, exclude this argument and set <code>removeOverrideLinkOutUri</code> to true.</p>
147 pub fn get_override_link_out_uri(&self) -> &::std::option::Option<::std::string::String> {
148 &self.override_link_out_uri
149 }
150 /// <p>Unset the existing <code>overrideLinkOutUri</code> if it exists.</p>
151 pub fn remove_override_link_out_uri(mut self, input: bool) -> Self {
152 self.remove_override_link_out_uri = ::std::option::Option::Some(input);
153 self
154 }
155 /// <p>Unset the existing <code>overrideLinkOutUri</code> if it exists.</p>
156 pub fn set_remove_override_link_out_uri(mut self, input: ::std::option::Option<bool>) -> Self {
157 self.remove_override_link_out_uri = input;
158 self
159 }
160 /// <p>Unset the existing <code>overrideLinkOutUri</code> if it exists.</p>
161 pub fn get_remove_override_link_out_uri(&self) -> &::std::option::Option<bool> {
162 &self.remove_override_link_out_uri
163 }
164 /// Adds a key-value pair to `metadata`.
165 ///
166 /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
167 ///
168 /// <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>
169 pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
170 let mut hash_map = self.metadata.unwrap_or_default();
171 hash_map.insert(k.into(), v.into());
172 self.metadata = ::std::option::Option::Some(hash_map);
173 self
174 }
175 /// <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>
176 pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
177 self.metadata = input;
178 self
179 }
180 /// <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>
181 pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
182 &self.metadata
183 }
184 /// <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>
185 pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.upload_id = ::std::option::Option::Some(input.into());
187 self
188 }
189 /// <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>
190 pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.upload_id = input;
192 self
193 }
194 /// <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>
195 pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
196 &self.upload_id
197 }
198 /// Consumes the builder and constructs a [`UpdateContentInput`](crate::operation::update_content::UpdateContentInput).
199 pub fn build(
200 self,
201 ) -> ::std::result::Result<crate::operation::update_content::UpdateContentInput, ::aws_smithy_types::error::operation::BuildError> {
202 ::std::result::Result::Ok(crate::operation::update_content::UpdateContentInput {
203 knowledge_base_id: self.knowledge_base_id,
204 content_id: self.content_id,
205 revision_id: self.revision_id,
206 title: self.title,
207 override_link_out_uri: self.override_link_out_uri,
208 remove_override_link_out_uri: self.remove_override_link_out_uri,
209 metadata: self.metadata,
210 upload_id: self.upload_id,
211 })
212 }
213}