aws_sdk_finspacedata/operation/create_changeset/_create_changeset_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// The request for a CreateChangeset operation.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateChangesetInput {
7 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
8 pub client_token: ::std::option::Option<::std::string::String>,
9 /// <p>The unique identifier for the FinSpace Dataset where the Changeset will be created.</p>
10 pub dataset_id: ::std::option::Option<::std::string::String>,
11 /// <p>The option to indicate how a Changeset will be applied to a Dataset.</p>
12 /// <ul>
13 /// <li>
14 /// <p><code>REPLACE</code> – Changeset will be considered as a replacement to all prior loaded Changesets.</p></li>
15 /// <li>
16 /// <p><code>APPEND</code> – Changeset will be considered as an addition to the end of all prior loaded Changesets.</p></li>
17 /// <li>
18 /// <p><code>MODIFY</code> – Changeset is considered as a replacement to a specific prior ingested Changeset.</p></li>
19 /// </ul>
20 pub change_type: ::std::option::Option<crate::types::ChangeType>,
21 /// <p>Options that define the location of the data being ingested (<code>s3SourcePath</code>) and the source of the changeset (<code>sourceType</code>).</p>
22 /// <p>Both <code>s3SourcePath</code> and <code>sourceType</code> are required attributes.</p>
23 /// <p>Here is an example of how you could specify the <code>sourceParams</code>:</p>
24 /// <p><code> "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } </code></p>
25 /// <p>The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure the IAM policy on S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets">Loading data from an Amazon S3 Bucket using the FinSpace API</a> section.</p>
26 pub source_params: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
27 /// <p>Options that define the structure of the source file(s) including the format type (<code>formatType</code>), header row (<code>withHeader</code>), data separation character (<code>separator</code>) and the type of compression (<code>compression</code>).</p>
28 /// <p><code>formatType</code> is a required attribute and can have the following values:</p>
29 /// <ul>
30 /// <li>
31 /// <p><code>PARQUET</code> – Parquet source file format.</p></li>
32 /// <li>
33 /// <p><code>CSV</code> – CSV source file format.</p></li>
34 /// <li>
35 /// <p><code>JSON</code> – JSON source file format.</p></li>
36 /// <li>
37 /// <p><code>XML</code> – XML source file format.</p></li>
38 /// </ul>
39 /// <p>Here is an example of how you could specify the <code>formatParams</code>:</p>
40 /// <p><code> "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } </code></p>
41 /// <p>Note that if you only provide <code>formatType</code> as <code>CSV</code>, the rest of the attributes will automatically default to CSV values as following:</p>
42 /// <p><code> { "withHeader": "true", "separator": "," } </code></p>
43 /// <p>For more information about supported file formats, see <a href="https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html">Supported Data Types and File Formats</a> in the FinSpace User Guide.</p>
44 pub format_params: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
45}
46impl CreateChangesetInput {
47 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
48 pub fn client_token(&self) -> ::std::option::Option<&str> {
49 self.client_token.as_deref()
50 }
51 /// <p>The unique identifier for the FinSpace Dataset where the Changeset will be created.</p>
52 pub fn dataset_id(&self) -> ::std::option::Option<&str> {
53 self.dataset_id.as_deref()
54 }
55 /// <p>The option to indicate how a Changeset will be applied to a Dataset.</p>
56 /// <ul>
57 /// <li>
58 /// <p><code>REPLACE</code> – Changeset will be considered as a replacement to all prior loaded Changesets.</p></li>
59 /// <li>
60 /// <p><code>APPEND</code> – Changeset will be considered as an addition to the end of all prior loaded Changesets.</p></li>
61 /// <li>
62 /// <p><code>MODIFY</code> – Changeset is considered as a replacement to a specific prior ingested Changeset.</p></li>
63 /// </ul>
64 pub fn change_type(&self) -> ::std::option::Option<&crate::types::ChangeType> {
65 self.change_type.as_ref()
66 }
67 /// <p>Options that define the location of the data being ingested (<code>s3SourcePath</code>) and the source of the changeset (<code>sourceType</code>).</p>
68 /// <p>Both <code>s3SourcePath</code> and <code>sourceType</code> are required attributes.</p>
69 /// <p>Here is an example of how you could specify the <code>sourceParams</code>:</p>
70 /// <p><code> "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } </code></p>
71 /// <p>The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure the IAM policy on S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets">Loading data from an Amazon S3 Bucket using the FinSpace API</a> section.</p>
72 pub fn source_params(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
73 self.source_params.as_ref()
74 }
75 /// <p>Options that define the structure of the source file(s) including the format type (<code>formatType</code>), header row (<code>withHeader</code>), data separation character (<code>separator</code>) and the type of compression (<code>compression</code>).</p>
76 /// <p><code>formatType</code> is a required attribute and can have the following values:</p>
77 /// <ul>
78 /// <li>
79 /// <p><code>PARQUET</code> – Parquet source file format.</p></li>
80 /// <li>
81 /// <p><code>CSV</code> – CSV source file format.</p></li>
82 /// <li>
83 /// <p><code>JSON</code> – JSON source file format.</p></li>
84 /// <li>
85 /// <p><code>XML</code> – XML source file format.</p></li>
86 /// </ul>
87 /// <p>Here is an example of how you could specify the <code>formatParams</code>:</p>
88 /// <p><code> "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } </code></p>
89 /// <p>Note that if you only provide <code>formatType</code> as <code>CSV</code>, the rest of the attributes will automatically default to CSV values as following:</p>
90 /// <p><code> { "withHeader": "true", "separator": "," } </code></p>
91 /// <p>For more information about supported file formats, see <a href="https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html">Supported Data Types and File Formats</a> in the FinSpace User Guide.</p>
92 pub fn format_params(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
93 self.format_params.as_ref()
94 }
95}
96impl CreateChangesetInput {
97 /// Creates a new builder-style object to manufacture [`CreateChangesetInput`](crate::operation::create_changeset::CreateChangesetInput).
98 pub fn builder() -> crate::operation::create_changeset::builders::CreateChangesetInputBuilder {
99 crate::operation::create_changeset::builders::CreateChangesetInputBuilder::default()
100 }
101}
102
103/// A builder for [`CreateChangesetInput`](crate::operation::create_changeset::CreateChangesetInput).
104#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
105#[non_exhaustive]
106pub struct CreateChangesetInputBuilder {
107 pub(crate) client_token: ::std::option::Option<::std::string::String>,
108 pub(crate) dataset_id: ::std::option::Option<::std::string::String>,
109 pub(crate) change_type: ::std::option::Option<crate::types::ChangeType>,
110 pub(crate) source_params: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
111 pub(crate) format_params: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
112}
113impl CreateChangesetInputBuilder {
114 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
115 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.client_token = ::std::option::Option::Some(input.into());
117 self
118 }
119 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
120 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.client_token = input;
122 self
123 }
124 /// <p>A token that ensures idempotency. This token expires in 10 minutes.</p>
125 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
126 &self.client_token
127 }
128 /// <p>The unique identifier for the FinSpace Dataset where the Changeset will be created.</p>
129 /// This field is required.
130 pub fn dataset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.dataset_id = ::std::option::Option::Some(input.into());
132 self
133 }
134 /// <p>The unique identifier for the FinSpace Dataset where the Changeset will be created.</p>
135 pub fn set_dataset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.dataset_id = input;
137 self
138 }
139 /// <p>The unique identifier for the FinSpace Dataset where the Changeset will be created.</p>
140 pub fn get_dataset_id(&self) -> &::std::option::Option<::std::string::String> {
141 &self.dataset_id
142 }
143 /// <p>The option to indicate how a Changeset will be applied to a Dataset.</p>
144 /// <ul>
145 /// <li>
146 /// <p><code>REPLACE</code> – Changeset will be considered as a replacement to all prior loaded Changesets.</p></li>
147 /// <li>
148 /// <p><code>APPEND</code> – Changeset will be considered as an addition to the end of all prior loaded Changesets.</p></li>
149 /// <li>
150 /// <p><code>MODIFY</code> – Changeset is considered as a replacement to a specific prior ingested Changeset.</p></li>
151 /// </ul>
152 /// This field is required.
153 pub fn change_type(mut self, input: crate::types::ChangeType) -> Self {
154 self.change_type = ::std::option::Option::Some(input);
155 self
156 }
157 /// <p>The option to indicate how a Changeset will be applied to a Dataset.</p>
158 /// <ul>
159 /// <li>
160 /// <p><code>REPLACE</code> – Changeset will be considered as a replacement to all prior loaded Changesets.</p></li>
161 /// <li>
162 /// <p><code>APPEND</code> – Changeset will be considered as an addition to the end of all prior loaded Changesets.</p></li>
163 /// <li>
164 /// <p><code>MODIFY</code> – Changeset is considered as a replacement to a specific prior ingested Changeset.</p></li>
165 /// </ul>
166 pub fn set_change_type(mut self, input: ::std::option::Option<crate::types::ChangeType>) -> Self {
167 self.change_type = input;
168 self
169 }
170 /// <p>The option to indicate how a Changeset will be applied to a Dataset.</p>
171 /// <ul>
172 /// <li>
173 /// <p><code>REPLACE</code> – Changeset will be considered as a replacement to all prior loaded Changesets.</p></li>
174 /// <li>
175 /// <p><code>APPEND</code> – Changeset will be considered as an addition to the end of all prior loaded Changesets.</p></li>
176 /// <li>
177 /// <p><code>MODIFY</code> – Changeset is considered as a replacement to a specific prior ingested Changeset.</p></li>
178 /// </ul>
179 pub fn get_change_type(&self) -> &::std::option::Option<crate::types::ChangeType> {
180 &self.change_type
181 }
182 /// Adds a key-value pair to `source_params`.
183 ///
184 /// To override the contents of this collection use [`set_source_params`](Self::set_source_params).
185 ///
186 /// <p>Options that define the location of the data being ingested (<code>s3SourcePath</code>) and the source of the changeset (<code>sourceType</code>).</p>
187 /// <p>Both <code>s3SourcePath</code> and <code>sourceType</code> are required attributes.</p>
188 /// <p>Here is an example of how you could specify the <code>sourceParams</code>:</p>
189 /// <p><code> "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } </code></p>
190 /// <p>The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure the IAM policy on S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets">Loading data from an Amazon S3 Bucket using the FinSpace API</a> section.</p>
191 pub fn source_params(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
192 let mut hash_map = self.source_params.unwrap_or_default();
193 hash_map.insert(k.into(), v.into());
194 self.source_params = ::std::option::Option::Some(hash_map);
195 self
196 }
197 /// <p>Options that define the location of the data being ingested (<code>s3SourcePath</code>) and the source of the changeset (<code>sourceType</code>).</p>
198 /// <p>Both <code>s3SourcePath</code> and <code>sourceType</code> are required attributes.</p>
199 /// <p>Here is an example of how you could specify the <code>sourceParams</code>:</p>
200 /// <p><code> "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } </code></p>
201 /// <p>The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure the IAM policy on S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets">Loading data from an Amazon S3 Bucket using the FinSpace API</a> section.</p>
202 pub fn set_source_params(
203 mut self,
204 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
205 ) -> Self {
206 self.source_params = input;
207 self
208 }
209 /// <p>Options that define the location of the data being ingested (<code>s3SourcePath</code>) and the source of the changeset (<code>sourceType</code>).</p>
210 /// <p>Both <code>s3SourcePath</code> and <code>sourceType</code> are required attributes.</p>
211 /// <p>Here is an example of how you could specify the <code>sourceParams</code>:</p>
212 /// <p><code> "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } </code></p>
213 /// <p>The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure the IAM policy on S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets">Loading data from an Amazon S3 Bucket using the FinSpace API</a> section.</p>
214 pub fn get_source_params(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
215 &self.source_params
216 }
217 /// Adds a key-value pair to `format_params`.
218 ///
219 /// To override the contents of this collection use [`set_format_params`](Self::set_format_params).
220 ///
221 /// <p>Options that define the structure of the source file(s) including the format type (<code>formatType</code>), header row (<code>withHeader</code>), data separation character (<code>separator</code>) and the type of compression (<code>compression</code>).</p>
222 /// <p><code>formatType</code> is a required attribute and can have the following values:</p>
223 /// <ul>
224 /// <li>
225 /// <p><code>PARQUET</code> – Parquet source file format.</p></li>
226 /// <li>
227 /// <p><code>CSV</code> – CSV source file format.</p></li>
228 /// <li>
229 /// <p><code>JSON</code> – JSON source file format.</p></li>
230 /// <li>
231 /// <p><code>XML</code> – XML source file format.</p></li>
232 /// </ul>
233 /// <p>Here is an example of how you could specify the <code>formatParams</code>:</p>
234 /// <p><code> "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } </code></p>
235 /// <p>Note that if you only provide <code>formatType</code> as <code>CSV</code>, the rest of the attributes will automatically default to CSV values as following:</p>
236 /// <p><code> { "withHeader": "true", "separator": "," } </code></p>
237 /// <p>For more information about supported file formats, see <a href="https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html">Supported Data Types and File Formats</a> in the FinSpace User Guide.</p>
238 pub fn format_params(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
239 let mut hash_map = self.format_params.unwrap_or_default();
240 hash_map.insert(k.into(), v.into());
241 self.format_params = ::std::option::Option::Some(hash_map);
242 self
243 }
244 /// <p>Options that define the structure of the source file(s) including the format type (<code>formatType</code>), header row (<code>withHeader</code>), data separation character (<code>separator</code>) and the type of compression (<code>compression</code>).</p>
245 /// <p><code>formatType</code> is a required attribute and can have the following values:</p>
246 /// <ul>
247 /// <li>
248 /// <p><code>PARQUET</code> – Parquet source file format.</p></li>
249 /// <li>
250 /// <p><code>CSV</code> – CSV source file format.</p></li>
251 /// <li>
252 /// <p><code>JSON</code> – JSON source file format.</p></li>
253 /// <li>
254 /// <p><code>XML</code> – XML source file format.</p></li>
255 /// </ul>
256 /// <p>Here is an example of how you could specify the <code>formatParams</code>:</p>
257 /// <p><code> "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } </code></p>
258 /// <p>Note that if you only provide <code>formatType</code> as <code>CSV</code>, the rest of the attributes will automatically default to CSV values as following:</p>
259 /// <p><code> { "withHeader": "true", "separator": "," } </code></p>
260 /// <p>For more information about supported file formats, see <a href="https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html">Supported Data Types and File Formats</a> in the FinSpace User Guide.</p>
261 pub fn set_format_params(
262 mut self,
263 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
264 ) -> Self {
265 self.format_params = input;
266 self
267 }
268 /// <p>Options that define the structure of the source file(s) including the format type (<code>formatType</code>), header row (<code>withHeader</code>), data separation character (<code>separator</code>) and the type of compression (<code>compression</code>).</p>
269 /// <p><code>formatType</code> is a required attribute and can have the following values:</p>
270 /// <ul>
271 /// <li>
272 /// <p><code>PARQUET</code> – Parquet source file format.</p></li>
273 /// <li>
274 /// <p><code>CSV</code> – CSV source file format.</p></li>
275 /// <li>
276 /// <p><code>JSON</code> – JSON source file format.</p></li>
277 /// <li>
278 /// <p><code>XML</code> – XML source file format.</p></li>
279 /// </ul>
280 /// <p>Here is an example of how you could specify the <code>formatParams</code>:</p>
281 /// <p><code> "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } </code></p>
282 /// <p>Note that if you only provide <code>formatType</code> as <code>CSV</code>, the rest of the attributes will automatically default to CSV values as following:</p>
283 /// <p><code> { "withHeader": "true", "separator": "," } </code></p>
284 /// <p>For more information about supported file formats, see <a href="https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html">Supported Data Types and File Formats</a> in the FinSpace User Guide.</p>
285 pub fn get_format_params(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
286 &self.format_params
287 }
288 /// Consumes the builder and constructs a [`CreateChangesetInput`](crate::operation::create_changeset::CreateChangesetInput).
289 pub fn build(
290 self,
291 ) -> ::std::result::Result<crate::operation::create_changeset::CreateChangesetInput, ::aws_smithy_types::error::operation::BuildError> {
292 ::std::result::Result::Ok(crate::operation::create_changeset::CreateChangesetInput {
293 client_token: self.client_token,
294 dataset_id: self.dataset_id,
295 change_type: self.change_type,
296 source_params: self.source_params,
297 format_params: self.format_params,
298 })
299 }
300}