1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle {
pub(crate) client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
pub(crate) conf: crate::Config,
}
/// Client for AWS Backup Storage
///
/// Client for invoking operations on AWS Backup Storage. Each operation on AWS Backup Storage is a method on this
/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
///
/// # Examples
/// **Constructing a client and invoking an operation**
/// ```rust,no_run
/// # async fn docs() {
/// // create a shared configuration. This can be used & shared between multiple service clients.
/// let shared_config = aws_config::load_from_env().await;
/// let client = aws_sdk_backupstorage::Client::new(&shared_config);
/// // invoke an operation
/// /* let rsp = client
/// .<operation_name>().
/// .<param>("some value")
/// .send().await; */
/// # }
/// ```
/// **Constructing a client with custom configuration**
/// ```rust,no_run
/// use aws_config::retry::RetryConfig;
/// # async fn docs() {
/// let shared_config = aws_config::load_from_env().await;
/// let config = aws_sdk_backupstorage::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_backupstorage::Client::from_conf(config);
/// # }
#[derive(std::fmt::Debug)]
pub struct Client {
handle: std::sync::Arc<Handle>,
}
impl std::clone::Clone for Client {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl
From<
aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
> for Client
{
fn from(
client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl Client {
/// Creates a client with the given service configuration.
pub fn with_config(
client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
conf: crate::Config,
) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Returns the client's configuration.
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl Client {
/// Constructs a fluent builder for the [`DeleteObject`](crate::client::fluent_builders::DeleteObject) operation.
///
/// - The fluent builder is configurable:
/// - [`backup_job_id(impl Into<String>)`](crate::client::fluent_builders::DeleteObject::backup_job_id) / [`set_backup_job_id(Option<String>)`](crate::client::fluent_builders::DeleteObject::set_backup_job_id): Backup job Id for the in-progress backup.
/// - [`object_name(impl Into<String>)`](crate::client::fluent_builders::DeleteObject::object_name) / [`set_object_name(Option<String>)`](crate::client::fluent_builders::DeleteObject::set_object_name): The name of the Object.
/// - On success, responds with [`DeleteObjectOutput`](crate::output::DeleteObjectOutput)
/// - On failure, responds with [`SdkError<DeleteObjectError>`](crate::error::DeleteObjectError)
pub fn delete_object(&self) -> fluent_builders::DeleteObject {
fluent_builders::DeleteObject::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetChunk`](crate::client::fluent_builders::GetChunk) operation.
///
/// - The fluent builder is configurable:
/// - [`storage_job_id(impl Into<String>)`](crate::client::fluent_builders::GetChunk::storage_job_id) / [`set_storage_job_id(Option<String>)`](crate::client::fluent_builders::GetChunk::set_storage_job_id): Storage job id
/// - [`chunk_token(impl Into<String>)`](crate::client::fluent_builders::GetChunk::chunk_token) / [`set_chunk_token(Option<String>)`](crate::client::fluent_builders::GetChunk::set_chunk_token): Chunk token
/// - On success, responds with [`GetChunkOutput`](crate::output::GetChunkOutput) with field(s):
/// - [`data(ByteStream)`](crate::output::GetChunkOutput::data): Chunk data
/// - [`length(i64)`](crate::output::GetChunkOutput::length): Data length
/// - [`checksum(Option<String>)`](crate::output::GetChunkOutput::checksum): Data checksum
/// - [`checksum_algorithm(Option<DataChecksumAlgorithm>)`](crate::output::GetChunkOutput::checksum_algorithm): Checksum algorithm
/// - On failure, responds with [`SdkError<GetChunkError>`](crate::error::GetChunkError)
pub fn get_chunk(&self) -> fluent_builders::GetChunk {
fluent_builders::GetChunk::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetObjectMetadata`](crate::client::fluent_builders::GetObjectMetadata) operation.
///
/// - The fluent builder is configurable:
/// - [`storage_job_id(impl Into<String>)`](crate::client::fluent_builders::GetObjectMetadata::storage_job_id) / [`set_storage_job_id(Option<String>)`](crate::client::fluent_builders::GetObjectMetadata::set_storage_job_id): Backup job id for the in-progress backup.
/// - [`object_token(impl Into<String>)`](crate::client::fluent_builders::GetObjectMetadata::object_token) / [`set_object_token(Option<String>)`](crate::client::fluent_builders::GetObjectMetadata::set_object_token): Object token.
/// - On success, responds with [`GetObjectMetadataOutput`](crate::output::GetObjectMetadataOutput) with field(s):
/// - [`metadata_string(Option<String>)`](crate::output::GetObjectMetadataOutput::metadata_string): Metadata string.
/// - [`metadata_blob(ByteStream)`](crate::output::GetObjectMetadataOutput::metadata_blob): Metadata blob.
/// - [`metadata_blob_length(i64)`](crate::output::GetObjectMetadataOutput::metadata_blob_length): The size of MetadataBlob.
/// - [`metadata_blob_checksum(Option<String>)`](crate::output::GetObjectMetadataOutput::metadata_blob_checksum): MetadataBlob checksum.
/// - [`metadata_blob_checksum_algorithm(Option<DataChecksumAlgorithm>)`](crate::output::GetObjectMetadataOutput::metadata_blob_checksum_algorithm): Checksum algorithm.
/// - On failure, responds with [`SdkError<GetObjectMetadataError>`](crate::error::GetObjectMetadataError)
pub fn get_object_metadata(&self) -> fluent_builders::GetObjectMetadata {
fluent_builders::GetObjectMetadata::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListChunks`](crate::client::fluent_builders::ListChunks) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListChunks::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`storage_job_id(impl Into<String>)`](crate::client::fluent_builders::ListChunks::storage_job_id) / [`set_storage_job_id(Option<String>)`](crate::client::fluent_builders::ListChunks::set_storage_job_id): Storage job id
/// - [`object_token(impl Into<String>)`](crate::client::fluent_builders::ListChunks::object_token) / [`set_object_token(Option<String>)`](crate::client::fluent_builders::ListChunks::set_object_token): Object token
/// - [`max_results(i32)`](crate::client::fluent_builders::ListChunks::max_results) / [`set_max_results(i32)`](crate::client::fluent_builders::ListChunks::set_max_results): Maximum number of chunks
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListChunks::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListChunks::set_next_token): Pagination token
/// - On success, responds with [`ListChunksOutput`](crate::output::ListChunksOutput) with field(s):
/// - [`chunk_list(Option<Vec<Chunk>>)`](crate::output::ListChunksOutput::chunk_list): List of chunks
/// - [`next_token(Option<String>)`](crate::output::ListChunksOutput::next_token): Pagination token
/// - On failure, responds with [`SdkError<ListChunksError>`](crate::error::ListChunksError)
pub fn list_chunks(&self) -> fluent_builders::ListChunks {
fluent_builders::ListChunks::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListObjects`](crate::client::fluent_builders::ListObjects) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListObjects::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`storage_job_id(impl Into<String>)`](crate::client::fluent_builders::ListObjects::storage_job_id) / [`set_storage_job_id(Option<String>)`](crate::client::fluent_builders::ListObjects::set_storage_job_id): Storage job id
/// - [`starting_object_name(impl Into<String>)`](crate::client::fluent_builders::ListObjects::starting_object_name) / [`set_starting_object_name(Option<String>)`](crate::client::fluent_builders::ListObjects::set_starting_object_name): Optional, specifies the starting Object name to list from. Ignored if NextToken is not NULL
/// - [`starting_object_prefix(impl Into<String>)`](crate::client::fluent_builders::ListObjects::starting_object_prefix) / [`set_starting_object_prefix(Option<String>)`](crate::client::fluent_builders::ListObjects::set_starting_object_prefix): Optional, specifies the starting Object prefix to list from. Ignored if NextToken is not NULL
/// - [`max_results(i32)`](crate::client::fluent_builders::ListObjects::max_results) / [`set_max_results(i32)`](crate::client::fluent_builders::ListObjects::set_max_results): Maximum objects count
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListObjects::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListObjects::set_next_token): Pagination token
/// - [`created_before(DateTime)`](crate::client::fluent_builders::ListObjects::created_before) / [`set_created_before(Option<DateTime>)`](crate::client::fluent_builders::ListObjects::set_created_before): (Optional) Created before filter
/// - [`created_after(DateTime)`](crate::client::fluent_builders::ListObjects::created_after) / [`set_created_after(Option<DateTime>)`](crate::client::fluent_builders::ListObjects::set_created_after): (Optional) Created after filter
/// - On success, responds with [`ListObjectsOutput`](crate::output::ListObjectsOutput) with field(s):
/// - [`object_list(Option<Vec<BackupObject>>)`](crate::output::ListObjectsOutput::object_list): Object list
/// - [`next_token(Option<String>)`](crate::output::ListObjectsOutput::next_token): Pagination token
/// - On failure, responds with [`SdkError<ListObjectsError>`](crate::error::ListObjectsError)
pub fn list_objects(&self) -> fluent_builders::ListObjects {
fluent_builders::ListObjects::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`NotifyObjectComplete`](crate::client::fluent_builders::NotifyObjectComplete) operation.
///
/// - The fluent builder is configurable:
/// - [`backup_job_id(impl Into<String>)`](crate::client::fluent_builders::NotifyObjectComplete::backup_job_id) / [`set_backup_job_id(Option<String>)`](crate::client::fluent_builders::NotifyObjectComplete::set_backup_job_id): Backup job Id for the in-progress backup
/// - [`upload_id(impl Into<String>)`](crate::client::fluent_builders::NotifyObjectComplete::upload_id) / [`set_upload_id(Option<String>)`](crate::client::fluent_builders::NotifyObjectComplete::set_upload_id): Upload Id for the in-progress upload
/// - [`object_checksum(impl Into<String>)`](crate::client::fluent_builders::NotifyObjectComplete::object_checksum) / [`set_object_checksum(Option<String>)`](crate::client::fluent_builders::NotifyObjectComplete::set_object_checksum): Object checksum
/// - [`object_checksum_algorithm(SummaryChecksumAlgorithm)`](crate::client::fluent_builders::NotifyObjectComplete::object_checksum_algorithm) / [`set_object_checksum_algorithm(Option<SummaryChecksumAlgorithm>)`](crate::client::fluent_builders::NotifyObjectComplete::set_object_checksum_algorithm): Checksum algorithm
/// - [`metadata_string(impl Into<String>)`](crate::client::fluent_builders::NotifyObjectComplete::metadata_string) / [`set_metadata_string(Option<String>)`](crate::client::fluent_builders::NotifyObjectComplete::set_metadata_string): Optional metadata associated with an Object. Maximum string length is 256 bytes.
/// - [`metadata_blob(ByteStream)`](crate::client::fluent_builders::NotifyObjectComplete::metadata_blob) / [`set_metadata_blob(ByteStream)`](crate::client::fluent_builders::NotifyObjectComplete::set_metadata_blob): Optional metadata associated with an Object. Maximum length is 4MB.
/// - [`metadata_blob_length(i64)`](crate::client::fluent_builders::NotifyObjectComplete::metadata_blob_length) / [`set_metadata_blob_length(i64)`](crate::client::fluent_builders::NotifyObjectComplete::set_metadata_blob_length): The size of MetadataBlob.
/// - [`metadata_blob_checksum(impl Into<String>)`](crate::client::fluent_builders::NotifyObjectComplete::metadata_blob_checksum) / [`set_metadata_blob_checksum(Option<String>)`](crate::client::fluent_builders::NotifyObjectComplete::set_metadata_blob_checksum): Checksum of MetadataBlob.
/// - [`metadata_blob_checksum_algorithm(DataChecksumAlgorithm)`](crate::client::fluent_builders::NotifyObjectComplete::metadata_blob_checksum_algorithm) / [`set_metadata_blob_checksum_algorithm(Option<DataChecksumAlgorithm>)`](crate::client::fluent_builders::NotifyObjectComplete::set_metadata_blob_checksum_algorithm): Checksum algorithm.
/// - On success, responds with [`NotifyObjectCompleteOutput`](crate::output::NotifyObjectCompleteOutput) with field(s):
/// - [`object_checksum(Option<String>)`](crate::output::NotifyObjectCompleteOutput::object_checksum): Object checksum
/// - [`object_checksum_algorithm(Option<SummaryChecksumAlgorithm>)`](crate::output::NotifyObjectCompleteOutput::object_checksum_algorithm): Checksum algorithm
/// - On failure, responds with [`SdkError<NotifyObjectCompleteError>`](crate::error::NotifyObjectCompleteError)
pub fn notify_object_complete(&self) -> fluent_builders::NotifyObjectComplete {
fluent_builders::NotifyObjectComplete::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutChunk`](crate::client::fluent_builders::PutChunk) operation.
///
/// - The fluent builder is configurable:
/// - [`backup_job_id(impl Into<String>)`](crate::client::fluent_builders::PutChunk::backup_job_id) / [`set_backup_job_id(Option<String>)`](crate::client::fluent_builders::PutChunk::set_backup_job_id): Backup job Id for the in-progress backup.
/// - [`upload_id(impl Into<String>)`](crate::client::fluent_builders::PutChunk::upload_id) / [`set_upload_id(Option<String>)`](crate::client::fluent_builders::PutChunk::set_upload_id): Upload Id for the in-progress upload.
/// - [`chunk_index(i64)`](crate::client::fluent_builders::PutChunk::chunk_index) / [`set_chunk_index(i64)`](crate::client::fluent_builders::PutChunk::set_chunk_index): Describes this chunk's position relative to the other chunks
/// - [`data(ByteStream)`](crate::client::fluent_builders::PutChunk::data) / [`set_data(ByteStream)`](crate::client::fluent_builders::PutChunk::set_data): Data to be uploaded
/// - [`length(i64)`](crate::client::fluent_builders::PutChunk::length) / [`set_length(i64)`](crate::client::fluent_builders::PutChunk::set_length): Data length
/// - [`checksum(impl Into<String>)`](crate::client::fluent_builders::PutChunk::checksum) / [`set_checksum(Option<String>)`](crate::client::fluent_builders::PutChunk::set_checksum): Data checksum
/// - [`checksum_algorithm(DataChecksumAlgorithm)`](crate::client::fluent_builders::PutChunk::checksum_algorithm) / [`set_checksum_algorithm(Option<DataChecksumAlgorithm>)`](crate::client::fluent_builders::PutChunk::set_checksum_algorithm): Checksum algorithm
/// - On success, responds with [`PutChunkOutput`](crate::output::PutChunkOutput) with field(s):
/// - [`chunk_checksum(Option<String>)`](crate::output::PutChunkOutput::chunk_checksum): Chunk checksum
/// - [`chunk_checksum_algorithm(Option<DataChecksumAlgorithm>)`](crate::output::PutChunkOutput::chunk_checksum_algorithm): Checksum algorithm
/// - On failure, responds with [`SdkError<PutChunkError>`](crate::error::PutChunkError)
pub fn put_chunk(&self) -> fluent_builders::PutChunk {
fluent_builders::PutChunk::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutObject`](crate::client::fluent_builders::PutObject) operation.
///
/// - The fluent builder is configurable:
/// - [`backup_job_id(impl Into<String>)`](crate::client::fluent_builders::PutObject::backup_job_id) / [`set_backup_job_id(Option<String>)`](crate::client::fluent_builders::PutObject::set_backup_job_id): Backup job Id for the in-progress backup.
/// - [`object_name(impl Into<String>)`](crate::client::fluent_builders::PutObject::object_name) / [`set_object_name(Option<String>)`](crate::client::fluent_builders::PutObject::set_object_name): The name of the Object to be uploaded.
/// - [`metadata_string(impl Into<String>)`](crate::client::fluent_builders::PutObject::metadata_string) / [`set_metadata_string(Option<String>)`](crate::client::fluent_builders::PutObject::set_metadata_string): Store user defined metadata like backup checksum, disk ids, restore metadata etc.
/// - [`inline_chunk(ByteStream)`](crate::client::fluent_builders::PutObject::inline_chunk) / [`set_inline_chunk(ByteStream)`](crate::client::fluent_builders::PutObject::set_inline_chunk): Inline chunk data to be uploaded.
/// - [`inline_chunk_length(i64)`](crate::client::fluent_builders::PutObject::inline_chunk_length) / [`set_inline_chunk_length(i64)`](crate::client::fluent_builders::PutObject::set_inline_chunk_length): Length of the inline chunk data.
/// - [`inline_chunk_checksum(impl Into<String>)`](crate::client::fluent_builders::PutObject::inline_chunk_checksum) / [`set_inline_chunk_checksum(Option<String>)`](crate::client::fluent_builders::PutObject::set_inline_chunk_checksum): Inline chunk checksum
/// - [`inline_chunk_checksum_algorithm(impl Into<String>)`](crate::client::fluent_builders::PutObject::inline_chunk_checksum_algorithm) / [`set_inline_chunk_checksum_algorithm(Option<String>)`](crate::client::fluent_builders::PutObject::set_inline_chunk_checksum_algorithm): Inline chunk checksum algorithm
/// - [`object_checksum(impl Into<String>)`](crate::client::fluent_builders::PutObject::object_checksum) / [`set_object_checksum(Option<String>)`](crate::client::fluent_builders::PutObject::set_object_checksum): object checksum
/// - [`object_checksum_algorithm(SummaryChecksumAlgorithm)`](crate::client::fluent_builders::PutObject::object_checksum_algorithm) / [`set_object_checksum_algorithm(Option<SummaryChecksumAlgorithm>)`](crate::client::fluent_builders::PutObject::set_object_checksum_algorithm): object checksum algorithm
/// - [`throw_on_duplicate(bool)`](crate::client::fluent_builders::PutObject::throw_on_duplicate) / [`set_throw_on_duplicate(bool)`](crate::client::fluent_builders::PutObject::set_throw_on_duplicate): Throw an exception if Object name is already exist.
/// - On success, responds with [`PutObjectOutput`](crate::output::PutObjectOutput) with field(s):
/// - [`inline_chunk_checksum(Option<String>)`](crate::output::PutObjectOutput::inline_chunk_checksum): Inline chunk checksum
/// - [`inline_chunk_checksum_algorithm(Option<DataChecksumAlgorithm>)`](crate::output::PutObjectOutput::inline_chunk_checksum_algorithm): Inline chunk checksum algorithm
/// - [`object_checksum(Option<String>)`](crate::output::PutObjectOutput::object_checksum): object checksum
/// - [`object_checksum_algorithm(Option<SummaryChecksumAlgorithm>)`](crate::output::PutObjectOutput::object_checksum_algorithm): object checksum algorithm
/// - On failure, responds with [`SdkError<PutObjectError>`](crate::error::PutObjectError)
pub fn put_object(&self) -> fluent_builders::PutObject {
fluent_builders::PutObject::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`StartObject`](crate::client::fluent_builders::StartObject) operation.
///
/// - The fluent builder is configurable:
/// - [`backup_job_id(impl Into<String>)`](crate::client::fluent_builders::StartObject::backup_job_id) / [`set_backup_job_id(Option<String>)`](crate::client::fluent_builders::StartObject::set_backup_job_id): Backup job Id for the in-progress backup
/// - [`object_name(impl Into<String>)`](crate::client::fluent_builders::StartObject::object_name) / [`set_object_name(Option<String>)`](crate::client::fluent_builders::StartObject::set_object_name): Name for the object.
/// - [`throw_on_duplicate(bool)`](crate::client::fluent_builders::StartObject::throw_on_duplicate) / [`set_throw_on_duplicate(bool)`](crate::client::fluent_builders::StartObject::set_throw_on_duplicate): Throw an exception if Object name is already exist.
/// - On success, responds with [`StartObjectOutput`](crate::output::StartObjectOutput) with field(s):
/// - [`upload_id(Option<String>)`](crate::output::StartObjectOutput::upload_id): Upload Id for a given upload.
/// - On failure, responds with [`SdkError<StartObjectError>`](crate::error::StartObjectError)
pub fn start_object(&self) -> fluent_builders::StartObject {
fluent_builders::StartObject::new(self.handle.clone())
}
}
pub mod fluent_builders {
//! Utilities to ergonomically construct a request to the service.
//!
//! Fluent builders are created through the [`Client`](crate::client::Client) by calling
//! one if its operation methods. After parameters are set using the builder methods,
//! the `send` method can be called to initiate the request.
/// Fluent builder constructing a request to `DeleteObject`.
///
/// Delete Object from the incremental base Backup.
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteObject {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::delete_object_input::Builder,
}
impl DeleteObject {
/// Creates a new `DeleteObject`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::DeleteObject,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::DeleteObjectError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteObjectOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteObjectError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Backup job Id for the in-progress backup.
pub fn backup_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.backup_job_id(input.into());
self
}
/// Backup job Id for the in-progress backup.
pub fn set_backup_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_backup_job_id(input);
self
}
/// The name of the Object.
pub fn object_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.object_name(input.into());
self
}
/// The name of the Object.
pub fn set_object_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_object_name(input);
self
}
}
/// Fluent builder constructing a request to `GetChunk`.
///
/// Gets the specified object's chunk.
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetChunk {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::get_chunk_input::Builder,
}
impl GetChunk {
/// Creates a new `GetChunk`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::GetChunk,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::GetChunkError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetChunkOutput,
aws_smithy_http::result::SdkError<crate::error::GetChunkError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Storage job id
pub fn storage_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.storage_job_id(input.into());
self
}
/// Storage job id
pub fn set_storage_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_storage_job_id(input);
self
}
/// Chunk token
pub fn chunk_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.chunk_token(input.into());
self
}
/// Chunk token
pub fn set_chunk_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_chunk_token(input);
self
}
}
/// Fluent builder constructing a request to `GetObjectMetadata`.
///
/// Get metadata associated with an Object.
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetObjectMetadata {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::get_object_metadata_input::Builder,
}
impl GetObjectMetadata {
/// Creates a new `GetObjectMetadata`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::GetObjectMetadata,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::GetObjectMetadataError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetObjectMetadataOutput,
aws_smithy_http::result::SdkError<crate::error::GetObjectMetadataError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Backup job id for the in-progress backup.
pub fn storage_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.storage_job_id(input.into());
self
}
/// Backup job id for the in-progress backup.
pub fn set_storage_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_storage_job_id(input);
self
}
/// Object token.
pub fn object_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.object_token(input.into());
self
}
/// Object token.
pub fn set_object_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_object_token(input);
self
}
}
/// Fluent builder constructing a request to `ListChunks`.
///
/// List chunks in a given Object
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListChunks {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::list_chunks_input::Builder,
}
impl ListChunks {
/// Creates a new `ListChunks`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::ListChunks,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::ListChunksError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListChunksOutput,
aws_smithy_http::result::SdkError<crate::error::ListChunksError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListChunksPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListChunksPaginator {
crate::paginator::ListChunksPaginator::new(self.handle, self.inner)
}
/// Storage job id
pub fn storage_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.storage_job_id(input.into());
self
}
/// Storage job id
pub fn set_storage_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_storage_job_id(input);
self
}
/// Object token
pub fn object_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.object_token(input.into());
self
}
/// Object token
pub fn set_object_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_object_token(input);
self
}
/// Maximum number of chunks
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// Maximum number of chunks
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// Pagination token
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// Pagination token
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `ListObjects`.
///
/// List all Objects in a given Backup.
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListObjects {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::list_objects_input::Builder,
}
impl ListObjects {
/// Creates a new `ListObjects`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::ListObjects,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::ListObjectsError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListObjectsOutput,
aws_smithy_http::result::SdkError<crate::error::ListObjectsError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListObjectsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListObjectsPaginator {
crate::paginator::ListObjectsPaginator::new(self.handle, self.inner)
}
/// Storage job id
pub fn storage_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.storage_job_id(input.into());
self
}
/// Storage job id
pub fn set_storage_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_storage_job_id(input);
self
}
/// Optional, specifies the starting Object name to list from. Ignored if NextToken is not NULL
pub fn starting_object_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.starting_object_name(input.into());
self
}
/// Optional, specifies the starting Object name to list from. Ignored if NextToken is not NULL
pub fn set_starting_object_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_starting_object_name(input);
self
}
/// Optional, specifies the starting Object prefix to list from. Ignored if NextToken is not NULL
pub fn starting_object_prefix(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.starting_object_prefix(input.into());
self
}
/// Optional, specifies the starting Object prefix to list from. Ignored if NextToken is not NULL
pub fn set_starting_object_prefix(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_starting_object_prefix(input);
self
}
/// Maximum objects count
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// Maximum objects count
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// Pagination token
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// Pagination token
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// (Optional) Created before filter
pub fn created_before(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.created_before(input);
self
}
/// (Optional) Created before filter
pub fn set_created_before(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_created_before(input);
self
}
/// (Optional) Created after filter
pub fn created_after(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.created_after(input);
self
}
/// (Optional) Created after filter
pub fn set_created_after(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_created_after(input);
self
}
}
/// Fluent builder constructing a request to `NotifyObjectComplete`.
///
/// Complete upload
#[derive(std::fmt::Debug)]
pub struct NotifyObjectComplete {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::notify_object_complete_input::Builder,
}
impl NotifyObjectComplete {
/// Creates a new `NotifyObjectComplete`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::NotifyObjectComplete,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::NotifyObjectCompleteError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::NotifyObjectCompleteOutput,
aws_smithy_http::result::SdkError<crate::error::NotifyObjectCompleteError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Backup job Id for the in-progress backup
pub fn backup_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.backup_job_id(input.into());
self
}
/// Backup job Id for the in-progress backup
pub fn set_backup_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_backup_job_id(input);
self
}
/// Upload Id for the in-progress upload
pub fn upload_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.upload_id(input.into());
self
}
/// Upload Id for the in-progress upload
pub fn set_upload_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_upload_id(input);
self
}
/// Object checksum
pub fn object_checksum(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.object_checksum(input.into());
self
}
/// Object checksum
pub fn set_object_checksum(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_object_checksum(input);
self
}
/// Checksum algorithm
pub fn object_checksum_algorithm(
mut self,
input: crate::model::SummaryChecksumAlgorithm,
) -> Self {
self.inner = self.inner.object_checksum_algorithm(input);
self
}
/// Checksum algorithm
pub fn set_object_checksum_algorithm(
mut self,
input: std::option::Option<crate::model::SummaryChecksumAlgorithm>,
) -> Self {
self.inner = self.inner.set_object_checksum_algorithm(input);
self
}
/// Optional metadata associated with an Object. Maximum string length is 256 bytes.
pub fn metadata_string(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metadata_string(input.into());
self
}
/// Optional metadata associated with an Object. Maximum string length is 256 bytes.
pub fn set_metadata_string(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_metadata_string(input);
self
}
/// Optional metadata associated with an Object. Maximum length is 4MB.
pub fn metadata_blob(mut self, input: aws_smithy_http::byte_stream::ByteStream) -> Self {
self.inner = self.inner.metadata_blob(input);
self
}
/// Optional metadata associated with an Object. Maximum length is 4MB.
pub fn set_metadata_blob(
mut self,
input: std::option::Option<aws_smithy_http::byte_stream::ByteStream>,
) -> Self {
self.inner = self.inner.set_metadata_blob(input);
self
}
/// The size of MetadataBlob.
pub fn metadata_blob_length(mut self, input: i64) -> Self {
self.inner = self.inner.metadata_blob_length(input);
self
}
/// The size of MetadataBlob.
pub fn set_metadata_blob_length(mut self, input: std::option::Option<i64>) -> Self {
self.inner = self.inner.set_metadata_blob_length(input);
self
}
/// Checksum of MetadataBlob.
pub fn metadata_blob_checksum(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metadata_blob_checksum(input.into());
self
}
/// Checksum of MetadataBlob.
pub fn set_metadata_blob_checksum(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_metadata_blob_checksum(input);
self
}
/// Checksum algorithm.
pub fn metadata_blob_checksum_algorithm(
mut self,
input: crate::model::DataChecksumAlgorithm,
) -> Self {
self.inner = self.inner.metadata_blob_checksum_algorithm(input);
self
}
/// Checksum algorithm.
pub fn set_metadata_blob_checksum_algorithm(
mut self,
input: std::option::Option<crate::model::DataChecksumAlgorithm>,
) -> Self {
self.inner = self.inner.set_metadata_blob_checksum_algorithm(input);
self
}
}
/// Fluent builder constructing a request to `PutChunk`.
///
/// Upload chunk.
#[derive(std::fmt::Debug)]
pub struct PutChunk {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::put_chunk_input::Builder,
}
impl PutChunk {
/// Creates a new `PutChunk`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::PutChunk,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::PutChunkError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutChunkOutput,
aws_smithy_http::result::SdkError<crate::error::PutChunkError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Backup job Id for the in-progress backup.
pub fn backup_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.backup_job_id(input.into());
self
}
/// Backup job Id for the in-progress backup.
pub fn set_backup_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_backup_job_id(input);
self
}
/// Upload Id for the in-progress upload.
pub fn upload_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.upload_id(input.into());
self
}
/// Upload Id for the in-progress upload.
pub fn set_upload_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_upload_id(input);
self
}
/// Describes this chunk's position relative to the other chunks
pub fn chunk_index(mut self, input: i64) -> Self {
self.inner = self.inner.chunk_index(input);
self
}
/// Describes this chunk's position relative to the other chunks
pub fn set_chunk_index(mut self, input: std::option::Option<i64>) -> Self {
self.inner = self.inner.set_chunk_index(input);
self
}
/// Data to be uploaded
pub fn data(mut self, input: aws_smithy_http::byte_stream::ByteStream) -> Self {
self.inner = self.inner.data(input);
self
}
/// Data to be uploaded
pub fn set_data(
mut self,
input: std::option::Option<aws_smithy_http::byte_stream::ByteStream>,
) -> Self {
self.inner = self.inner.set_data(input);
self
}
/// Data length
pub fn length(mut self, input: i64) -> Self {
self.inner = self.inner.length(input);
self
}
/// Data length
pub fn set_length(mut self, input: std::option::Option<i64>) -> Self {
self.inner = self.inner.set_length(input);
self
}
/// Data checksum
pub fn checksum(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.checksum(input.into());
self
}
/// Data checksum
pub fn set_checksum(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_checksum(input);
self
}
/// Checksum algorithm
pub fn checksum_algorithm(mut self, input: crate::model::DataChecksumAlgorithm) -> Self {
self.inner = self.inner.checksum_algorithm(input);
self
}
/// Checksum algorithm
pub fn set_checksum_algorithm(
mut self,
input: std::option::Option<crate::model::DataChecksumAlgorithm>,
) -> Self {
self.inner = self.inner.set_checksum_algorithm(input);
self
}
}
/// Fluent builder constructing a request to `PutObject`.
///
/// Upload object that can store object metadata String and data blob in single API call using inline chunk field.
#[derive(std::fmt::Debug)]
pub struct PutObject {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::put_object_input::Builder,
}
impl PutObject {
/// Creates a new `PutObject`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::PutObject,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::PutObjectError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutObjectOutput,
aws_smithy_http::result::SdkError<crate::error::PutObjectError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Backup job Id for the in-progress backup.
pub fn backup_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.backup_job_id(input.into());
self
}
/// Backup job Id for the in-progress backup.
pub fn set_backup_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_backup_job_id(input);
self
}
/// The name of the Object to be uploaded.
pub fn object_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.object_name(input.into());
self
}
/// The name of the Object to be uploaded.
pub fn set_object_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_object_name(input);
self
}
/// Store user defined metadata like backup checksum, disk ids, restore metadata etc.
pub fn metadata_string(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metadata_string(input.into());
self
}
/// Store user defined metadata like backup checksum, disk ids, restore metadata etc.
pub fn set_metadata_string(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_metadata_string(input);
self
}
/// Inline chunk data to be uploaded.
pub fn inline_chunk(mut self, input: aws_smithy_http::byte_stream::ByteStream) -> Self {
self.inner = self.inner.inline_chunk(input);
self
}
/// Inline chunk data to be uploaded.
pub fn set_inline_chunk(
mut self,
input: std::option::Option<aws_smithy_http::byte_stream::ByteStream>,
) -> Self {
self.inner = self.inner.set_inline_chunk(input);
self
}
/// Length of the inline chunk data.
pub fn inline_chunk_length(mut self, input: i64) -> Self {
self.inner = self.inner.inline_chunk_length(input);
self
}
/// Length of the inline chunk data.
pub fn set_inline_chunk_length(mut self, input: std::option::Option<i64>) -> Self {
self.inner = self.inner.set_inline_chunk_length(input);
self
}
/// Inline chunk checksum
pub fn inline_chunk_checksum(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.inline_chunk_checksum(input.into());
self
}
/// Inline chunk checksum
pub fn set_inline_chunk_checksum(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_inline_chunk_checksum(input);
self
}
/// Inline chunk checksum algorithm
pub fn inline_chunk_checksum_algorithm(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.inline_chunk_checksum_algorithm(input.into());
self
}
/// Inline chunk checksum algorithm
pub fn set_inline_chunk_checksum_algorithm(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_inline_chunk_checksum_algorithm(input);
self
}
/// object checksum
pub fn object_checksum(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.object_checksum(input.into());
self
}
/// object checksum
pub fn set_object_checksum(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_object_checksum(input);
self
}
/// object checksum algorithm
pub fn object_checksum_algorithm(
mut self,
input: crate::model::SummaryChecksumAlgorithm,
) -> Self {
self.inner = self.inner.object_checksum_algorithm(input);
self
}
/// object checksum algorithm
pub fn set_object_checksum_algorithm(
mut self,
input: std::option::Option<crate::model::SummaryChecksumAlgorithm>,
) -> Self {
self.inner = self.inner.set_object_checksum_algorithm(input);
self
}
/// Throw an exception if Object name is already exist.
pub fn throw_on_duplicate(mut self, input: bool) -> Self {
self.inner = self.inner.throw_on_duplicate(input);
self
}
/// Throw an exception if Object name is already exist.
pub fn set_throw_on_duplicate(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_throw_on_duplicate(input);
self
}
}
/// Fluent builder constructing a request to `StartObject`.
///
/// Start upload containing one or many chunks.
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct StartObject {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::start_object_input::Builder,
}
impl StartObject {
/// Creates a new `StartObject`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Consume this builder, creating a customizable operation that can be modified before being
/// sent. The operation's inner [http::Request] can be modified as well.
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::StartObject,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::StartObjectError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::StartObjectOutput,
aws_smithy_http::result::SdkError<crate::error::StartObjectError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
/// Backup job Id for the in-progress backup
pub fn backup_job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.backup_job_id(input.into());
self
}
/// Backup job Id for the in-progress backup
pub fn set_backup_job_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_backup_job_id(input);
self
}
/// Name for the object.
pub fn object_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.object_name(input.into());
self
}
/// Name for the object.
pub fn set_object_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_object_name(input);
self
}
/// Throw an exception if Object name is already exist.
pub fn throw_on_duplicate(mut self, input: bool) -> Self {
self.inner = self.inner.throw_on_duplicate(input);
self
}
/// Throw an exception if Object name is already exist.
pub fn set_throw_on_duplicate(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_throw_on_duplicate(input);
self
}
}
}
impl Client {
/// Creates a new client from an [SDK Config](aws_types::sdk_config::SdkConfig).
///
/// # Panics
///
/// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set
/// the `sleep_impl` on the Config passed into this function to fix it.
/// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the
/// `http_connector` on the Config passed into this function to fix it.
pub fn new(sdk_config: &aws_types::sdk_config::SdkConfig) -> Self {
Self::from_conf(sdk_config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
///
/// # Panics
///
/// - This method will panic if the `conf` is missing an async sleep implementation. If you experience this panic, set
/// the `sleep_impl` on the Config passed into this function to fix it.
/// - This method will panic if the `conf` is missing an HTTP connector. If you experience this panic, set the
/// `http_connector` on the Config passed into this function to fix it.
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf
.retry_config()
.cloned()
.unwrap_or_else(aws_smithy_types::retry::RetryConfig::disabled);
let timeout_config = conf
.timeout_config()
.cloned()
.unwrap_or_else(aws_smithy_types::timeout::TimeoutConfig::disabled);
let sleep_impl = conf.sleep_impl();
if (retry_config.has_retry() || timeout_config.has_timeouts()) && sleep_impl.is_none() {
panic!("An async sleep implementation is required for retries or timeouts to work. \
Set the `sleep_impl` on the Config passed into this function to fix this panic.");
}
let connector = conf.http_connector().and_then(|c| {
let timeout_config = conf
.timeout_config()
.cloned()
.unwrap_or_else(aws_smithy_types::timeout::TimeoutConfig::disabled);
let connector_settings =
aws_smithy_client::http_connector::ConnectorSettings::from_timeout_config(
&timeout_config,
);
c.connector(&connector_settings, conf.sleep_impl())
});
let builder = aws_smithy_client::Builder::new();
let builder = match connector {
// Use provided connector
Some(c) => builder.connector(c),
None => {
#[cfg(any(feature = "rustls", feature = "native-tls"))]
{
// Use default connector based on enabled features
builder.dyn_https_connector(
aws_smithy_client::http_connector::ConnectorSettings::from_timeout_config(
&timeout_config,
),
)
}
#[cfg(not(any(feature = "rustls", feature = "native-tls")))]
{
panic!("No HTTP connector was available. Enable the `rustls` or `native-tls` crate feature or set a connector to fix this.");
}
}
};
let mut builder = builder
.middleware(aws_smithy_client::erase::DynMiddleware::new(
crate::middleware::DefaultMiddleware::new(),
))
.retry_config(retry_config.into())
.operation_timeout_config(timeout_config.into());
builder.set_sleep_impl(sleep_impl);
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}