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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
pub(crate) client: aws_smithy_client::Client<C, M, R>,
pub(crate) conf: crate::Config,
}
/// Client for Amazon Elastic Block Store
///
/// Client for invoking operations on Amazon Elastic Block Store. Each operation on Amazon Elastic Block Store 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_ebs::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::RetryConfig;
/// # async fn docs() {
/// let shared_config = aws_config::load_from_env().await;
/// let config = aws_sdk_ebs::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_ebs::Client::from_conf(config);
/// # }
#[derive(std::fmt::Debug)]
pub struct Client<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<Handle<C, M, R>>,
}
impl<C, M, R> std::clone::Clone for Client<C, M, R> {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl<C, M, R> From<aws_smithy_client::Client<C, M, R>> for Client<C, M, R> {
fn from(client: aws_smithy_client::Client<C, M, R>) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl<C, M, R> Client<C, M, R> {
/// Creates a client with the given service configuration.
pub fn with_config(client: aws_smithy_client::Client<C, M, R>, 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<C, M, R> Client<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Constructs a fluent builder for the `CompleteSnapshot` operation.
///
/// See [`CompleteSnapshot`](crate::client::fluent_builders::CompleteSnapshot) for more information about the
/// operation and its arguments.
pub fn complete_snapshot(&self) -> fluent_builders::CompleteSnapshot<C, M, R> {
fluent_builders::CompleteSnapshot::new(self.handle.clone())
}
/// Constructs a fluent builder for the `GetSnapshotBlock` operation.
///
/// See [`GetSnapshotBlock`](crate::client::fluent_builders::GetSnapshotBlock) for more information about the
/// operation and its arguments.
pub fn get_snapshot_block(&self) -> fluent_builders::GetSnapshotBlock<C, M, R> {
fluent_builders::GetSnapshotBlock::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListChangedBlocks` operation.
///
/// See [`ListChangedBlocks`](crate::client::fluent_builders::ListChangedBlocks) for more information about the
/// operation and its arguments.
/// This operation supports pagination. See [`into_paginator()`](crate::client::fluent_builders::ListChangedBlocks::into_paginator).
pub fn list_changed_blocks(&self) -> fluent_builders::ListChangedBlocks<C, M, R> {
fluent_builders::ListChangedBlocks::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListSnapshotBlocks` operation.
///
/// See [`ListSnapshotBlocks`](crate::client::fluent_builders::ListSnapshotBlocks) for more information about the
/// operation and its arguments.
/// This operation supports pagination. See [`into_paginator()`](crate::client::fluent_builders::ListSnapshotBlocks::into_paginator).
pub fn list_snapshot_blocks(&self) -> fluent_builders::ListSnapshotBlocks<C, M, R> {
fluent_builders::ListSnapshotBlocks::new(self.handle.clone())
}
/// Constructs a fluent builder for the `PutSnapshotBlock` operation.
///
/// See [`PutSnapshotBlock`](crate::client::fluent_builders::PutSnapshotBlock) for more information about the
/// operation and its arguments.
pub fn put_snapshot_block(&self) -> fluent_builders::PutSnapshotBlock<C, M, R> {
fluent_builders::PutSnapshotBlock::new(self.handle.clone())
}
/// Constructs a fluent builder for the `StartSnapshot` operation.
///
/// See [`StartSnapshot`](crate::client::fluent_builders::StartSnapshot) for more information about the
/// operation and its arguments.
pub fn start_snapshot(&self) -> fluent_builders::StartSnapshot<C, M, R> {
fluent_builders::StartSnapshot::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 `CompleteSnapshot`.
///
/// <p>Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to <code>completed</code>. You cannot write new blocks to a snapshot after it has been completed.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CompleteSnapshot<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::complete_snapshot_input::Builder,
}
impl<C, M, R> CompleteSnapshot<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `CompleteSnapshot`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// 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::CompleteSnapshotOutput,
aws_smithy_http::result::SdkError<crate::error::CompleteSnapshotError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::CompleteSnapshotInputOperationOutputAlias,
crate::output::CompleteSnapshotOutput,
crate::error::CompleteSnapshotError,
crate::input::CompleteSnapshotInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ID of the snapshot.</p>
pub fn snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.snapshot_id(input.into());
self
}
/// <p>The ID of the snapshot.</p>
pub fn set_snapshot_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_snapshot_id(input);
self
}
/// <p>The number of blocks that were written to the snapshot.</p>
pub fn changed_blocks_count(mut self, input: i32) -> Self {
self.inner = self.inner.changed_blocks_count(input);
self
}
/// <p>The number of blocks that were written to the snapshot.</p>
pub fn set_changed_blocks_count(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_changed_blocks_count(input);
self
}
/// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
/// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
pub fn checksum(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.checksum(input.into());
self
}
/// <p>An aggregated Base-64 SHA256 checksum based on the checksums of each written block.</p>
/// <p>To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm.</p>
pub fn set_checksum(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_checksum(input);
self
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub fn checksum_algorithm(mut self, input: crate::model::ChecksumAlgorithm) -> Self {
self.inner = self.inner.checksum_algorithm(input);
self
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub fn set_checksum_algorithm(
mut self,
input: std::option::Option<crate::model::ChecksumAlgorithm>,
) -> Self {
self.inner = self.inner.set_checksum_algorithm(input);
self
}
/// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
pub fn checksum_aggregation_method(
mut self,
input: crate::model::ChecksumAggregationMethod,
) -> Self {
self.inner = self.inner.checksum_aggregation_method(input);
self
}
/// <p>The aggregation method used to generate the checksum. Currently, the only supported aggregation method is <code>LINEAR</code>.</p>
pub fn set_checksum_aggregation_method(
mut self,
input: std::option::Option<crate::model::ChecksumAggregationMethod>,
) -> Self {
self.inner = self.inner.set_checksum_aggregation_method(input);
self
}
}
/// Fluent builder constructing a request to `GetSnapshotBlock`.
///
/// <p>Returns the data in a block in an Amazon Elastic Block Store snapshot.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetSnapshotBlock<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_snapshot_block_input::Builder,
}
impl<C, M, R> GetSnapshotBlock<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetSnapshotBlock`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// 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::GetSnapshotBlockOutput,
aws_smithy_http::result::SdkError<crate::error::GetSnapshotBlockError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetSnapshotBlockInputOperationOutputAlias,
crate::output::GetSnapshotBlockOutput,
crate::error::GetSnapshotBlockError,
crate::input::GetSnapshotBlockInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ID of the snapshot containing the block from which to get data.</p>
pub fn snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.snapshot_id(input.into());
self
}
/// <p>The ID of the snapshot containing the block from which to get data.</p>
pub fn set_snapshot_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_snapshot_id(input);
self
}
/// <p>The block index of the block from which to get data.</p>
/// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub fn block_index(mut self, input: i32) -> Self {
self.inner = self.inner.block_index(input);
self
}
/// <p>The block index of the block from which to get data.</p>
/// <p>Obtain the <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub fn set_block_index(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_block_index(input);
self
}
/// <p>The block token of the block from which to get data.</p>
/// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub fn block_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.block_token(input.into());
self
}
/// <p>The block token of the block from which to get data.</p>
/// <p>Obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub fn set_block_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_block_token(input);
self
}
}
/// Fluent builder constructing a request to `ListChangedBlocks`.
///
/// <p>Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListChangedBlocks<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_changed_blocks_input::Builder,
}
impl<C, M, R> ListChangedBlocks<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListChangedBlocks`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// 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::ListChangedBlocksOutput,
aws_smithy_http::result::SdkError<crate::error::ListChangedBlocksError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListChangedBlocksInputOperationOutputAlias,
crate::output::ListChangedBlocksOutput,
crate::error::ListChangedBlocksError,
crate::input::ListChangedBlocksInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListChangedBlocksPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListChangedBlocksPaginator<C, M, R> {
crate::paginator::ListChangedBlocksPaginator::new(self.handle, self.inner)
}
/// <p>The ID of the first snapshot to use for the comparison.</p> <important>
/// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
/// </important>
pub fn first_snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.first_snapshot_id(input.into());
self
}
/// <p>The ID of the first snapshot to use for the comparison.</p> <important>
/// <p>The <code>FirstSnapshotID</code> parameter must be specified with a <code>SecondSnapshotId</code> parameter; otherwise, an error occurs.</p>
/// </important>
pub fn set_first_snapshot_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_first_snapshot_id(input);
self
}
/// <p>The ID of the second snapshot to use for the comparison.</p> <important>
/// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
/// </important>
pub fn second_snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.second_snapshot_id(input.into());
self
}
/// <p>The ID of the second snapshot to use for the comparison.</p> <important>
/// <p>The <code>SecondSnapshotId</code> parameter must be specified with a <code>FirstSnapshotID</code> parameter; otherwise, an error occurs.</p>
/// </important>
pub fn set_second_snapshot_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_second_snapshot_id(input);
self
}
/// <p>The token to request the next page of results.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The token to request the next page of results.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The number of results to return.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The number of results to return.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The block index from which the comparison should start.</p>
/// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
pub fn starting_block_index(mut self, input: i32) -> Self {
self.inner = self.inner.starting_block_index(input);
self
}
/// <p>The block index from which the comparison should start.</p>
/// <p>The list in the response will start from this block index or the next valid block index in the snapshots.</p>
pub fn set_starting_block_index(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_starting_block_index(input);
self
}
}
/// Fluent builder constructing a request to `ListSnapshotBlocks`.
///
/// <p>Returns information about the blocks in an Amazon Elastic Block Store snapshot.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListSnapshotBlocks<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_snapshot_blocks_input::Builder,
}
impl<C, M, R> ListSnapshotBlocks<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListSnapshotBlocks`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// 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::ListSnapshotBlocksOutput,
aws_smithy_http::result::SdkError<crate::error::ListSnapshotBlocksError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListSnapshotBlocksInputOperationOutputAlias,
crate::output::ListSnapshotBlocksOutput,
crate::error::ListSnapshotBlocksError,
crate::input::ListSnapshotBlocksInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListSnapshotBlocksPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListSnapshotBlocksPaginator<C, M, R> {
crate::paginator::ListSnapshotBlocksPaginator::new(self.handle, self.inner)
}
/// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
pub fn snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.snapshot_id(input.into());
self
}
/// <p>The ID of the snapshot from which to get block indexes and block tokens.</p>
pub fn set_snapshot_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_snapshot_id(input);
self
}
/// <p>The token to request the next page of results.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The token to request the next page of results.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The number of results to return.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The number of results to return.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
pub fn starting_block_index(mut self, input: i32) -> Self {
self.inner = self.inner.starting_block_index(input);
self
}
/// <p>The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.</p>
pub fn set_starting_block_index(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_starting_block_index(input);
self
}
}
/// Fluent builder constructing a request to `PutSnapshotBlock`.
///
/// <p>Writes a block of data to a snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the <code>pending</code> state.</p>
/// <p>Data written to a snapshot must be aligned with 512-KiB sectors.</p>
#[derive(std::fmt::Debug)]
pub struct PutSnapshotBlock<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_snapshot_block_input::Builder,
}
impl<C, M, R> PutSnapshotBlock<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutSnapshotBlock`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// 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::PutSnapshotBlockOutput,
aws_smithy_http::result::SdkError<crate::error::PutSnapshotBlockError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutSnapshotBlockInputOperationOutputAlias,
crate::output::PutSnapshotBlockOutput,
crate::error::PutSnapshotBlockError,
crate::input::PutSnapshotBlockInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ID of the snapshot.</p>
pub fn snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.snapshot_id(input.into());
self
}
/// <p>The ID of the snapshot.</p>
pub fn set_snapshot_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_snapshot_id(input);
self
}
/// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
pub fn block_index(mut self, input: i32) -> Self {
self.inner = self.inner.block_index(input);
self
}
/// <p>The block index of the block in which to write the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
pub fn set_block_index(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_block_index(input);
self
}
/// <p>The data to write to the block.</p>
/// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn block_data(mut self, input: aws_smithy_http::byte_stream::ByteStream) -> Self {
self.inner = self.inner.block_data(input);
self
}
/// <p>The data to write to the block.</p>
/// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn set_block_data(
mut self,
input: std::option::Option<aws_smithy_http::byte_stream::ByteStream>,
) -> Self {
self.inner = self.inner.set_block_data(input);
self
}
/// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p>
/// <p>Valid values: <code>524288</code> </p>
pub fn data_length(mut self, input: i32) -> Self {
self.inner = self.inner.data_length(input);
self
}
/// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p>
/// <p>Valid values: <code>524288</code> </p>
pub fn set_data_length(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_data_length(input);
self
}
/// <p>The progress of the write process, as a percentage.</p>
pub fn progress(mut self, input: i32) -> Self {
self.inner = self.inner.progress(input);
self
}
/// <p>The progress of the write process, as a percentage.</p>
pub fn set_progress(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_progress(input);
self
}
/// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
pub fn checksum(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.checksum(input.into());
self
}
/// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
pub fn set_checksum(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_checksum(input);
self
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub fn checksum_algorithm(mut self, input: crate::model::ChecksumAlgorithm) -> Self {
self.inner = self.inner.checksum_algorithm(input);
self
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub fn set_checksum_algorithm(
mut self,
input: std::option::Option<crate::model::ChecksumAlgorithm>,
) -> Self {
self.inner = self.inner.set_checksum_algorithm(input);
self
}
}
/// Fluent builder constructing a request to `StartSnapshot`.
///
/// <p>Creates a new Amazon EBS snapshot. The new snapshot enters the <code>pending</code> state after the request completes. </p>
/// <p>After creating the snapshot, use <a href="https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html"> PutSnapshotBlock</a> to write blocks of data to the snapshot.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct StartSnapshot<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::start_snapshot_input::Builder,
}
impl<C, M, R> StartSnapshot<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `StartSnapshot`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// 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::StartSnapshotOutput,
aws_smithy_http::result::SdkError<crate::error::StartSnapshotError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::StartSnapshotInputOperationOutputAlias,
crate::output::StartSnapshotOutput,
crate::error::StartSnapshotError,
crate::input::StartSnapshotInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The size of the volume, in GiB. The maximum size is <code>65536</code> GiB (64 TiB).</p>
pub fn volume_size(mut self, input: i64) -> Self {
self.inner = self.inner.volume_size(input);
self
}
/// <p>The size of the volume, in GiB. The maximum size is <code>65536</code> GiB (64 TiB).</p>
pub fn set_volume_size(mut self, input: std::option::Option<i64>) -> Self {
self.inner = self.inner.set_volume_size(input);
self
}
/// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
/// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
pub fn parent_snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.parent_snapshot_id(input.into());
self
}
/// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
/// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
pub fn set_parent_snapshot_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_parent_snapshot_id(input);
self
}
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags to apply to the snapshot.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>The tags to apply to the snapshot.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>A description for the snapshot.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.description(input.into());
self
}
/// <p>A description for the snapshot.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_description(input);
self
}
/// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
/// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.client_token(input.into());
self
}
/// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
/// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_client_token(input);
self
}
/// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
/// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
/// <p>If you specify <code>true</code>, the snapshot is encrypted using the KMS key specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default KMS key for your account is used. If no default KMS key has been specified for your account, the Amazon Web Services managed KMS key is used. To set a default KMS key for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
/// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn encrypted(mut self, input: bool) -> Self {
self.inner = self.inner.encrypted(input);
self
}
/// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
/// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
/// <p>If you specify <code>true</code>, the snapshot is encrypted using the KMS key specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default KMS key for your account is used. If no default KMS key has been specified for your account, the Amazon Web Services managed KMS key is used. To set a default KMS key for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
/// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn set_encrypted(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_encrypted(input);
self
}
/// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to be used to encrypt the snapshot. If you do not specify a KMS key, the default Amazon Web Services managed KMS key is used.</p>
/// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same KMS key that was used to encrypt the parent snapshot.</p>
/// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a KMS key ARN. </p>
pub fn kms_key_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.kms_key_arn(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to be used to encrypt the snapshot. If you do not specify a KMS key, the default Amazon Web Services managed KMS key is used.</p>
/// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same KMS key that was used to encrypt the parent snapshot.</p>
/// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a KMS key ARN. </p>
pub fn set_kms_key_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_kms_key_arn(input);
self
}
/// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
/// <ul>
/// <li> <p>No blocks are written to the snapshot.</p> </li>
/// <li> <p>The snapshot is not completed after writing the last block of data.</p> </li>
/// </ul>
/// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
pub fn timeout(mut self, input: i32) -> Self {
self.inner = self.inner.timeout(input);
self
}
/// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
/// <ul>
/// <li> <p>No blocks are written to the snapshot.</p> </li>
/// <li> <p>The snapshot is not completed after writing the last block of data.</p> </li>
/// </ul>
/// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
pub fn set_timeout(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_timeout(input);
self
}
}
}
impl<C> Client<C, crate::middleware::DefaultMiddleware, aws_smithy_client::retry::Standard> {
/// Creates a client with the given service config and connector override.
pub fn from_conf_conn(conf: crate::Config, conn: C) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::new()
.connector(conn)
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}
impl
Client<
aws_smithy_client::erase::DynConnector,
crate::middleware::DefaultMiddleware,
aws_smithy_client::retry::Standard,
>
{
/// Creates a new client from a shared config.
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn new(config: &aws_types::config::Config) -> Self {
Self::from_conf(config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::dyn_https()
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
// the builder maintains a try-state. To avoid suppressing the warning when sleep is unset,
// only set it if we actually have a sleep impl.
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}