1use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::param::{Params, ServiceParams};
23use rusoto_core::proto;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27use serde_json;
28#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
30pub struct AssetDestinationEntry {
31 #[serde(rename = "AssetId")]
33 pub asset_id: String,
34 #[serde(rename = "Bucket")]
36 pub bucket: String,
37 #[serde(rename = "Key")]
39 #[serde(skip_serializing_if = "Option::is_none")]
40 pub key: Option<String>,
41}
42
43#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
44#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
45pub struct AssetDetails {
46 #[serde(rename = "S3SnapshotAsset")]
47 #[serde(skip_serializing_if = "Option::is_none")]
48 pub s3_snapshot_asset: Option<S3SnapshotAsset>,
49}
50
51#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
53#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
54pub struct AssetEntry {
55 #[serde(rename = "Arn")]
57 pub arn: String,
58 #[serde(rename = "AssetDetails")]
60 pub asset_details: AssetDetails,
61 #[serde(rename = "AssetType")]
63 pub asset_type: String,
64 #[serde(rename = "CreatedAt")]
66 pub created_at: f64,
67 #[serde(rename = "DataSetId")]
69 pub data_set_id: String,
70 #[serde(rename = "Id")]
72 pub id: String,
73 #[serde(rename = "Name")]
75 pub name: String,
76 #[serde(rename = "RevisionId")]
78 pub revision_id: String,
79 #[serde(rename = "SourceId")]
81 #[serde(skip_serializing_if = "Option::is_none")]
82 pub source_id: Option<String>,
83 #[serde(rename = "UpdatedAt")]
85 pub updated_at: f64,
86}
87
88#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
90pub struct AssetSourceEntry {
91 #[serde(rename = "Bucket")]
93 pub bucket: String,
94 #[serde(rename = "Key")]
96 pub key: String,
97}
98
99#[derive(Clone, Debug, Default, PartialEq, Serialize)]
100#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
101pub struct CancelJobRequest {
102 #[serde(rename = "JobId")]
104 pub job_id: String,
105}
106
107#[derive(Clone, Debug, Default, PartialEq, Serialize)]
109#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
110pub struct CreateDataSetRequest {
111 #[serde(rename = "AssetType")]
113 pub asset_type: String,
114 #[serde(rename = "Description")]
116 pub description: String,
117 #[serde(rename = "Name")]
119 pub name: String,
120 #[serde(rename = "Tags")]
122 #[serde(skip_serializing_if = "Option::is_none")]
123 pub tags: Option<::std::collections::HashMap<String, String>>,
124}
125
126#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
127#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
128pub struct CreateDataSetResponse {
129 #[serde(rename = "Arn")]
131 #[serde(skip_serializing_if = "Option::is_none")]
132 pub arn: Option<String>,
133 #[serde(rename = "AssetType")]
135 #[serde(skip_serializing_if = "Option::is_none")]
136 pub asset_type: Option<String>,
137 #[serde(rename = "CreatedAt")]
139 #[serde(skip_serializing_if = "Option::is_none")]
140 pub created_at: Option<f64>,
141 #[serde(rename = "Description")]
143 #[serde(skip_serializing_if = "Option::is_none")]
144 pub description: Option<String>,
145 #[serde(rename = "Id")]
147 #[serde(skip_serializing_if = "Option::is_none")]
148 pub id: Option<String>,
149 #[serde(rename = "Name")]
151 #[serde(skip_serializing_if = "Option::is_none")]
152 pub name: Option<String>,
153 #[serde(rename = "Origin")]
155 #[serde(skip_serializing_if = "Option::is_none")]
156 pub origin: Option<String>,
157 #[serde(rename = "OriginDetails")]
159 #[serde(skip_serializing_if = "Option::is_none")]
160 pub origin_details: Option<OriginDetails>,
161 #[serde(rename = "SourceId")]
163 #[serde(skip_serializing_if = "Option::is_none")]
164 pub source_id: Option<String>,
165 #[serde(rename = "Tags")]
167 #[serde(skip_serializing_if = "Option::is_none")]
168 pub tags: Option<::std::collections::HashMap<String, String>>,
169 #[serde(rename = "UpdatedAt")]
171 #[serde(skip_serializing_if = "Option::is_none")]
172 pub updated_at: Option<f64>,
173}
174
175#[derive(Clone, Debug, Default, PartialEq, Serialize)]
177#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
178pub struct CreateJobRequest {
179 #[serde(rename = "Details")]
181 pub details: RequestDetails,
182 #[serde(rename = "Type")]
184 pub type_: String,
185}
186
187#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
188#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
189pub struct CreateJobResponse {
190 #[serde(rename = "Arn")]
192 #[serde(skip_serializing_if = "Option::is_none")]
193 pub arn: Option<String>,
194 #[serde(rename = "CreatedAt")]
196 #[serde(skip_serializing_if = "Option::is_none")]
197 pub created_at: Option<f64>,
198 #[serde(rename = "Details")]
200 #[serde(skip_serializing_if = "Option::is_none")]
201 pub details: Option<ResponseDetails>,
202 #[serde(rename = "Errors")]
204 #[serde(skip_serializing_if = "Option::is_none")]
205 pub errors: Option<Vec<JobError>>,
206 #[serde(rename = "Id")]
208 #[serde(skip_serializing_if = "Option::is_none")]
209 pub id: Option<String>,
210 #[serde(rename = "State")]
212 #[serde(skip_serializing_if = "Option::is_none")]
213 pub state: Option<String>,
214 #[serde(rename = "Type")]
216 #[serde(skip_serializing_if = "Option::is_none")]
217 pub type_: Option<String>,
218 #[serde(rename = "UpdatedAt")]
220 #[serde(skip_serializing_if = "Option::is_none")]
221 pub updated_at: Option<f64>,
222}
223
224#[derive(Clone, Debug, Default, PartialEq, Serialize)]
226#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
227pub struct CreateRevisionRequest {
228 #[serde(rename = "Comment")]
230 #[serde(skip_serializing_if = "Option::is_none")]
231 pub comment: Option<String>,
232 #[serde(rename = "DataSetId")]
234 pub data_set_id: String,
235 #[serde(rename = "Tags")]
237 #[serde(skip_serializing_if = "Option::is_none")]
238 pub tags: Option<::std::collections::HashMap<String, String>>,
239}
240
241#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
242#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
243pub struct CreateRevisionResponse {
244 #[serde(rename = "Arn")]
246 #[serde(skip_serializing_if = "Option::is_none")]
247 pub arn: Option<String>,
248 #[serde(rename = "Comment")]
250 #[serde(skip_serializing_if = "Option::is_none")]
251 pub comment: Option<String>,
252 #[serde(rename = "CreatedAt")]
254 #[serde(skip_serializing_if = "Option::is_none")]
255 pub created_at: Option<f64>,
256 #[serde(rename = "DataSetId")]
258 #[serde(skip_serializing_if = "Option::is_none")]
259 pub data_set_id: Option<String>,
260 #[serde(rename = "Finalized")]
262 #[serde(skip_serializing_if = "Option::is_none")]
263 pub finalized: Option<bool>,
264 #[serde(rename = "Id")]
266 #[serde(skip_serializing_if = "Option::is_none")]
267 pub id: Option<String>,
268 #[serde(rename = "SourceId")]
270 #[serde(skip_serializing_if = "Option::is_none")]
271 pub source_id: Option<String>,
272 #[serde(rename = "Tags")]
274 #[serde(skip_serializing_if = "Option::is_none")]
275 pub tags: Option<::std::collections::HashMap<String, String>>,
276 #[serde(rename = "UpdatedAt")]
278 #[serde(skip_serializing_if = "Option::is_none")]
279 pub updated_at: Option<f64>,
280}
281
282#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
284#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
285pub struct DataSetEntry {
286 #[serde(rename = "Arn")]
288 pub arn: String,
289 #[serde(rename = "AssetType")]
291 pub asset_type: String,
292 #[serde(rename = "CreatedAt")]
294 pub created_at: f64,
295 #[serde(rename = "Description")]
297 pub description: String,
298 #[serde(rename = "Id")]
300 pub id: String,
301 #[serde(rename = "Name")]
303 pub name: String,
304 #[serde(rename = "Origin")]
306 pub origin: String,
307 #[serde(rename = "OriginDetails")]
309 #[serde(skip_serializing_if = "Option::is_none")]
310 pub origin_details: Option<OriginDetails>,
311 #[serde(rename = "SourceId")]
313 #[serde(skip_serializing_if = "Option::is_none")]
314 pub source_id: Option<String>,
315 #[serde(rename = "UpdatedAt")]
317 pub updated_at: f64,
318}
319
320#[derive(Clone, Debug, Default, PartialEq, Serialize)]
321#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
322pub struct DeleteAssetRequest {
323 #[serde(rename = "AssetId")]
325 pub asset_id: String,
326 #[serde(rename = "DataSetId")]
328 pub data_set_id: String,
329 #[serde(rename = "RevisionId")]
331 pub revision_id: String,
332}
333
334#[derive(Clone, Debug, Default, PartialEq, Serialize)]
335#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
336pub struct DeleteDataSetRequest {
337 #[serde(rename = "DataSetId")]
339 pub data_set_id: String,
340}
341
342#[derive(Clone, Debug, Default, PartialEq, Serialize)]
343#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
344pub struct DeleteRevisionRequest {
345 #[serde(rename = "DataSetId")]
347 pub data_set_id: String,
348 #[serde(rename = "RevisionId")]
350 pub revision_id: String,
351}
352
353#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
354#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
355pub struct Details {
356 #[serde(rename = "ImportAssetFromSignedUrlJobErrorDetails")]
357 #[serde(skip_serializing_if = "Option::is_none")]
358 pub import_asset_from_signed_url_job_error_details:
359 Option<ImportAssetFromSignedUrlJobErrorDetails>,
360 #[serde(rename = "ImportAssetsFromS3JobErrorDetails")]
361 #[serde(skip_serializing_if = "Option::is_none")]
362 pub import_assets_from_s3_job_error_details: Option<Vec<AssetSourceEntry>>,
363}
364
365#[derive(Clone, Debug, Default, PartialEq, Serialize)]
367#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
368pub struct ExportAssetToSignedUrlRequestDetails {
369 #[serde(rename = "AssetId")]
371 pub asset_id: String,
372 #[serde(rename = "DataSetId")]
374 pub data_set_id: String,
375 #[serde(rename = "RevisionId")]
377 pub revision_id: String,
378}
379
380#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
382#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
383pub struct ExportAssetToSignedUrlResponseDetails {
384 #[serde(rename = "AssetId")]
386 pub asset_id: String,
387 #[serde(rename = "DataSetId")]
389 pub data_set_id: String,
390 #[serde(rename = "RevisionId")]
392 pub revision_id: String,
393 #[serde(rename = "SignedUrl")]
395 #[serde(skip_serializing_if = "Option::is_none")]
396 pub signed_url: Option<String>,
397 #[serde(rename = "SignedUrlExpiresAt")]
399 #[serde(skip_serializing_if = "Option::is_none")]
400 pub signed_url_expires_at: Option<f64>,
401}
402
403#[derive(Clone, Debug, Default, PartialEq, Serialize)]
405#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
406pub struct ExportAssetsToS3RequestDetails {
407 #[serde(rename = "AssetDestinations")]
409 pub asset_destinations: Vec<AssetDestinationEntry>,
410 #[serde(rename = "DataSetId")]
412 pub data_set_id: String,
413 #[serde(rename = "Encryption")]
415 #[serde(skip_serializing_if = "Option::is_none")]
416 pub encryption: Option<ExportServerSideEncryption>,
417 #[serde(rename = "RevisionId")]
419 pub revision_id: String,
420}
421
422#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
424#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
425pub struct ExportAssetsToS3ResponseDetails {
426 #[serde(rename = "AssetDestinations")]
428 pub asset_destinations: Vec<AssetDestinationEntry>,
429 #[serde(rename = "DataSetId")]
431 pub data_set_id: String,
432 #[serde(rename = "Encryption")]
434 #[serde(skip_serializing_if = "Option::is_none")]
435 pub encryption: Option<ExportServerSideEncryption>,
436 #[serde(rename = "RevisionId")]
438 pub revision_id: String,
439}
440
441#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
443pub struct ExportServerSideEncryption {
444 #[serde(rename = "KmsKeyArn")]
446 #[serde(skip_serializing_if = "Option::is_none")]
447 pub kms_key_arn: Option<String>,
448 #[serde(rename = "Type")]
450 pub type_: String,
451}
452
453#[derive(Clone, Debug, Default, PartialEq, Serialize)]
454#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
455pub struct GetAssetRequest {
456 #[serde(rename = "AssetId")]
458 pub asset_id: String,
459 #[serde(rename = "DataSetId")]
461 pub data_set_id: String,
462 #[serde(rename = "RevisionId")]
464 pub revision_id: String,
465}
466
467#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
468#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
469pub struct GetAssetResponse {
470 #[serde(rename = "Arn")]
472 #[serde(skip_serializing_if = "Option::is_none")]
473 pub arn: Option<String>,
474 #[serde(rename = "AssetDetails")]
476 #[serde(skip_serializing_if = "Option::is_none")]
477 pub asset_details: Option<AssetDetails>,
478 #[serde(rename = "AssetType")]
480 #[serde(skip_serializing_if = "Option::is_none")]
481 pub asset_type: Option<String>,
482 #[serde(rename = "CreatedAt")]
484 #[serde(skip_serializing_if = "Option::is_none")]
485 pub created_at: Option<f64>,
486 #[serde(rename = "DataSetId")]
488 #[serde(skip_serializing_if = "Option::is_none")]
489 pub data_set_id: Option<String>,
490 #[serde(rename = "Id")]
492 #[serde(skip_serializing_if = "Option::is_none")]
493 pub id: Option<String>,
494 #[serde(rename = "Name")]
496 #[serde(skip_serializing_if = "Option::is_none")]
497 pub name: Option<String>,
498 #[serde(rename = "RevisionId")]
500 #[serde(skip_serializing_if = "Option::is_none")]
501 pub revision_id: Option<String>,
502 #[serde(rename = "SourceId")]
504 #[serde(skip_serializing_if = "Option::is_none")]
505 pub source_id: Option<String>,
506 #[serde(rename = "UpdatedAt")]
508 #[serde(skip_serializing_if = "Option::is_none")]
509 pub updated_at: Option<f64>,
510}
511
512#[derive(Clone, Debug, Default, PartialEq, Serialize)]
513#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
514pub struct GetDataSetRequest {
515 #[serde(rename = "DataSetId")]
517 pub data_set_id: String,
518}
519
520#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
521#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
522pub struct GetDataSetResponse {
523 #[serde(rename = "Arn")]
525 #[serde(skip_serializing_if = "Option::is_none")]
526 pub arn: Option<String>,
527 #[serde(rename = "AssetType")]
529 #[serde(skip_serializing_if = "Option::is_none")]
530 pub asset_type: Option<String>,
531 #[serde(rename = "CreatedAt")]
533 #[serde(skip_serializing_if = "Option::is_none")]
534 pub created_at: Option<f64>,
535 #[serde(rename = "Description")]
537 #[serde(skip_serializing_if = "Option::is_none")]
538 pub description: Option<String>,
539 #[serde(rename = "Id")]
541 #[serde(skip_serializing_if = "Option::is_none")]
542 pub id: Option<String>,
543 #[serde(rename = "Name")]
545 #[serde(skip_serializing_if = "Option::is_none")]
546 pub name: Option<String>,
547 #[serde(rename = "Origin")]
549 #[serde(skip_serializing_if = "Option::is_none")]
550 pub origin: Option<String>,
551 #[serde(rename = "OriginDetails")]
553 #[serde(skip_serializing_if = "Option::is_none")]
554 pub origin_details: Option<OriginDetails>,
555 #[serde(rename = "SourceId")]
557 #[serde(skip_serializing_if = "Option::is_none")]
558 pub source_id: Option<String>,
559 #[serde(rename = "Tags")]
561 #[serde(skip_serializing_if = "Option::is_none")]
562 pub tags: Option<::std::collections::HashMap<String, String>>,
563 #[serde(rename = "UpdatedAt")]
565 #[serde(skip_serializing_if = "Option::is_none")]
566 pub updated_at: Option<f64>,
567}
568
569#[derive(Clone, Debug, Default, PartialEq, Serialize)]
570#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
571pub struct GetJobRequest {
572 #[serde(rename = "JobId")]
574 pub job_id: String,
575}
576
577#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
578#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
579pub struct GetJobResponse {
580 #[serde(rename = "Arn")]
582 #[serde(skip_serializing_if = "Option::is_none")]
583 pub arn: Option<String>,
584 #[serde(rename = "CreatedAt")]
586 #[serde(skip_serializing_if = "Option::is_none")]
587 pub created_at: Option<f64>,
588 #[serde(rename = "Details")]
590 #[serde(skip_serializing_if = "Option::is_none")]
591 pub details: Option<ResponseDetails>,
592 #[serde(rename = "Errors")]
594 #[serde(skip_serializing_if = "Option::is_none")]
595 pub errors: Option<Vec<JobError>>,
596 #[serde(rename = "Id")]
598 #[serde(skip_serializing_if = "Option::is_none")]
599 pub id: Option<String>,
600 #[serde(rename = "State")]
602 #[serde(skip_serializing_if = "Option::is_none")]
603 pub state: Option<String>,
604 #[serde(rename = "Type")]
606 #[serde(skip_serializing_if = "Option::is_none")]
607 pub type_: Option<String>,
608 #[serde(rename = "UpdatedAt")]
610 #[serde(skip_serializing_if = "Option::is_none")]
611 pub updated_at: Option<f64>,
612}
613
614#[derive(Clone, Debug, Default, PartialEq, Serialize)]
615#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
616pub struct GetRevisionRequest {
617 #[serde(rename = "DataSetId")]
619 pub data_set_id: String,
620 #[serde(rename = "RevisionId")]
622 pub revision_id: String,
623}
624
625#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
626#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
627pub struct GetRevisionResponse {
628 #[serde(rename = "Arn")]
630 #[serde(skip_serializing_if = "Option::is_none")]
631 pub arn: Option<String>,
632 #[serde(rename = "Comment")]
634 #[serde(skip_serializing_if = "Option::is_none")]
635 pub comment: Option<String>,
636 #[serde(rename = "CreatedAt")]
638 #[serde(skip_serializing_if = "Option::is_none")]
639 pub created_at: Option<f64>,
640 #[serde(rename = "DataSetId")]
642 #[serde(skip_serializing_if = "Option::is_none")]
643 pub data_set_id: Option<String>,
644 #[serde(rename = "Finalized")]
646 #[serde(skip_serializing_if = "Option::is_none")]
647 pub finalized: Option<bool>,
648 #[serde(rename = "Id")]
650 #[serde(skip_serializing_if = "Option::is_none")]
651 pub id: Option<String>,
652 #[serde(rename = "SourceId")]
654 #[serde(skip_serializing_if = "Option::is_none")]
655 pub source_id: Option<String>,
656 #[serde(rename = "Tags")]
658 #[serde(skip_serializing_if = "Option::is_none")]
659 pub tags: Option<::std::collections::HashMap<String, String>>,
660 #[serde(rename = "UpdatedAt")]
662 #[serde(skip_serializing_if = "Option::is_none")]
663 pub updated_at: Option<f64>,
664}
665
666#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
667#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
668pub struct ImportAssetFromSignedUrlJobErrorDetails {
669 #[serde(rename = "AssetName")]
670 pub asset_name: String,
671}
672
673#[derive(Clone, Debug, Default, PartialEq, Serialize)]
675#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
676pub struct ImportAssetFromSignedUrlRequestDetails {
677 #[serde(rename = "AssetName")]
679 pub asset_name: String,
680 #[serde(rename = "DataSetId")]
682 pub data_set_id: String,
683 #[serde(rename = "Md5Hash")]
685 pub md_5_hash: String,
686 #[serde(rename = "RevisionId")]
688 pub revision_id: String,
689}
690
691#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
693#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
694pub struct ImportAssetFromSignedUrlResponseDetails {
695 #[serde(rename = "AssetName")]
697 pub asset_name: String,
698 #[serde(rename = "DataSetId")]
700 pub data_set_id: String,
701 #[serde(rename = "Md5Hash")]
703 #[serde(skip_serializing_if = "Option::is_none")]
704 pub md_5_hash: Option<String>,
705 #[serde(rename = "RevisionId")]
707 pub revision_id: String,
708 #[serde(rename = "SignedUrl")]
710 #[serde(skip_serializing_if = "Option::is_none")]
711 pub signed_url: Option<String>,
712 #[serde(rename = "SignedUrlExpiresAt")]
714 #[serde(skip_serializing_if = "Option::is_none")]
715 pub signed_url_expires_at: Option<f64>,
716}
717
718#[derive(Clone, Debug, Default, PartialEq, Serialize)]
720#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
721pub struct ImportAssetsFromS3RequestDetails {
722 #[serde(rename = "AssetSources")]
724 pub asset_sources: Vec<AssetSourceEntry>,
725 #[serde(rename = "DataSetId")]
727 pub data_set_id: String,
728 #[serde(rename = "RevisionId")]
730 pub revision_id: String,
731}
732
733#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
735#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
736pub struct ImportAssetsFromS3ResponseDetails {
737 #[serde(rename = "AssetSources")]
739 pub asset_sources: Vec<AssetSourceEntry>,
740 #[serde(rename = "DataSetId")]
742 pub data_set_id: String,
743 #[serde(rename = "RevisionId")]
745 pub revision_id: String,
746}
747
748#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
750#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
751pub struct JobEntry {
752 #[serde(rename = "Arn")]
754 pub arn: String,
755 #[serde(rename = "CreatedAt")]
757 pub created_at: f64,
758 #[serde(rename = "Details")]
760 pub details: ResponseDetails,
761 #[serde(rename = "Errors")]
763 #[serde(skip_serializing_if = "Option::is_none")]
764 pub errors: Option<Vec<JobError>>,
765 #[serde(rename = "Id")]
767 pub id: String,
768 #[serde(rename = "State")]
770 pub state: String,
771 #[serde(rename = "Type")]
773 pub type_: String,
774 #[serde(rename = "UpdatedAt")]
776 pub updated_at: f64,
777}
778
779#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
781#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
782pub struct JobError {
783 #[serde(rename = "Code")]
785 pub code: String,
786 #[serde(rename = "Details")]
787 #[serde(skip_serializing_if = "Option::is_none")]
788 pub details: Option<Details>,
789 #[serde(rename = "LimitName")]
791 #[serde(skip_serializing_if = "Option::is_none")]
792 pub limit_name: Option<String>,
793 #[serde(rename = "LimitValue")]
795 #[serde(skip_serializing_if = "Option::is_none")]
796 pub limit_value: Option<f64>,
797 #[serde(rename = "Message")]
799 pub message: String,
800 #[serde(rename = "ResourceId")]
802 #[serde(skip_serializing_if = "Option::is_none")]
803 pub resource_id: Option<String>,
804 #[serde(rename = "ResourceType")]
806 #[serde(skip_serializing_if = "Option::is_none")]
807 pub resource_type: Option<String>,
808}
809
810#[derive(Clone, Debug, Default, PartialEq, Serialize)]
811#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
812pub struct ListDataSetRevisionsRequest {
813 #[serde(rename = "DataSetId")]
815 pub data_set_id: String,
816 #[serde(rename = "MaxResults")]
818 #[serde(skip_serializing_if = "Option::is_none")]
819 pub max_results: Option<i64>,
820 #[serde(rename = "NextToken")]
822 #[serde(skip_serializing_if = "Option::is_none")]
823 pub next_token: Option<String>,
824}
825
826#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
827#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
828pub struct ListDataSetRevisionsResponse {
829 #[serde(rename = "NextToken")]
831 #[serde(skip_serializing_if = "Option::is_none")]
832 pub next_token: Option<String>,
833 #[serde(rename = "Revisions")]
835 #[serde(skip_serializing_if = "Option::is_none")]
836 pub revisions: Option<Vec<RevisionEntry>>,
837}
838
839#[derive(Clone, Debug, Default, PartialEq, Serialize)]
840#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
841pub struct ListDataSetsRequest {
842 #[serde(rename = "MaxResults")]
844 #[serde(skip_serializing_if = "Option::is_none")]
845 pub max_results: Option<i64>,
846 #[serde(rename = "NextToken")]
848 #[serde(skip_serializing_if = "Option::is_none")]
849 pub next_token: Option<String>,
850 #[serde(rename = "Origin")]
852 #[serde(skip_serializing_if = "Option::is_none")]
853 pub origin: Option<String>,
854}
855
856#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
857#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
858pub struct ListDataSetsResponse {
859 #[serde(rename = "DataSets")]
861 #[serde(skip_serializing_if = "Option::is_none")]
862 pub data_sets: Option<Vec<DataSetEntry>>,
863 #[serde(rename = "NextToken")]
865 #[serde(skip_serializing_if = "Option::is_none")]
866 pub next_token: Option<String>,
867}
868
869#[derive(Clone, Debug, Default, PartialEq, Serialize)]
870#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
871pub struct ListJobsRequest {
872 #[serde(rename = "DataSetId")]
874 #[serde(skip_serializing_if = "Option::is_none")]
875 pub data_set_id: Option<String>,
876 #[serde(rename = "MaxResults")]
878 #[serde(skip_serializing_if = "Option::is_none")]
879 pub max_results: Option<i64>,
880 #[serde(rename = "NextToken")]
882 #[serde(skip_serializing_if = "Option::is_none")]
883 pub next_token: Option<String>,
884 #[serde(rename = "RevisionId")]
886 #[serde(skip_serializing_if = "Option::is_none")]
887 pub revision_id: Option<String>,
888}
889
890#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
891#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
892pub struct ListJobsResponse {
893 #[serde(rename = "Jobs")]
895 #[serde(skip_serializing_if = "Option::is_none")]
896 pub jobs: Option<Vec<JobEntry>>,
897 #[serde(rename = "NextToken")]
899 #[serde(skip_serializing_if = "Option::is_none")]
900 pub next_token: Option<String>,
901}
902
903#[derive(Clone, Debug, Default, PartialEq, Serialize)]
904#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
905pub struct ListRevisionAssetsRequest {
906 #[serde(rename = "DataSetId")]
908 pub data_set_id: String,
909 #[serde(rename = "MaxResults")]
911 #[serde(skip_serializing_if = "Option::is_none")]
912 pub max_results: Option<i64>,
913 #[serde(rename = "NextToken")]
915 #[serde(skip_serializing_if = "Option::is_none")]
916 pub next_token: Option<String>,
917 #[serde(rename = "RevisionId")]
919 pub revision_id: String,
920}
921
922#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
923#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
924pub struct ListRevisionAssetsResponse {
925 #[serde(rename = "Assets")]
927 #[serde(skip_serializing_if = "Option::is_none")]
928 pub assets: Option<Vec<AssetEntry>>,
929 #[serde(rename = "NextToken")]
931 #[serde(skip_serializing_if = "Option::is_none")]
932 pub next_token: Option<String>,
933}
934
935#[derive(Clone, Debug, Default, PartialEq, Serialize)]
936#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
937pub struct ListTagsForResourceRequest {
938 #[serde(rename = "ResourceArn")]
940 pub resource_arn: String,
941}
942
943#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
944#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
945pub struct ListTagsForResourceResponse {
946 #[serde(rename = "Tags")]
948 #[serde(skip_serializing_if = "Option::is_none")]
949 pub tags: Option<::std::collections::HashMap<String, String>>,
950}
951
952#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
953#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
954pub struct OriginDetails {
955 #[serde(rename = "ProductId")]
956 pub product_id: String,
957}
958
959#[derive(Clone, Debug, Default, PartialEq, Serialize)]
961#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
962pub struct RequestDetails {
963 #[serde(rename = "ExportAssetToSignedUrl")]
965 #[serde(skip_serializing_if = "Option::is_none")]
966 pub export_asset_to_signed_url: Option<ExportAssetToSignedUrlRequestDetails>,
967 #[serde(rename = "ExportAssetsToS3")]
969 #[serde(skip_serializing_if = "Option::is_none")]
970 pub export_assets_to_s3: Option<ExportAssetsToS3RequestDetails>,
971 #[serde(rename = "ImportAssetFromSignedUrl")]
973 #[serde(skip_serializing_if = "Option::is_none")]
974 pub import_asset_from_signed_url: Option<ImportAssetFromSignedUrlRequestDetails>,
975 #[serde(rename = "ImportAssetsFromS3")]
977 #[serde(skip_serializing_if = "Option::is_none")]
978 pub import_assets_from_s3: Option<ImportAssetsFromS3RequestDetails>,
979}
980
981#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
983#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
984pub struct ResponseDetails {
985 #[serde(rename = "ExportAssetToSignedUrl")]
987 #[serde(skip_serializing_if = "Option::is_none")]
988 pub export_asset_to_signed_url: Option<ExportAssetToSignedUrlResponseDetails>,
989 #[serde(rename = "ExportAssetsToS3")]
991 #[serde(skip_serializing_if = "Option::is_none")]
992 pub export_assets_to_s3: Option<ExportAssetsToS3ResponseDetails>,
993 #[serde(rename = "ImportAssetFromSignedUrl")]
995 #[serde(skip_serializing_if = "Option::is_none")]
996 pub import_asset_from_signed_url: Option<ImportAssetFromSignedUrlResponseDetails>,
997 #[serde(rename = "ImportAssetsFromS3")]
999 #[serde(skip_serializing_if = "Option::is_none")]
1000 pub import_assets_from_s3: Option<ImportAssetsFromS3ResponseDetails>,
1001}
1002
1003#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1005#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1006pub struct RevisionEntry {
1007 #[serde(rename = "Arn")]
1009 pub arn: String,
1010 #[serde(rename = "Comment")]
1012 #[serde(skip_serializing_if = "Option::is_none")]
1013 pub comment: Option<String>,
1014 #[serde(rename = "CreatedAt")]
1016 pub created_at: f64,
1017 #[serde(rename = "DataSetId")]
1019 pub data_set_id: String,
1020 #[serde(rename = "Finalized")]
1022 #[serde(skip_serializing_if = "Option::is_none")]
1023 pub finalized: Option<bool>,
1024 #[serde(rename = "Id")]
1026 pub id: String,
1027 #[serde(rename = "SourceId")]
1029 #[serde(skip_serializing_if = "Option::is_none")]
1030 pub source_id: Option<String>,
1031 #[serde(rename = "UpdatedAt")]
1033 pub updated_at: f64,
1034}
1035
1036#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1038#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1039pub struct S3SnapshotAsset {
1040 #[serde(rename = "Size")]
1042 pub size: f64,
1043}
1044
1045#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1046#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1047pub struct StartJobRequest {
1048 #[serde(rename = "JobId")]
1050 pub job_id: String,
1051}
1052
1053#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1054#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1055pub struct StartJobResponse {}
1056
1057#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1059#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1060pub struct TagResourceRequest {
1061 #[serde(rename = "ResourceArn")]
1063 pub resource_arn: String,
1064 #[serde(rename = "Tags")]
1066 pub tags: ::std::collections::HashMap<String, String>,
1067}
1068
1069#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1070#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1071pub struct UntagResourceRequest {
1072 #[serde(rename = "ResourceArn")]
1074 pub resource_arn: String,
1075 #[serde(rename = "TagKeys")]
1077 pub tag_keys: Vec<String>,
1078}
1079
1080#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1082#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1083pub struct UpdateAssetRequest {
1084 #[serde(rename = "AssetId")]
1086 pub asset_id: String,
1087 #[serde(rename = "DataSetId")]
1089 pub data_set_id: String,
1090 #[serde(rename = "Name")]
1092 pub name: String,
1093 #[serde(rename = "RevisionId")]
1095 pub revision_id: String,
1096}
1097
1098#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1099#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1100pub struct UpdateAssetResponse {
1101 #[serde(rename = "Arn")]
1103 #[serde(skip_serializing_if = "Option::is_none")]
1104 pub arn: Option<String>,
1105 #[serde(rename = "AssetDetails")]
1107 #[serde(skip_serializing_if = "Option::is_none")]
1108 pub asset_details: Option<AssetDetails>,
1109 #[serde(rename = "AssetType")]
1111 #[serde(skip_serializing_if = "Option::is_none")]
1112 pub asset_type: Option<String>,
1113 #[serde(rename = "CreatedAt")]
1115 #[serde(skip_serializing_if = "Option::is_none")]
1116 pub created_at: Option<f64>,
1117 #[serde(rename = "DataSetId")]
1119 #[serde(skip_serializing_if = "Option::is_none")]
1120 pub data_set_id: Option<String>,
1121 #[serde(rename = "Id")]
1123 #[serde(skip_serializing_if = "Option::is_none")]
1124 pub id: Option<String>,
1125 #[serde(rename = "Name")]
1127 #[serde(skip_serializing_if = "Option::is_none")]
1128 pub name: Option<String>,
1129 #[serde(rename = "RevisionId")]
1131 #[serde(skip_serializing_if = "Option::is_none")]
1132 pub revision_id: Option<String>,
1133 #[serde(rename = "SourceId")]
1135 #[serde(skip_serializing_if = "Option::is_none")]
1136 pub source_id: Option<String>,
1137 #[serde(rename = "UpdatedAt")]
1139 #[serde(skip_serializing_if = "Option::is_none")]
1140 pub updated_at: Option<f64>,
1141}
1142
1143#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1145#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1146pub struct UpdateDataSetRequest {
1147 #[serde(rename = "DataSetId")]
1149 pub data_set_id: String,
1150 #[serde(rename = "Description")]
1152 #[serde(skip_serializing_if = "Option::is_none")]
1153 pub description: Option<String>,
1154 #[serde(rename = "Name")]
1156 #[serde(skip_serializing_if = "Option::is_none")]
1157 pub name: Option<String>,
1158}
1159
1160#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1161#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1162pub struct UpdateDataSetResponse {
1163 #[serde(rename = "Arn")]
1165 #[serde(skip_serializing_if = "Option::is_none")]
1166 pub arn: Option<String>,
1167 #[serde(rename = "AssetType")]
1169 #[serde(skip_serializing_if = "Option::is_none")]
1170 pub asset_type: Option<String>,
1171 #[serde(rename = "CreatedAt")]
1173 #[serde(skip_serializing_if = "Option::is_none")]
1174 pub created_at: Option<f64>,
1175 #[serde(rename = "Description")]
1177 #[serde(skip_serializing_if = "Option::is_none")]
1178 pub description: Option<String>,
1179 #[serde(rename = "Id")]
1181 #[serde(skip_serializing_if = "Option::is_none")]
1182 pub id: Option<String>,
1183 #[serde(rename = "Name")]
1185 #[serde(skip_serializing_if = "Option::is_none")]
1186 pub name: Option<String>,
1187 #[serde(rename = "Origin")]
1189 #[serde(skip_serializing_if = "Option::is_none")]
1190 pub origin: Option<String>,
1191 #[serde(rename = "OriginDetails")]
1193 #[serde(skip_serializing_if = "Option::is_none")]
1194 pub origin_details: Option<OriginDetails>,
1195 #[serde(rename = "SourceId")]
1197 #[serde(skip_serializing_if = "Option::is_none")]
1198 pub source_id: Option<String>,
1199 #[serde(rename = "UpdatedAt")]
1201 #[serde(skip_serializing_if = "Option::is_none")]
1202 pub updated_at: Option<f64>,
1203}
1204
1205#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1207#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1208pub struct UpdateRevisionRequest {
1209 #[serde(rename = "Comment")]
1211 #[serde(skip_serializing_if = "Option::is_none")]
1212 pub comment: Option<String>,
1213 #[serde(rename = "DataSetId")]
1215 pub data_set_id: String,
1216 #[serde(rename = "Finalized")]
1218 #[serde(skip_serializing_if = "Option::is_none")]
1219 pub finalized: Option<bool>,
1220 #[serde(rename = "RevisionId")]
1222 pub revision_id: String,
1223}
1224
1225#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1226#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1227pub struct UpdateRevisionResponse {
1228 #[serde(rename = "Arn")]
1230 #[serde(skip_serializing_if = "Option::is_none")]
1231 pub arn: Option<String>,
1232 #[serde(rename = "Comment")]
1234 #[serde(skip_serializing_if = "Option::is_none")]
1235 pub comment: Option<String>,
1236 #[serde(rename = "CreatedAt")]
1238 #[serde(skip_serializing_if = "Option::is_none")]
1239 pub created_at: Option<f64>,
1240 #[serde(rename = "DataSetId")]
1242 #[serde(skip_serializing_if = "Option::is_none")]
1243 pub data_set_id: Option<String>,
1244 #[serde(rename = "Finalized")]
1246 #[serde(skip_serializing_if = "Option::is_none")]
1247 pub finalized: Option<bool>,
1248 #[serde(rename = "Id")]
1250 #[serde(skip_serializing_if = "Option::is_none")]
1251 pub id: Option<String>,
1252 #[serde(rename = "SourceId")]
1254 #[serde(skip_serializing_if = "Option::is_none")]
1255 pub source_id: Option<String>,
1256 #[serde(rename = "UpdatedAt")]
1258 #[serde(skip_serializing_if = "Option::is_none")]
1259 pub updated_at: Option<f64>,
1260}
1261
1262#[derive(Debug, PartialEq)]
1264pub enum CancelJobError {
1265 Conflict(String),
1267 InternalServer(String),
1269 ResourceNotFound(String),
1271 Throttling(String),
1273}
1274
1275impl CancelJobError {
1276 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CancelJobError> {
1277 if let Some(err) = proto::json::Error::parse_rest(&res) {
1278 match err.typ.as_str() {
1279 "ConflictException" => {
1280 return RusotoError::Service(CancelJobError::Conflict(err.msg))
1281 }
1282 "InternalServerException" => {
1283 return RusotoError::Service(CancelJobError::InternalServer(err.msg))
1284 }
1285 "ResourceNotFoundException" => {
1286 return RusotoError::Service(CancelJobError::ResourceNotFound(err.msg))
1287 }
1288 "ThrottlingException" => {
1289 return RusotoError::Service(CancelJobError::Throttling(err.msg))
1290 }
1291 "ValidationException" => return RusotoError::Validation(err.msg),
1292 _ => {}
1293 }
1294 }
1295 RusotoError::Unknown(res)
1296 }
1297}
1298impl fmt::Display for CancelJobError {
1299 #[allow(unused_variables)]
1300 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1301 match *self {
1302 CancelJobError::Conflict(ref cause) => write!(f, "{}", cause),
1303 CancelJobError::InternalServer(ref cause) => write!(f, "{}", cause),
1304 CancelJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1305 CancelJobError::Throttling(ref cause) => write!(f, "{}", cause),
1306 }
1307 }
1308}
1309impl Error for CancelJobError {}
1310#[derive(Debug, PartialEq)]
1312pub enum CreateDataSetError {
1313 AccessDenied(String),
1315 InternalServer(String),
1317 ServiceLimitExceeded(String),
1319 Throttling(String),
1321}
1322
1323impl CreateDataSetError {
1324 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDataSetError> {
1325 if let Some(err) = proto::json::Error::parse_rest(&res) {
1326 match err.typ.as_str() {
1327 "AccessDeniedException" => {
1328 return RusotoError::Service(CreateDataSetError::AccessDenied(err.msg))
1329 }
1330 "InternalServerException" => {
1331 return RusotoError::Service(CreateDataSetError::InternalServer(err.msg))
1332 }
1333 "ServiceLimitExceededException" => {
1334 return RusotoError::Service(CreateDataSetError::ServiceLimitExceeded(err.msg))
1335 }
1336 "ThrottlingException" => {
1337 return RusotoError::Service(CreateDataSetError::Throttling(err.msg))
1338 }
1339 "ValidationException" => return RusotoError::Validation(err.msg),
1340 _ => {}
1341 }
1342 }
1343 RusotoError::Unknown(res)
1344 }
1345}
1346impl fmt::Display for CreateDataSetError {
1347 #[allow(unused_variables)]
1348 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1349 match *self {
1350 CreateDataSetError::AccessDenied(ref cause) => write!(f, "{}", cause),
1351 CreateDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
1352 CreateDataSetError::ServiceLimitExceeded(ref cause) => write!(f, "{}", cause),
1353 CreateDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
1354 }
1355 }
1356}
1357impl Error for CreateDataSetError {}
1358#[derive(Debug, PartialEq)]
1360pub enum CreateJobError {
1361 AccessDenied(String),
1363 InternalServer(String),
1365 ResourceNotFound(String),
1367 Throttling(String),
1369}
1370
1371impl CreateJobError {
1372 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateJobError> {
1373 if let Some(err) = proto::json::Error::parse_rest(&res) {
1374 match err.typ.as_str() {
1375 "AccessDeniedException" => {
1376 return RusotoError::Service(CreateJobError::AccessDenied(err.msg))
1377 }
1378 "InternalServerException" => {
1379 return RusotoError::Service(CreateJobError::InternalServer(err.msg))
1380 }
1381 "ResourceNotFoundException" => {
1382 return RusotoError::Service(CreateJobError::ResourceNotFound(err.msg))
1383 }
1384 "ThrottlingException" => {
1385 return RusotoError::Service(CreateJobError::Throttling(err.msg))
1386 }
1387 "ValidationException" => return RusotoError::Validation(err.msg),
1388 _ => {}
1389 }
1390 }
1391 RusotoError::Unknown(res)
1392 }
1393}
1394impl fmt::Display for CreateJobError {
1395 #[allow(unused_variables)]
1396 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1397 match *self {
1398 CreateJobError::AccessDenied(ref cause) => write!(f, "{}", cause),
1399 CreateJobError::InternalServer(ref cause) => write!(f, "{}", cause),
1400 CreateJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1401 CreateJobError::Throttling(ref cause) => write!(f, "{}", cause),
1402 }
1403 }
1404}
1405impl Error for CreateJobError {}
1406#[derive(Debug, PartialEq)]
1408pub enum CreateRevisionError {
1409 AccessDenied(String),
1411 InternalServer(String),
1413 ResourceNotFound(String),
1415 Throttling(String),
1417}
1418
1419impl CreateRevisionError {
1420 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateRevisionError> {
1421 if let Some(err) = proto::json::Error::parse_rest(&res) {
1422 match err.typ.as_str() {
1423 "AccessDeniedException" => {
1424 return RusotoError::Service(CreateRevisionError::AccessDenied(err.msg))
1425 }
1426 "InternalServerException" => {
1427 return RusotoError::Service(CreateRevisionError::InternalServer(err.msg))
1428 }
1429 "ResourceNotFoundException" => {
1430 return RusotoError::Service(CreateRevisionError::ResourceNotFound(err.msg))
1431 }
1432 "ThrottlingException" => {
1433 return RusotoError::Service(CreateRevisionError::Throttling(err.msg))
1434 }
1435 "ValidationException" => return RusotoError::Validation(err.msg),
1436 _ => {}
1437 }
1438 }
1439 RusotoError::Unknown(res)
1440 }
1441}
1442impl fmt::Display for CreateRevisionError {
1443 #[allow(unused_variables)]
1444 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1445 match *self {
1446 CreateRevisionError::AccessDenied(ref cause) => write!(f, "{}", cause),
1447 CreateRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
1448 CreateRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1449 CreateRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
1450 }
1451 }
1452}
1453impl Error for CreateRevisionError {}
1454#[derive(Debug, PartialEq)]
1456pub enum DeleteAssetError {
1457 AccessDenied(String),
1459 Conflict(String),
1461 InternalServer(String),
1463 ResourceNotFound(String),
1465 Throttling(String),
1467}
1468
1469impl DeleteAssetError {
1470 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAssetError> {
1471 if let Some(err) = proto::json::Error::parse_rest(&res) {
1472 match err.typ.as_str() {
1473 "AccessDeniedException" => {
1474 return RusotoError::Service(DeleteAssetError::AccessDenied(err.msg))
1475 }
1476 "ConflictException" => {
1477 return RusotoError::Service(DeleteAssetError::Conflict(err.msg))
1478 }
1479 "InternalServerException" => {
1480 return RusotoError::Service(DeleteAssetError::InternalServer(err.msg))
1481 }
1482 "ResourceNotFoundException" => {
1483 return RusotoError::Service(DeleteAssetError::ResourceNotFound(err.msg))
1484 }
1485 "ThrottlingException" => {
1486 return RusotoError::Service(DeleteAssetError::Throttling(err.msg))
1487 }
1488 "ValidationException" => return RusotoError::Validation(err.msg),
1489 _ => {}
1490 }
1491 }
1492 RusotoError::Unknown(res)
1493 }
1494}
1495impl fmt::Display for DeleteAssetError {
1496 #[allow(unused_variables)]
1497 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1498 match *self {
1499 DeleteAssetError::AccessDenied(ref cause) => write!(f, "{}", cause),
1500 DeleteAssetError::Conflict(ref cause) => write!(f, "{}", cause),
1501 DeleteAssetError::InternalServer(ref cause) => write!(f, "{}", cause),
1502 DeleteAssetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1503 DeleteAssetError::Throttling(ref cause) => write!(f, "{}", cause),
1504 }
1505 }
1506}
1507impl Error for DeleteAssetError {}
1508#[derive(Debug, PartialEq)]
1510pub enum DeleteDataSetError {
1511 AccessDenied(String),
1513 Conflict(String),
1515 InternalServer(String),
1517 ResourceNotFound(String),
1519 Throttling(String),
1521}
1522
1523impl DeleteDataSetError {
1524 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDataSetError> {
1525 if let Some(err) = proto::json::Error::parse_rest(&res) {
1526 match err.typ.as_str() {
1527 "AccessDeniedException" => {
1528 return RusotoError::Service(DeleteDataSetError::AccessDenied(err.msg))
1529 }
1530 "ConflictException" => {
1531 return RusotoError::Service(DeleteDataSetError::Conflict(err.msg))
1532 }
1533 "InternalServerException" => {
1534 return RusotoError::Service(DeleteDataSetError::InternalServer(err.msg))
1535 }
1536 "ResourceNotFoundException" => {
1537 return RusotoError::Service(DeleteDataSetError::ResourceNotFound(err.msg))
1538 }
1539 "ThrottlingException" => {
1540 return RusotoError::Service(DeleteDataSetError::Throttling(err.msg))
1541 }
1542 "ValidationException" => return RusotoError::Validation(err.msg),
1543 _ => {}
1544 }
1545 }
1546 RusotoError::Unknown(res)
1547 }
1548}
1549impl fmt::Display for DeleteDataSetError {
1550 #[allow(unused_variables)]
1551 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1552 match *self {
1553 DeleteDataSetError::AccessDenied(ref cause) => write!(f, "{}", cause),
1554 DeleteDataSetError::Conflict(ref cause) => write!(f, "{}", cause),
1555 DeleteDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
1556 DeleteDataSetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1557 DeleteDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
1558 }
1559 }
1560}
1561impl Error for DeleteDataSetError {}
1562#[derive(Debug, PartialEq)]
1564pub enum DeleteRevisionError {
1565 AccessDenied(String),
1567 Conflict(String),
1569 InternalServer(String),
1571 ResourceNotFound(String),
1573 Throttling(String),
1575}
1576
1577impl DeleteRevisionError {
1578 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRevisionError> {
1579 if let Some(err) = proto::json::Error::parse_rest(&res) {
1580 match err.typ.as_str() {
1581 "AccessDeniedException" => {
1582 return RusotoError::Service(DeleteRevisionError::AccessDenied(err.msg))
1583 }
1584 "ConflictException" => {
1585 return RusotoError::Service(DeleteRevisionError::Conflict(err.msg))
1586 }
1587 "InternalServerException" => {
1588 return RusotoError::Service(DeleteRevisionError::InternalServer(err.msg))
1589 }
1590 "ResourceNotFoundException" => {
1591 return RusotoError::Service(DeleteRevisionError::ResourceNotFound(err.msg))
1592 }
1593 "ThrottlingException" => {
1594 return RusotoError::Service(DeleteRevisionError::Throttling(err.msg))
1595 }
1596 "ValidationException" => return RusotoError::Validation(err.msg),
1597 _ => {}
1598 }
1599 }
1600 RusotoError::Unknown(res)
1601 }
1602}
1603impl fmt::Display for DeleteRevisionError {
1604 #[allow(unused_variables)]
1605 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1606 match *self {
1607 DeleteRevisionError::AccessDenied(ref cause) => write!(f, "{}", cause),
1608 DeleteRevisionError::Conflict(ref cause) => write!(f, "{}", cause),
1609 DeleteRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
1610 DeleteRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1611 DeleteRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
1612 }
1613 }
1614}
1615impl Error for DeleteRevisionError {}
1616#[derive(Debug, PartialEq)]
1618pub enum GetAssetError {
1619 InternalServer(String),
1621 ResourceNotFound(String),
1623 Throttling(String),
1625}
1626
1627impl GetAssetError {
1628 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAssetError> {
1629 if let Some(err) = proto::json::Error::parse_rest(&res) {
1630 match err.typ.as_str() {
1631 "InternalServerException" => {
1632 return RusotoError::Service(GetAssetError::InternalServer(err.msg))
1633 }
1634 "ResourceNotFoundException" => {
1635 return RusotoError::Service(GetAssetError::ResourceNotFound(err.msg))
1636 }
1637 "ThrottlingException" => {
1638 return RusotoError::Service(GetAssetError::Throttling(err.msg))
1639 }
1640 "ValidationException" => return RusotoError::Validation(err.msg),
1641 _ => {}
1642 }
1643 }
1644 RusotoError::Unknown(res)
1645 }
1646}
1647impl fmt::Display for GetAssetError {
1648 #[allow(unused_variables)]
1649 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1650 match *self {
1651 GetAssetError::InternalServer(ref cause) => write!(f, "{}", cause),
1652 GetAssetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1653 GetAssetError::Throttling(ref cause) => write!(f, "{}", cause),
1654 }
1655 }
1656}
1657impl Error for GetAssetError {}
1658#[derive(Debug, PartialEq)]
1660pub enum GetDataSetError {
1661 InternalServer(String),
1663 ResourceNotFound(String),
1665 Throttling(String),
1667}
1668
1669impl GetDataSetError {
1670 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDataSetError> {
1671 if let Some(err) = proto::json::Error::parse_rest(&res) {
1672 match err.typ.as_str() {
1673 "InternalServerException" => {
1674 return RusotoError::Service(GetDataSetError::InternalServer(err.msg))
1675 }
1676 "ResourceNotFoundException" => {
1677 return RusotoError::Service(GetDataSetError::ResourceNotFound(err.msg))
1678 }
1679 "ThrottlingException" => {
1680 return RusotoError::Service(GetDataSetError::Throttling(err.msg))
1681 }
1682 "ValidationException" => return RusotoError::Validation(err.msg),
1683 _ => {}
1684 }
1685 }
1686 RusotoError::Unknown(res)
1687 }
1688}
1689impl fmt::Display for GetDataSetError {
1690 #[allow(unused_variables)]
1691 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1692 match *self {
1693 GetDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
1694 GetDataSetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1695 GetDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
1696 }
1697 }
1698}
1699impl Error for GetDataSetError {}
1700#[derive(Debug, PartialEq)]
1702pub enum GetJobError {
1703 InternalServer(String),
1705 ResourceNotFound(String),
1707 Throttling(String),
1709}
1710
1711impl GetJobError {
1712 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetJobError> {
1713 if let Some(err) = proto::json::Error::parse_rest(&res) {
1714 match err.typ.as_str() {
1715 "InternalServerException" => {
1716 return RusotoError::Service(GetJobError::InternalServer(err.msg))
1717 }
1718 "ResourceNotFoundException" => {
1719 return RusotoError::Service(GetJobError::ResourceNotFound(err.msg))
1720 }
1721 "ThrottlingException" => {
1722 return RusotoError::Service(GetJobError::Throttling(err.msg))
1723 }
1724 "ValidationException" => return RusotoError::Validation(err.msg),
1725 _ => {}
1726 }
1727 }
1728 RusotoError::Unknown(res)
1729 }
1730}
1731impl fmt::Display for GetJobError {
1732 #[allow(unused_variables)]
1733 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1734 match *self {
1735 GetJobError::InternalServer(ref cause) => write!(f, "{}", cause),
1736 GetJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1737 GetJobError::Throttling(ref cause) => write!(f, "{}", cause),
1738 }
1739 }
1740}
1741impl Error for GetJobError {}
1742#[derive(Debug, PartialEq)]
1744pub enum GetRevisionError {
1745 InternalServer(String),
1747 ResourceNotFound(String),
1749 Throttling(String),
1751}
1752
1753impl GetRevisionError {
1754 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRevisionError> {
1755 if let Some(err) = proto::json::Error::parse_rest(&res) {
1756 match err.typ.as_str() {
1757 "InternalServerException" => {
1758 return RusotoError::Service(GetRevisionError::InternalServer(err.msg))
1759 }
1760 "ResourceNotFoundException" => {
1761 return RusotoError::Service(GetRevisionError::ResourceNotFound(err.msg))
1762 }
1763 "ThrottlingException" => {
1764 return RusotoError::Service(GetRevisionError::Throttling(err.msg))
1765 }
1766 "ValidationException" => return RusotoError::Validation(err.msg),
1767 _ => {}
1768 }
1769 }
1770 RusotoError::Unknown(res)
1771 }
1772}
1773impl fmt::Display for GetRevisionError {
1774 #[allow(unused_variables)]
1775 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1776 match *self {
1777 GetRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
1778 GetRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1779 GetRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
1780 }
1781 }
1782}
1783impl Error for GetRevisionError {}
1784#[derive(Debug, PartialEq)]
1786pub enum ListDataSetRevisionsError {
1787 InternalServer(String),
1789 ResourceNotFound(String),
1791 Throttling(String),
1793}
1794
1795impl ListDataSetRevisionsError {
1796 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDataSetRevisionsError> {
1797 if let Some(err) = proto::json::Error::parse_rest(&res) {
1798 match err.typ.as_str() {
1799 "InternalServerException" => {
1800 return RusotoError::Service(ListDataSetRevisionsError::InternalServer(err.msg))
1801 }
1802 "ResourceNotFoundException" => {
1803 return RusotoError::Service(ListDataSetRevisionsError::ResourceNotFound(
1804 err.msg,
1805 ))
1806 }
1807 "ThrottlingException" => {
1808 return RusotoError::Service(ListDataSetRevisionsError::Throttling(err.msg))
1809 }
1810 "ValidationException" => return RusotoError::Validation(err.msg),
1811 _ => {}
1812 }
1813 }
1814 RusotoError::Unknown(res)
1815 }
1816}
1817impl fmt::Display for ListDataSetRevisionsError {
1818 #[allow(unused_variables)]
1819 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1820 match *self {
1821 ListDataSetRevisionsError::InternalServer(ref cause) => write!(f, "{}", cause),
1822 ListDataSetRevisionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1823 ListDataSetRevisionsError::Throttling(ref cause) => write!(f, "{}", cause),
1824 }
1825 }
1826}
1827impl Error for ListDataSetRevisionsError {}
1828#[derive(Debug, PartialEq)]
1830pub enum ListDataSetsError {
1831 InternalServer(String),
1833 ResourceNotFound(String),
1835 Throttling(String),
1837}
1838
1839impl ListDataSetsError {
1840 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDataSetsError> {
1841 if let Some(err) = proto::json::Error::parse_rest(&res) {
1842 match err.typ.as_str() {
1843 "InternalServerException" => {
1844 return RusotoError::Service(ListDataSetsError::InternalServer(err.msg))
1845 }
1846 "ResourceNotFoundException" => {
1847 return RusotoError::Service(ListDataSetsError::ResourceNotFound(err.msg))
1848 }
1849 "ThrottlingException" => {
1850 return RusotoError::Service(ListDataSetsError::Throttling(err.msg))
1851 }
1852 "ValidationException" => return RusotoError::Validation(err.msg),
1853 _ => {}
1854 }
1855 }
1856 RusotoError::Unknown(res)
1857 }
1858}
1859impl fmt::Display for ListDataSetsError {
1860 #[allow(unused_variables)]
1861 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1862 match *self {
1863 ListDataSetsError::InternalServer(ref cause) => write!(f, "{}", cause),
1864 ListDataSetsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1865 ListDataSetsError::Throttling(ref cause) => write!(f, "{}", cause),
1866 }
1867 }
1868}
1869impl Error for ListDataSetsError {}
1870#[derive(Debug, PartialEq)]
1872pub enum ListJobsError {
1873 InternalServer(String),
1875 ResourceNotFound(String),
1877 Throttling(String),
1879}
1880
1881impl ListJobsError {
1882 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListJobsError> {
1883 if let Some(err) = proto::json::Error::parse_rest(&res) {
1884 match err.typ.as_str() {
1885 "InternalServerException" => {
1886 return RusotoError::Service(ListJobsError::InternalServer(err.msg))
1887 }
1888 "ResourceNotFoundException" => {
1889 return RusotoError::Service(ListJobsError::ResourceNotFound(err.msg))
1890 }
1891 "ThrottlingException" => {
1892 return RusotoError::Service(ListJobsError::Throttling(err.msg))
1893 }
1894 "ValidationException" => return RusotoError::Validation(err.msg),
1895 _ => {}
1896 }
1897 }
1898 RusotoError::Unknown(res)
1899 }
1900}
1901impl fmt::Display for ListJobsError {
1902 #[allow(unused_variables)]
1903 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1904 match *self {
1905 ListJobsError::InternalServer(ref cause) => write!(f, "{}", cause),
1906 ListJobsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1907 ListJobsError::Throttling(ref cause) => write!(f, "{}", cause),
1908 }
1909 }
1910}
1911impl Error for ListJobsError {}
1912#[derive(Debug, PartialEq)]
1914pub enum ListRevisionAssetsError {
1915 InternalServer(String),
1917 ResourceNotFound(String),
1919 Throttling(String),
1921}
1922
1923impl ListRevisionAssetsError {
1924 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListRevisionAssetsError> {
1925 if let Some(err) = proto::json::Error::parse_rest(&res) {
1926 match err.typ.as_str() {
1927 "InternalServerException" => {
1928 return RusotoError::Service(ListRevisionAssetsError::InternalServer(err.msg))
1929 }
1930 "ResourceNotFoundException" => {
1931 return RusotoError::Service(ListRevisionAssetsError::ResourceNotFound(err.msg))
1932 }
1933 "ThrottlingException" => {
1934 return RusotoError::Service(ListRevisionAssetsError::Throttling(err.msg))
1935 }
1936 "ValidationException" => return RusotoError::Validation(err.msg),
1937 _ => {}
1938 }
1939 }
1940 RusotoError::Unknown(res)
1941 }
1942}
1943impl fmt::Display for ListRevisionAssetsError {
1944 #[allow(unused_variables)]
1945 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1946 match *self {
1947 ListRevisionAssetsError::InternalServer(ref cause) => write!(f, "{}", cause),
1948 ListRevisionAssetsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1949 ListRevisionAssetsError::Throttling(ref cause) => write!(f, "{}", cause),
1950 }
1951 }
1952}
1953impl Error for ListRevisionAssetsError {}
1954#[derive(Debug, PartialEq)]
1956pub enum ListTagsForResourceError {}
1957
1958impl ListTagsForResourceError {
1959 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
1960 if let Some(err) = proto::json::Error::parse_rest(&res) {
1961 match err.typ.as_str() {
1962 "ValidationException" => return RusotoError::Validation(err.msg),
1963 _ => {}
1964 }
1965 }
1966 RusotoError::Unknown(res)
1967 }
1968}
1969impl fmt::Display for ListTagsForResourceError {
1970 #[allow(unused_variables)]
1971 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1972 match *self {}
1973 }
1974}
1975impl Error for ListTagsForResourceError {}
1976#[derive(Debug, PartialEq)]
1978pub enum StartJobError {
1979 AccessDenied(String),
1981 Conflict(String),
1983 InternalServer(String),
1985 ResourceNotFound(String),
1987 Throttling(String),
1989}
1990
1991impl StartJobError {
1992 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartJobError> {
1993 if let Some(err) = proto::json::Error::parse_rest(&res) {
1994 match err.typ.as_str() {
1995 "AccessDeniedException" => {
1996 return RusotoError::Service(StartJobError::AccessDenied(err.msg))
1997 }
1998 "ConflictException" => {
1999 return RusotoError::Service(StartJobError::Conflict(err.msg))
2000 }
2001 "InternalServerException" => {
2002 return RusotoError::Service(StartJobError::InternalServer(err.msg))
2003 }
2004 "ResourceNotFoundException" => {
2005 return RusotoError::Service(StartJobError::ResourceNotFound(err.msg))
2006 }
2007 "ThrottlingException" => {
2008 return RusotoError::Service(StartJobError::Throttling(err.msg))
2009 }
2010 "ValidationException" => return RusotoError::Validation(err.msg),
2011 _ => {}
2012 }
2013 }
2014 RusotoError::Unknown(res)
2015 }
2016}
2017impl fmt::Display for StartJobError {
2018 #[allow(unused_variables)]
2019 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2020 match *self {
2021 StartJobError::AccessDenied(ref cause) => write!(f, "{}", cause),
2022 StartJobError::Conflict(ref cause) => write!(f, "{}", cause),
2023 StartJobError::InternalServer(ref cause) => write!(f, "{}", cause),
2024 StartJobError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2025 StartJobError::Throttling(ref cause) => write!(f, "{}", cause),
2026 }
2027 }
2028}
2029impl Error for StartJobError {}
2030#[derive(Debug, PartialEq)]
2032pub enum TagResourceError {}
2033
2034impl TagResourceError {
2035 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
2036 if let Some(err) = proto::json::Error::parse_rest(&res) {
2037 match err.typ.as_str() {
2038 "ValidationException" => return RusotoError::Validation(err.msg),
2039 _ => {}
2040 }
2041 }
2042 RusotoError::Unknown(res)
2043 }
2044}
2045impl fmt::Display for TagResourceError {
2046 #[allow(unused_variables)]
2047 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2048 match *self {}
2049 }
2050}
2051impl Error for TagResourceError {}
2052#[derive(Debug, PartialEq)]
2054pub enum UntagResourceError {}
2055
2056impl UntagResourceError {
2057 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
2058 if let Some(err) = proto::json::Error::parse_rest(&res) {
2059 match err.typ.as_str() {
2060 "ValidationException" => return RusotoError::Validation(err.msg),
2061 _ => {}
2062 }
2063 }
2064 RusotoError::Unknown(res)
2065 }
2066}
2067impl fmt::Display for UntagResourceError {
2068 #[allow(unused_variables)]
2069 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2070 match *self {}
2071 }
2072}
2073impl Error for UntagResourceError {}
2074#[derive(Debug, PartialEq)]
2076pub enum UpdateAssetError {
2077 AccessDenied(String),
2079 Conflict(String),
2081 InternalServer(String),
2083 ResourceNotFound(String),
2085 Throttling(String),
2087}
2088
2089impl UpdateAssetError {
2090 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAssetError> {
2091 if let Some(err) = proto::json::Error::parse_rest(&res) {
2092 match err.typ.as_str() {
2093 "AccessDeniedException" => {
2094 return RusotoError::Service(UpdateAssetError::AccessDenied(err.msg))
2095 }
2096 "ConflictException" => {
2097 return RusotoError::Service(UpdateAssetError::Conflict(err.msg))
2098 }
2099 "InternalServerException" => {
2100 return RusotoError::Service(UpdateAssetError::InternalServer(err.msg))
2101 }
2102 "ResourceNotFoundException" => {
2103 return RusotoError::Service(UpdateAssetError::ResourceNotFound(err.msg))
2104 }
2105 "ThrottlingException" => {
2106 return RusotoError::Service(UpdateAssetError::Throttling(err.msg))
2107 }
2108 "ValidationException" => return RusotoError::Validation(err.msg),
2109 _ => {}
2110 }
2111 }
2112 RusotoError::Unknown(res)
2113 }
2114}
2115impl fmt::Display for UpdateAssetError {
2116 #[allow(unused_variables)]
2117 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2118 match *self {
2119 UpdateAssetError::AccessDenied(ref cause) => write!(f, "{}", cause),
2120 UpdateAssetError::Conflict(ref cause) => write!(f, "{}", cause),
2121 UpdateAssetError::InternalServer(ref cause) => write!(f, "{}", cause),
2122 UpdateAssetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2123 UpdateAssetError::Throttling(ref cause) => write!(f, "{}", cause),
2124 }
2125 }
2126}
2127impl Error for UpdateAssetError {}
2128#[derive(Debug, PartialEq)]
2130pub enum UpdateDataSetError {
2131 AccessDenied(String),
2133 InternalServer(String),
2135 ResourceNotFound(String),
2137 Throttling(String),
2139}
2140
2141impl UpdateDataSetError {
2142 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDataSetError> {
2143 if let Some(err) = proto::json::Error::parse_rest(&res) {
2144 match err.typ.as_str() {
2145 "AccessDeniedException" => {
2146 return RusotoError::Service(UpdateDataSetError::AccessDenied(err.msg))
2147 }
2148 "InternalServerException" => {
2149 return RusotoError::Service(UpdateDataSetError::InternalServer(err.msg))
2150 }
2151 "ResourceNotFoundException" => {
2152 return RusotoError::Service(UpdateDataSetError::ResourceNotFound(err.msg))
2153 }
2154 "ThrottlingException" => {
2155 return RusotoError::Service(UpdateDataSetError::Throttling(err.msg))
2156 }
2157 "ValidationException" => return RusotoError::Validation(err.msg),
2158 _ => {}
2159 }
2160 }
2161 RusotoError::Unknown(res)
2162 }
2163}
2164impl fmt::Display for UpdateDataSetError {
2165 #[allow(unused_variables)]
2166 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2167 match *self {
2168 UpdateDataSetError::AccessDenied(ref cause) => write!(f, "{}", cause),
2169 UpdateDataSetError::InternalServer(ref cause) => write!(f, "{}", cause),
2170 UpdateDataSetError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2171 UpdateDataSetError::Throttling(ref cause) => write!(f, "{}", cause),
2172 }
2173 }
2174}
2175impl Error for UpdateDataSetError {}
2176#[derive(Debug, PartialEq)]
2178pub enum UpdateRevisionError {
2179 AccessDenied(String),
2181 Conflict(String),
2183 InternalServer(String),
2185 ResourceNotFound(String),
2187 Throttling(String),
2189}
2190
2191impl UpdateRevisionError {
2192 pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateRevisionError> {
2193 if let Some(err) = proto::json::Error::parse_rest(&res) {
2194 match err.typ.as_str() {
2195 "AccessDeniedException" => {
2196 return RusotoError::Service(UpdateRevisionError::AccessDenied(err.msg))
2197 }
2198 "ConflictException" => {
2199 return RusotoError::Service(UpdateRevisionError::Conflict(err.msg))
2200 }
2201 "InternalServerException" => {
2202 return RusotoError::Service(UpdateRevisionError::InternalServer(err.msg))
2203 }
2204 "ResourceNotFoundException" => {
2205 return RusotoError::Service(UpdateRevisionError::ResourceNotFound(err.msg))
2206 }
2207 "ThrottlingException" => {
2208 return RusotoError::Service(UpdateRevisionError::Throttling(err.msg))
2209 }
2210 "ValidationException" => return RusotoError::Validation(err.msg),
2211 _ => {}
2212 }
2213 }
2214 RusotoError::Unknown(res)
2215 }
2216}
2217impl fmt::Display for UpdateRevisionError {
2218 #[allow(unused_variables)]
2219 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2220 match *self {
2221 UpdateRevisionError::AccessDenied(ref cause) => write!(f, "{}", cause),
2222 UpdateRevisionError::Conflict(ref cause) => write!(f, "{}", cause),
2223 UpdateRevisionError::InternalServer(ref cause) => write!(f, "{}", cause),
2224 UpdateRevisionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2225 UpdateRevisionError::Throttling(ref cause) => write!(f, "{}", cause),
2226 }
2227 }
2228}
2229impl Error for UpdateRevisionError {}
2230#[async_trait]
2232pub trait DataExchange {
2233 async fn cancel_job(&self, input: CancelJobRequest) -> Result<(), RusotoError<CancelJobError>>;
2235
2236 async fn create_data_set(
2238 &self,
2239 input: CreateDataSetRequest,
2240 ) -> Result<CreateDataSetResponse, RusotoError<CreateDataSetError>>;
2241
2242 async fn create_job(
2244 &self,
2245 input: CreateJobRequest,
2246 ) -> Result<CreateJobResponse, RusotoError<CreateJobError>>;
2247
2248 async fn create_revision(
2250 &self,
2251 input: CreateRevisionRequest,
2252 ) -> Result<CreateRevisionResponse, RusotoError<CreateRevisionError>>;
2253
2254 async fn delete_asset(
2256 &self,
2257 input: DeleteAssetRequest,
2258 ) -> Result<(), RusotoError<DeleteAssetError>>;
2259
2260 async fn delete_data_set(
2262 &self,
2263 input: DeleteDataSetRequest,
2264 ) -> Result<(), RusotoError<DeleteDataSetError>>;
2265
2266 async fn delete_revision(
2268 &self,
2269 input: DeleteRevisionRequest,
2270 ) -> Result<(), RusotoError<DeleteRevisionError>>;
2271
2272 async fn get_asset(
2274 &self,
2275 input: GetAssetRequest,
2276 ) -> Result<GetAssetResponse, RusotoError<GetAssetError>>;
2277
2278 async fn get_data_set(
2280 &self,
2281 input: GetDataSetRequest,
2282 ) -> Result<GetDataSetResponse, RusotoError<GetDataSetError>>;
2283
2284 async fn get_job(
2286 &self,
2287 input: GetJobRequest,
2288 ) -> Result<GetJobResponse, RusotoError<GetJobError>>;
2289
2290 async fn get_revision(
2292 &self,
2293 input: GetRevisionRequest,
2294 ) -> Result<GetRevisionResponse, RusotoError<GetRevisionError>>;
2295
2296 async fn list_data_set_revisions(
2298 &self,
2299 input: ListDataSetRevisionsRequest,
2300 ) -> Result<ListDataSetRevisionsResponse, RusotoError<ListDataSetRevisionsError>>;
2301
2302 async fn list_data_sets(
2304 &self,
2305 input: ListDataSetsRequest,
2306 ) -> Result<ListDataSetsResponse, RusotoError<ListDataSetsError>>;
2307
2308 async fn list_jobs(
2310 &self,
2311 input: ListJobsRequest,
2312 ) -> Result<ListJobsResponse, RusotoError<ListJobsError>>;
2313
2314 async fn list_revision_assets(
2316 &self,
2317 input: ListRevisionAssetsRequest,
2318 ) -> Result<ListRevisionAssetsResponse, RusotoError<ListRevisionAssetsError>>;
2319
2320 async fn list_tags_for_resource(
2322 &self,
2323 input: ListTagsForResourceRequest,
2324 ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
2325
2326 async fn start_job(
2328 &self,
2329 input: StartJobRequest,
2330 ) -> Result<StartJobResponse, RusotoError<StartJobError>>;
2331
2332 async fn tag_resource(
2334 &self,
2335 input: TagResourceRequest,
2336 ) -> Result<(), RusotoError<TagResourceError>>;
2337
2338 async fn untag_resource(
2340 &self,
2341 input: UntagResourceRequest,
2342 ) -> Result<(), RusotoError<UntagResourceError>>;
2343
2344 async fn update_asset(
2346 &self,
2347 input: UpdateAssetRequest,
2348 ) -> Result<UpdateAssetResponse, RusotoError<UpdateAssetError>>;
2349
2350 async fn update_data_set(
2352 &self,
2353 input: UpdateDataSetRequest,
2354 ) -> Result<UpdateDataSetResponse, RusotoError<UpdateDataSetError>>;
2355
2356 async fn update_revision(
2358 &self,
2359 input: UpdateRevisionRequest,
2360 ) -> Result<UpdateRevisionResponse, RusotoError<UpdateRevisionError>>;
2361}
2362#[derive(Clone)]
2364pub struct DataExchangeClient {
2365 client: Client,
2366 region: region::Region,
2367}
2368
2369impl DataExchangeClient {
2370 pub fn new(region: region::Region) -> DataExchangeClient {
2374 DataExchangeClient {
2375 client: Client::shared(),
2376 region,
2377 }
2378 }
2379
2380 pub fn new_with<P, D>(
2381 request_dispatcher: D,
2382 credentials_provider: P,
2383 region: region::Region,
2384 ) -> DataExchangeClient
2385 where
2386 P: ProvideAwsCredentials + Send + Sync + 'static,
2387 D: DispatchSignedRequest + Send + Sync + 'static,
2388 {
2389 DataExchangeClient {
2390 client: Client::new_with(credentials_provider, request_dispatcher),
2391 region,
2392 }
2393 }
2394
2395 pub fn new_with_client(client: Client, region: region::Region) -> DataExchangeClient {
2396 DataExchangeClient { client, region }
2397 }
2398}
2399
2400#[async_trait]
2401impl DataExchange for DataExchangeClient {
2402 #[allow(unused_mut)]
2404 async fn cancel_job(&self, input: CancelJobRequest) -> Result<(), RusotoError<CancelJobError>> {
2405 let request_uri = format!("/v1/jobs/{job_id}", job_id = input.job_id);
2406
2407 let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
2408 request.set_content_type("application/x-amz-json-1.1".to_owned());
2409
2410 let mut response = self
2411 .client
2412 .sign_and_dispatch(request)
2413 .await
2414 .map_err(RusotoError::from)?;
2415 if response.status.as_u16() == 204 {
2416 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2417 let result = ::std::mem::drop(response);
2418
2419 Ok(result)
2420 } else {
2421 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2422 Err(CancelJobError::from_response(response))
2423 }
2424 }
2425
2426 #[allow(unused_mut)]
2428 async fn create_data_set(
2429 &self,
2430 input: CreateDataSetRequest,
2431 ) -> Result<CreateDataSetResponse, RusotoError<CreateDataSetError>> {
2432 let request_uri = "/v1/data-sets";
2433
2434 let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
2435 request.set_content_type("application/x-amz-json-1.1".to_owned());
2436
2437 let encoded = Some(serde_json::to_vec(&input).unwrap());
2438 request.set_payload(encoded);
2439
2440 let mut response = self
2441 .client
2442 .sign_and_dispatch(request)
2443 .await
2444 .map_err(RusotoError::from)?;
2445 if response.status.as_u16() == 201 {
2446 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2447 let result = proto::json::ResponsePayload::new(&response)
2448 .deserialize::<CreateDataSetResponse, _>()?;
2449
2450 Ok(result)
2451 } else {
2452 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2453 Err(CreateDataSetError::from_response(response))
2454 }
2455 }
2456
2457 #[allow(unused_mut)]
2459 async fn create_job(
2460 &self,
2461 input: CreateJobRequest,
2462 ) -> Result<CreateJobResponse, RusotoError<CreateJobError>> {
2463 let request_uri = "/v1/jobs";
2464
2465 let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
2466 request.set_content_type("application/x-amz-json-1.1".to_owned());
2467
2468 let encoded = Some(serde_json::to_vec(&input).unwrap());
2469 request.set_payload(encoded);
2470
2471 let mut response = self
2472 .client
2473 .sign_and_dispatch(request)
2474 .await
2475 .map_err(RusotoError::from)?;
2476 if response.status.as_u16() == 201 {
2477 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2478 let result = proto::json::ResponsePayload::new(&response)
2479 .deserialize::<CreateJobResponse, _>()?;
2480
2481 Ok(result)
2482 } else {
2483 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2484 Err(CreateJobError::from_response(response))
2485 }
2486 }
2487
2488 #[allow(unused_mut)]
2490 async fn create_revision(
2491 &self,
2492 input: CreateRevisionRequest,
2493 ) -> Result<CreateRevisionResponse, RusotoError<CreateRevisionError>> {
2494 let request_uri = format!(
2495 "/v1/data-sets/{data_set_id}/revisions",
2496 data_set_id = input.data_set_id
2497 );
2498
2499 let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
2500 request.set_content_type("application/x-amz-json-1.1".to_owned());
2501
2502 let encoded = Some(serde_json::to_vec(&input).unwrap());
2503 request.set_payload(encoded);
2504
2505 let mut response = self
2506 .client
2507 .sign_and_dispatch(request)
2508 .await
2509 .map_err(RusotoError::from)?;
2510 if response.status.as_u16() == 201 {
2511 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2512 let result = proto::json::ResponsePayload::new(&response)
2513 .deserialize::<CreateRevisionResponse, _>()?;
2514
2515 Ok(result)
2516 } else {
2517 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2518 Err(CreateRevisionError::from_response(response))
2519 }
2520 }
2521
2522 #[allow(unused_mut)]
2524 async fn delete_asset(
2525 &self,
2526 input: DeleteAssetRequest,
2527 ) -> Result<(), RusotoError<DeleteAssetError>> {
2528 let request_uri = format!(
2529 "/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets/{asset_id}",
2530 asset_id = input.asset_id,
2531 data_set_id = input.data_set_id,
2532 revision_id = input.revision_id
2533 );
2534
2535 let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
2536 request.set_content_type("application/x-amz-json-1.1".to_owned());
2537
2538 let mut response = self
2539 .client
2540 .sign_and_dispatch(request)
2541 .await
2542 .map_err(RusotoError::from)?;
2543 if response.status.as_u16() == 204 {
2544 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2545 let result = ::std::mem::drop(response);
2546
2547 Ok(result)
2548 } else {
2549 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2550 Err(DeleteAssetError::from_response(response))
2551 }
2552 }
2553
2554 #[allow(unused_mut)]
2556 async fn delete_data_set(
2557 &self,
2558 input: DeleteDataSetRequest,
2559 ) -> Result<(), RusotoError<DeleteDataSetError>> {
2560 let request_uri = format!(
2561 "/v1/data-sets/{data_set_id}",
2562 data_set_id = input.data_set_id
2563 );
2564
2565 let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
2566 request.set_content_type("application/x-amz-json-1.1".to_owned());
2567
2568 let mut response = self
2569 .client
2570 .sign_and_dispatch(request)
2571 .await
2572 .map_err(RusotoError::from)?;
2573 if response.status.as_u16() == 204 {
2574 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2575 let result = ::std::mem::drop(response);
2576
2577 Ok(result)
2578 } else {
2579 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2580 Err(DeleteDataSetError::from_response(response))
2581 }
2582 }
2583
2584 #[allow(unused_mut)]
2586 async fn delete_revision(
2587 &self,
2588 input: DeleteRevisionRequest,
2589 ) -> Result<(), RusotoError<DeleteRevisionError>> {
2590 let request_uri = format!(
2591 "/v1/data-sets/{data_set_id}/revisions/{revision_id}",
2592 data_set_id = input.data_set_id,
2593 revision_id = input.revision_id
2594 );
2595
2596 let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
2597 request.set_content_type("application/x-amz-json-1.1".to_owned());
2598
2599 let mut response = self
2600 .client
2601 .sign_and_dispatch(request)
2602 .await
2603 .map_err(RusotoError::from)?;
2604 if response.status.as_u16() == 204 {
2605 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2606 let result = ::std::mem::drop(response);
2607
2608 Ok(result)
2609 } else {
2610 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2611 Err(DeleteRevisionError::from_response(response))
2612 }
2613 }
2614
2615 #[allow(unused_mut)]
2617 async fn get_asset(
2618 &self,
2619 input: GetAssetRequest,
2620 ) -> Result<GetAssetResponse, RusotoError<GetAssetError>> {
2621 let request_uri = format!(
2622 "/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets/{asset_id}",
2623 asset_id = input.asset_id,
2624 data_set_id = input.data_set_id,
2625 revision_id = input.revision_id
2626 );
2627
2628 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2629 request.set_content_type("application/x-amz-json-1.1".to_owned());
2630
2631 let mut response = self
2632 .client
2633 .sign_and_dispatch(request)
2634 .await
2635 .map_err(RusotoError::from)?;
2636 if response.status.as_u16() == 200 {
2637 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2638 let result = proto::json::ResponsePayload::new(&response)
2639 .deserialize::<GetAssetResponse, _>()?;
2640
2641 Ok(result)
2642 } else {
2643 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2644 Err(GetAssetError::from_response(response))
2645 }
2646 }
2647
2648 #[allow(unused_mut)]
2650 async fn get_data_set(
2651 &self,
2652 input: GetDataSetRequest,
2653 ) -> Result<GetDataSetResponse, RusotoError<GetDataSetError>> {
2654 let request_uri = format!(
2655 "/v1/data-sets/{data_set_id}",
2656 data_set_id = input.data_set_id
2657 );
2658
2659 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2660 request.set_content_type("application/x-amz-json-1.1".to_owned());
2661
2662 let mut response = self
2663 .client
2664 .sign_and_dispatch(request)
2665 .await
2666 .map_err(RusotoError::from)?;
2667 if response.status.as_u16() == 200 {
2668 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2669 let result = proto::json::ResponsePayload::new(&response)
2670 .deserialize::<GetDataSetResponse, _>()?;
2671
2672 Ok(result)
2673 } else {
2674 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2675 Err(GetDataSetError::from_response(response))
2676 }
2677 }
2678
2679 #[allow(unused_mut)]
2681 async fn get_job(
2682 &self,
2683 input: GetJobRequest,
2684 ) -> Result<GetJobResponse, RusotoError<GetJobError>> {
2685 let request_uri = format!("/v1/jobs/{job_id}", job_id = input.job_id);
2686
2687 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2688 request.set_content_type("application/x-amz-json-1.1".to_owned());
2689
2690 let mut response = self
2691 .client
2692 .sign_and_dispatch(request)
2693 .await
2694 .map_err(RusotoError::from)?;
2695 if response.status.as_u16() == 200 {
2696 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2697 let result =
2698 proto::json::ResponsePayload::new(&response).deserialize::<GetJobResponse, _>()?;
2699
2700 Ok(result)
2701 } else {
2702 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2703 Err(GetJobError::from_response(response))
2704 }
2705 }
2706
2707 #[allow(unused_mut)]
2709 async fn get_revision(
2710 &self,
2711 input: GetRevisionRequest,
2712 ) -> Result<GetRevisionResponse, RusotoError<GetRevisionError>> {
2713 let request_uri = format!(
2714 "/v1/data-sets/{data_set_id}/revisions/{revision_id}",
2715 data_set_id = input.data_set_id,
2716 revision_id = input.revision_id
2717 );
2718
2719 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2720 request.set_content_type("application/x-amz-json-1.1".to_owned());
2721
2722 let mut response = self
2723 .client
2724 .sign_and_dispatch(request)
2725 .await
2726 .map_err(RusotoError::from)?;
2727 if response.status.as_u16() == 200 {
2728 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2729 let result = proto::json::ResponsePayload::new(&response)
2730 .deserialize::<GetRevisionResponse, _>()?;
2731
2732 Ok(result)
2733 } else {
2734 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2735 Err(GetRevisionError::from_response(response))
2736 }
2737 }
2738
2739 #[allow(unused_mut)]
2741 async fn list_data_set_revisions(
2742 &self,
2743 input: ListDataSetRevisionsRequest,
2744 ) -> Result<ListDataSetRevisionsResponse, RusotoError<ListDataSetRevisionsError>> {
2745 let request_uri = format!(
2746 "/v1/data-sets/{data_set_id}/revisions",
2747 data_set_id = input.data_set_id
2748 );
2749
2750 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2751 request.set_content_type("application/x-amz-json-1.1".to_owned());
2752
2753 let mut params = Params::new();
2754 if let Some(ref x) = input.max_results {
2755 params.put("maxResults", x);
2756 }
2757 if let Some(ref x) = input.next_token {
2758 params.put("nextToken", x);
2759 }
2760 request.set_params(params);
2761
2762 let mut response = self
2763 .client
2764 .sign_and_dispatch(request)
2765 .await
2766 .map_err(RusotoError::from)?;
2767 if response.status.as_u16() == 200 {
2768 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2769 let result = proto::json::ResponsePayload::new(&response)
2770 .deserialize::<ListDataSetRevisionsResponse, _>()?;
2771
2772 Ok(result)
2773 } else {
2774 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2775 Err(ListDataSetRevisionsError::from_response(response))
2776 }
2777 }
2778
2779 #[allow(unused_mut)]
2781 async fn list_data_sets(
2782 &self,
2783 input: ListDataSetsRequest,
2784 ) -> Result<ListDataSetsResponse, RusotoError<ListDataSetsError>> {
2785 let request_uri = "/v1/data-sets";
2786
2787 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2788 request.set_content_type("application/x-amz-json-1.1".to_owned());
2789
2790 let mut params = Params::new();
2791 if let Some(ref x) = input.max_results {
2792 params.put("maxResults", x);
2793 }
2794 if let Some(ref x) = input.next_token {
2795 params.put("nextToken", x);
2796 }
2797 if let Some(ref x) = input.origin {
2798 params.put("origin", x);
2799 }
2800 request.set_params(params);
2801
2802 let mut response = self
2803 .client
2804 .sign_and_dispatch(request)
2805 .await
2806 .map_err(RusotoError::from)?;
2807 if response.status.as_u16() == 200 {
2808 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2809 let result = proto::json::ResponsePayload::new(&response)
2810 .deserialize::<ListDataSetsResponse, _>()?;
2811
2812 Ok(result)
2813 } else {
2814 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2815 Err(ListDataSetsError::from_response(response))
2816 }
2817 }
2818
2819 #[allow(unused_mut)]
2821 async fn list_jobs(
2822 &self,
2823 input: ListJobsRequest,
2824 ) -> Result<ListJobsResponse, RusotoError<ListJobsError>> {
2825 let request_uri = "/v1/jobs";
2826
2827 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2828 request.set_content_type("application/x-amz-json-1.1".to_owned());
2829
2830 let mut params = Params::new();
2831 if let Some(ref x) = input.data_set_id {
2832 params.put("dataSetId", x);
2833 }
2834 if let Some(ref x) = input.max_results {
2835 params.put("maxResults", x);
2836 }
2837 if let Some(ref x) = input.next_token {
2838 params.put("nextToken", x);
2839 }
2840 if let Some(ref x) = input.revision_id {
2841 params.put("revisionId", x);
2842 }
2843 request.set_params(params);
2844
2845 let mut response = self
2846 .client
2847 .sign_and_dispatch(request)
2848 .await
2849 .map_err(RusotoError::from)?;
2850 if response.status.as_u16() == 200 {
2851 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2852 let result = proto::json::ResponsePayload::new(&response)
2853 .deserialize::<ListJobsResponse, _>()?;
2854
2855 Ok(result)
2856 } else {
2857 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2858 Err(ListJobsError::from_response(response))
2859 }
2860 }
2861
2862 #[allow(unused_mut)]
2864 async fn list_revision_assets(
2865 &self,
2866 input: ListRevisionAssetsRequest,
2867 ) -> Result<ListRevisionAssetsResponse, RusotoError<ListRevisionAssetsError>> {
2868 let request_uri = format!(
2869 "/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets",
2870 data_set_id = input.data_set_id,
2871 revision_id = input.revision_id
2872 );
2873
2874 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2875 request.set_content_type("application/x-amz-json-1.1".to_owned());
2876
2877 let mut params = Params::new();
2878 if let Some(ref x) = input.max_results {
2879 params.put("maxResults", x);
2880 }
2881 if let Some(ref x) = input.next_token {
2882 params.put("nextToken", x);
2883 }
2884 request.set_params(params);
2885
2886 let mut response = self
2887 .client
2888 .sign_and_dispatch(request)
2889 .await
2890 .map_err(RusotoError::from)?;
2891 if response.status.as_u16() == 200 {
2892 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2893 let result = proto::json::ResponsePayload::new(&response)
2894 .deserialize::<ListRevisionAssetsResponse, _>()?;
2895
2896 Ok(result)
2897 } else {
2898 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2899 Err(ListRevisionAssetsError::from_response(response))
2900 }
2901 }
2902
2903 #[allow(unused_mut)]
2905 async fn list_tags_for_resource(
2906 &self,
2907 input: ListTagsForResourceRequest,
2908 ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
2909 let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
2910
2911 let mut request = SignedRequest::new("GET", "dataexchange", &self.region, &request_uri);
2912 request.set_content_type("application/x-amz-json-1.1".to_owned());
2913
2914 let mut response = self
2915 .client
2916 .sign_and_dispatch(request)
2917 .await
2918 .map_err(RusotoError::from)?;
2919 if response.status.as_u16() == 200 {
2920 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2921 let result = proto::json::ResponsePayload::new(&response)
2922 .deserialize::<ListTagsForResourceResponse, _>()?;
2923
2924 Ok(result)
2925 } else {
2926 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2927 Err(ListTagsForResourceError::from_response(response))
2928 }
2929 }
2930
2931 #[allow(unused_mut)]
2933 async fn start_job(
2934 &self,
2935 input: StartJobRequest,
2936 ) -> Result<StartJobResponse, RusotoError<StartJobError>> {
2937 let request_uri = format!("/v1/jobs/{job_id}", job_id = input.job_id);
2938
2939 let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
2940 request.set_content_type("application/x-amz-json-1.1".to_owned());
2941
2942 let mut response = self
2943 .client
2944 .sign_and_dispatch(request)
2945 .await
2946 .map_err(RusotoError::from)?;
2947 if response.status.as_u16() == 202 {
2948 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2949 let result = proto::json::ResponsePayload::new(&response)
2950 .deserialize::<StartJobResponse, _>()?;
2951
2952 Ok(result)
2953 } else {
2954 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2955 Err(StartJobError::from_response(response))
2956 }
2957 }
2958
2959 #[allow(unused_mut)]
2961 async fn tag_resource(
2962 &self,
2963 input: TagResourceRequest,
2964 ) -> Result<(), RusotoError<TagResourceError>> {
2965 let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
2966
2967 let mut request = SignedRequest::new("POST", "dataexchange", &self.region, &request_uri);
2968 request.set_content_type("application/x-amz-json-1.1".to_owned());
2969
2970 let encoded = Some(serde_json::to_vec(&input).unwrap());
2971 request.set_payload(encoded);
2972
2973 let mut response = self
2974 .client
2975 .sign_and_dispatch(request)
2976 .await
2977 .map_err(RusotoError::from)?;
2978 if response.status.as_u16() == 204 {
2979 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2980 let result = ::std::mem::drop(response);
2981
2982 Ok(result)
2983 } else {
2984 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2985 Err(TagResourceError::from_response(response))
2986 }
2987 }
2988
2989 #[allow(unused_mut)]
2991 async fn untag_resource(
2992 &self,
2993 input: UntagResourceRequest,
2994 ) -> Result<(), RusotoError<UntagResourceError>> {
2995 let request_uri = format!("/tags/{resource_arn}", resource_arn = input.resource_arn);
2996
2997 let mut request = SignedRequest::new("DELETE", "dataexchange", &self.region, &request_uri);
2998 request.set_content_type("application/x-amz-json-1.1".to_owned());
2999
3000 let mut params = Params::new();
3001 for item in input.tag_keys.iter() {
3002 params.put("tagKeys", item);
3003 }
3004 request.set_params(params);
3005
3006 let mut response = self
3007 .client
3008 .sign_and_dispatch(request)
3009 .await
3010 .map_err(RusotoError::from)?;
3011 if response.status.as_u16() == 204 {
3012 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3013 let result = ::std::mem::drop(response);
3014
3015 Ok(result)
3016 } else {
3017 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3018 Err(UntagResourceError::from_response(response))
3019 }
3020 }
3021
3022 #[allow(unused_mut)]
3024 async fn update_asset(
3025 &self,
3026 input: UpdateAssetRequest,
3027 ) -> Result<UpdateAssetResponse, RusotoError<UpdateAssetError>> {
3028 let request_uri = format!(
3029 "/v1/data-sets/{data_set_id}/revisions/{revision_id}/assets/{asset_id}",
3030 asset_id = input.asset_id,
3031 data_set_id = input.data_set_id,
3032 revision_id = input.revision_id
3033 );
3034
3035 let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
3036 request.set_content_type("application/x-amz-json-1.1".to_owned());
3037
3038 let encoded = Some(serde_json::to_vec(&input).unwrap());
3039 request.set_payload(encoded);
3040
3041 let mut response = self
3042 .client
3043 .sign_and_dispatch(request)
3044 .await
3045 .map_err(RusotoError::from)?;
3046 if response.status.as_u16() == 200 {
3047 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3048 let result = proto::json::ResponsePayload::new(&response)
3049 .deserialize::<UpdateAssetResponse, _>()?;
3050
3051 Ok(result)
3052 } else {
3053 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3054 Err(UpdateAssetError::from_response(response))
3055 }
3056 }
3057
3058 #[allow(unused_mut)]
3060 async fn update_data_set(
3061 &self,
3062 input: UpdateDataSetRequest,
3063 ) -> Result<UpdateDataSetResponse, RusotoError<UpdateDataSetError>> {
3064 let request_uri = format!(
3065 "/v1/data-sets/{data_set_id}",
3066 data_set_id = input.data_set_id
3067 );
3068
3069 let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
3070 request.set_content_type("application/x-amz-json-1.1".to_owned());
3071
3072 let encoded = Some(serde_json::to_vec(&input).unwrap());
3073 request.set_payload(encoded);
3074
3075 let mut response = self
3076 .client
3077 .sign_and_dispatch(request)
3078 .await
3079 .map_err(RusotoError::from)?;
3080 if response.status.as_u16() == 200 {
3081 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3082 let result = proto::json::ResponsePayload::new(&response)
3083 .deserialize::<UpdateDataSetResponse, _>()?;
3084
3085 Ok(result)
3086 } else {
3087 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3088 Err(UpdateDataSetError::from_response(response))
3089 }
3090 }
3091
3092 #[allow(unused_mut)]
3094 async fn update_revision(
3095 &self,
3096 input: UpdateRevisionRequest,
3097 ) -> Result<UpdateRevisionResponse, RusotoError<UpdateRevisionError>> {
3098 let request_uri = format!(
3099 "/v1/data-sets/{data_set_id}/revisions/{revision_id}",
3100 data_set_id = input.data_set_id,
3101 revision_id = input.revision_id
3102 );
3103
3104 let mut request = SignedRequest::new("PATCH", "dataexchange", &self.region, &request_uri);
3105 request.set_content_type("application/x-amz-json-1.1".to_owned());
3106
3107 let encoded = Some(serde_json::to_vec(&input).unwrap());
3108 request.set_payload(encoded);
3109
3110 let mut response = self
3111 .client
3112 .sign_and_dispatch(request)
3113 .await
3114 .map_err(RusotoError::from)?;
3115 if response.status.as_u16() == 200 {
3116 let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3117 let result = proto::json::ResponsePayload::new(&response)
3118 .deserialize::<UpdateRevisionResponse, _>()?;
3119
3120 Ok(result)
3121 } else {
3122 let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3123 Err(UpdateRevisionError::from_response(response))
3124 }
3125 }
3126}