aws_sdk_finspace/operation/create_kx_changeset/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_kx_changeset::_create_kx_changeset_output::CreateKxChangesetOutputBuilder;
3
4pub use crate::operation::create_kx_changeset::_create_kx_changeset_input::CreateKxChangesetInputBuilder;
5
6impl crate::operation::create_kx_changeset::builders::CreateKxChangesetInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_kx_changeset::CreateKxChangesetOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_kx_changeset::CreateKxChangesetError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_kx_changeset();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateKxChangeset`.
24///
25/// <p>Creates a changeset for a kdb database. A changeset allows you to add and delete existing files by using an ordered list of change requests.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateKxChangesetFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_kx_changeset::builders::CreateKxChangesetInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_kx_changeset::CreateKxChangesetOutput,
35 crate::operation::create_kx_changeset::CreateKxChangesetError,
36 > for CreateKxChangesetFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_kx_changeset::CreateKxChangesetOutput,
44 crate::operation::create_kx_changeset::CreateKxChangesetError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateKxChangesetFluentBuilder {
51 /// Creates a new `CreateKxChangesetFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateKxChangeset as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_kx_changeset::builders::CreateKxChangesetInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_kx_changeset::CreateKxChangesetOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_kx_changeset::CreateKxChangesetError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_kx_changeset::CreateKxChangeset::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_kx_changeset::CreateKxChangeset::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_kx_changeset::CreateKxChangesetOutput,
97 crate::operation::create_kx_changeset::CreateKxChangesetError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>A unique identifier of the kdb environment.</p>
112 pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.environment_id(input.into());
114 self
115 }
116 /// <p>A unique identifier of the kdb environment.</p>
117 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_environment_id(input);
119 self
120 }
121 /// <p>A unique identifier of the kdb environment.</p>
122 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_environment_id()
124 }
125 /// <p>The name of the kdb database.</p>
126 pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.database_name(input.into());
128 self
129 }
130 /// <p>The name of the kdb database.</p>
131 pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_database_name(input);
133 self
134 }
135 /// <p>The name of the kdb database.</p>
136 pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_database_name()
138 }
139 ///
140 /// Appends an item to `changeRequests`.
141 ///
142 /// To override the contents of this collection use [`set_change_requests`](Self::set_change_requests).
143 ///
144 /// <p>A list of change request objects that are run in order. A change request object consists of <code>changeType</code> , <code>s3Path</code>, and <code>dbPath</code>. A changeType can have the following values:</p>
145 /// <ul>
146 /// <li>
147 /// <p>PUT – Adds or updates files in a database.</p></li>
148 /// <li>
149 /// <p>DELETE – Deletes files in a database.</p></li>
150 /// </ul>
151 /// <p>All the change requests require a mandatory <code>dbPath</code> attribute that defines the path within the database directory. All database paths must start with a leading / and end with a trailing /. The <code>s3Path</code> attribute defines the s3 source file path and is required for a PUT change type. The <code>s3path</code> must end with a trailing / if it is a directory and must end without a trailing / if it is a file.</p>
152 /// <p>Here are few examples of how you can use the change request object:</p>
153 /// <ol>
154 /// <li>
155 /// <p>This request adds a single sym file at database root location.</p>
156 /// <p><code>{ "changeType": "PUT", "s3Path":"s3://bucket/db/sym", "dbPath":"/"}</code></p></li>
157 /// <li>
158 /// <p>This request adds files in the given <code>s3Path</code> under the 2020.01.02 partition of the database.</p>
159 /// <p><code>{ "changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/", "dbPath":"/2020.01.02/"}</code></p></li>
160 /// <li>
161 /// <p>This request adds files in the given <code>s3Path</code> under the <i>taq</i> table partition of the database.</p>
162 /// <p><code>\[ { "changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/taq/", "dbPath":"/2020.01.02/taq/"}\]</code></p></li>
163 /// <li>
164 /// <p>This request deletes the 2020.01.02 partition of the database.</p>
165 /// <p><code>\[{ "changeType": "DELETE", "dbPath": "/2020.01.02/"} \]</code></p></li>
166 /// <li>
167 /// <p>The <i>DELETE</i> request allows you to delete the existing files under the 2020.01.02 partition of the database, and the <i>PUT</i> request adds a new taq table under it.</p>
168 /// <p><code>\[ {"changeType": "DELETE", "dbPath":"/2020.01.02/"}, {"changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/taq/", "dbPath":"/2020.01.02/taq/"}\]</code></p></li>
169 /// </ol>
170 pub fn change_requests(mut self, input: crate::types::ChangeRequest) -> Self {
171 self.inner = self.inner.change_requests(input);
172 self
173 }
174 /// <p>A list of change request objects that are run in order. A change request object consists of <code>changeType</code> , <code>s3Path</code>, and <code>dbPath</code>. A changeType can have the following values:</p>
175 /// <ul>
176 /// <li>
177 /// <p>PUT – Adds or updates files in a database.</p></li>
178 /// <li>
179 /// <p>DELETE – Deletes files in a database.</p></li>
180 /// </ul>
181 /// <p>All the change requests require a mandatory <code>dbPath</code> attribute that defines the path within the database directory. All database paths must start with a leading / and end with a trailing /. The <code>s3Path</code> attribute defines the s3 source file path and is required for a PUT change type. The <code>s3path</code> must end with a trailing / if it is a directory and must end without a trailing / if it is a file.</p>
182 /// <p>Here are few examples of how you can use the change request object:</p>
183 /// <ol>
184 /// <li>
185 /// <p>This request adds a single sym file at database root location.</p>
186 /// <p><code>{ "changeType": "PUT", "s3Path":"s3://bucket/db/sym", "dbPath":"/"}</code></p></li>
187 /// <li>
188 /// <p>This request adds files in the given <code>s3Path</code> under the 2020.01.02 partition of the database.</p>
189 /// <p><code>{ "changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/", "dbPath":"/2020.01.02/"}</code></p></li>
190 /// <li>
191 /// <p>This request adds files in the given <code>s3Path</code> under the <i>taq</i> table partition of the database.</p>
192 /// <p><code>\[ { "changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/taq/", "dbPath":"/2020.01.02/taq/"}\]</code></p></li>
193 /// <li>
194 /// <p>This request deletes the 2020.01.02 partition of the database.</p>
195 /// <p><code>\[{ "changeType": "DELETE", "dbPath": "/2020.01.02/"} \]</code></p></li>
196 /// <li>
197 /// <p>The <i>DELETE</i> request allows you to delete the existing files under the 2020.01.02 partition of the database, and the <i>PUT</i> request adds a new taq table under it.</p>
198 /// <p><code>\[ {"changeType": "DELETE", "dbPath":"/2020.01.02/"}, {"changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/taq/", "dbPath":"/2020.01.02/taq/"}\]</code></p></li>
199 /// </ol>
200 pub fn set_change_requests(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ChangeRequest>>) -> Self {
201 self.inner = self.inner.set_change_requests(input);
202 self
203 }
204 /// <p>A list of change request objects that are run in order. A change request object consists of <code>changeType</code> , <code>s3Path</code>, and <code>dbPath</code>. A changeType can have the following values:</p>
205 /// <ul>
206 /// <li>
207 /// <p>PUT – Adds or updates files in a database.</p></li>
208 /// <li>
209 /// <p>DELETE – Deletes files in a database.</p></li>
210 /// </ul>
211 /// <p>All the change requests require a mandatory <code>dbPath</code> attribute that defines the path within the database directory. All database paths must start with a leading / and end with a trailing /. The <code>s3Path</code> attribute defines the s3 source file path and is required for a PUT change type. The <code>s3path</code> must end with a trailing / if it is a directory and must end without a trailing / if it is a file.</p>
212 /// <p>Here are few examples of how you can use the change request object:</p>
213 /// <ol>
214 /// <li>
215 /// <p>This request adds a single sym file at database root location.</p>
216 /// <p><code>{ "changeType": "PUT", "s3Path":"s3://bucket/db/sym", "dbPath":"/"}</code></p></li>
217 /// <li>
218 /// <p>This request adds files in the given <code>s3Path</code> under the 2020.01.02 partition of the database.</p>
219 /// <p><code>{ "changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/", "dbPath":"/2020.01.02/"}</code></p></li>
220 /// <li>
221 /// <p>This request adds files in the given <code>s3Path</code> under the <i>taq</i> table partition of the database.</p>
222 /// <p><code>\[ { "changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/taq/", "dbPath":"/2020.01.02/taq/"}\]</code></p></li>
223 /// <li>
224 /// <p>This request deletes the 2020.01.02 partition of the database.</p>
225 /// <p><code>\[{ "changeType": "DELETE", "dbPath": "/2020.01.02/"} \]</code></p></li>
226 /// <li>
227 /// <p>The <i>DELETE</i> request allows you to delete the existing files under the 2020.01.02 partition of the database, and the <i>PUT</i> request adds a new taq table under it.</p>
228 /// <p><code>\[ {"changeType": "DELETE", "dbPath":"/2020.01.02/"}, {"changeType": "PUT", "s3Path":"s3://bucket/db/2020.01.02/taq/", "dbPath":"/2020.01.02/taq/"}\]</code></p></li>
229 /// </ol>
230 pub fn get_change_requests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ChangeRequest>> {
231 self.inner.get_change_requests()
232 }
233 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
234 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235 self.inner = self.inner.client_token(input.into());
236 self
237 }
238 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
239 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240 self.inner = self.inner.set_client_token(input);
241 self
242 }
243 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
244 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
245 self.inner.get_client_token()
246 }
247}