AWS SDK

AWS SDK

rev. 61347dcfc6aea9b1bb95fa06ec94864357dd1146

Files changed:

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/put_object_legal_hold/builders.rs

@@ -44,44 +104,105 @@
   64     64   
    pub fn as_input(&self) -> &crate::operation::put_object_legal_hold::builders::PutObjectLegalHoldInputBuilder {
   65     65   
        &self.inner
   66     66   
    }
   67     67   
    /// Sends the request and returns the response.
   68     68   
    ///
   69     69   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   70     70   
    /// can be matched against.
   71     71   
    ///
   72     72   
    /// By default, any retryable failures will be retried twice. Retry behavior
   73     73   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   74         -
    /// set when configuring the client.
          74  +
    /// set when configuring the client. Note: retries are enabled by default when using
          75  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   75     76   
    pub async fn send(
   76     77   
        self,
   77     78   
    ) -> ::std::result::Result<
   78     79   
        crate::operation::put_object_legal_hold::PutObjectLegalHoldOutput,
   79     80   
        ::aws_smithy_runtime_api::client::result::SdkError<
   80     81   
            crate::operation::put_object_legal_hold::PutObjectLegalHoldError,
   81     82   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   82     83   
        >,
   83     84   
    > {
   84     85   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/put_object_lock_configuration/builders.rs

@@ -52,52 +112,113 @@
   72     72   
    pub fn as_input(&self) -> &crate::operation::put_object_lock_configuration::builders::PutObjectLockConfigurationInputBuilder {
   73     73   
        &self.inner
   74     74   
    }
   75     75   
    /// Sends the request and returns the response.
   76     76   
    ///
   77     77   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   78     78   
    /// can be matched against.
   79     79   
    ///
   80     80   
    /// By default, any retryable failures will be retried twice. Retry behavior
   81     81   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   82         -
    /// set when configuring the client.
          82  +
    /// set when configuring the client. Note: retries are enabled by default when using
          83  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   83     84   
    pub async fn send(
   84     85   
        self,
   85     86   
    ) -> ::std::result::Result<
   86     87   
        crate::operation::put_object_lock_configuration::PutObjectLockConfigurationOutput,
   87     88   
        ::aws_smithy_runtime_api::client::result::SdkError<
   88     89   
            crate::operation::put_object_lock_configuration::PutObjectLockConfigurationError,
   89     90   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   90     91   
        >,
   91     92   
    > {
   92     93   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/put_object_retention/builders.rs

@@ -44,44 +104,105 @@
   64     64   
    pub fn as_input(&self) -> &crate::operation::put_object_retention::builders::PutObjectRetentionInputBuilder {
   65     65   
        &self.inner
   66     66   
    }
   67     67   
    /// Sends the request and returns the response.
   68     68   
    ///
   69     69   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   70     70   
    /// can be matched against.
   71     71   
    ///
   72     72   
    /// By default, any retryable failures will be retried twice. Retry behavior
   73     73   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   74         -
    /// set when configuring the client.
          74  +
    /// set when configuring the client. Note: retries are enabled by default when using
          75  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   75     76   
    pub async fn send(
   76     77   
        self,
   77     78   
    ) -> ::std::result::Result<
   78     79   
        crate::operation::put_object_retention::PutObjectRetentionOutput,
   79     80   
        ::aws_smithy_runtime_api::client::result::SdkError<
   80     81   
            crate::operation::put_object_retention::PutObjectRetentionError,
   81     82   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   82     83   
        >,
   83     84   
    > {
   84     85   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/put_object_tagging/builders.rs

@@ -65,65 +125,126 @@
   85     85   
    pub fn as_input(&self) -> &crate::operation::put_object_tagging::builders::PutObjectTaggingInputBuilder {
   86     86   
        &self.inner
   87     87   
    }
   88     88   
    /// Sends the request and returns the response.
   89     89   
    ///
   90     90   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   91     91   
    /// can be matched against.
   92     92   
    ///
   93     93   
    /// By default, any retryable failures will be retried twice. Retry behavior
   94     94   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   95         -
    /// set when configuring the client.
          95  +
    /// set when configuring the client. Note: retries are enabled by default when using
          96  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   96     97   
    pub async fn send(
   97     98   
        self,
   98     99   
    ) -> ::std::result::Result<
   99    100   
        crate::operation::put_object_tagging::PutObjectTaggingOutput,
  100    101   
        ::aws_smithy_runtime_api::client::result::SdkError<
  101    102   
            crate::operation::put_object_tagging::PutObjectTaggingError,
  102    103   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  103    104   
        >,
  104    105   
    > {
  105    106   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/put_public_access_block/builders.rs

@@ -57,57 +117,118 @@
   77     77   
    pub fn as_input(&self) -> &crate::operation::put_public_access_block::builders::PutPublicAccessBlockInputBuilder {
   78     78   
        &self.inner
   79     79   
    }
   80     80   
    /// Sends the request and returns the response.
   81     81   
    ///
   82     82   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   83     83   
    /// can be matched against.
   84     84   
    ///
   85     85   
    /// By default, any retryable failures will be retried twice. Retry behavior
   86     86   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   87         -
    /// set when configuring the client.
          87  +
    /// set when configuring the client. Note: retries are enabled by default when using
          88  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   88     89   
    pub async fn send(
   89     90   
        self,
   90     91   
    ) -> ::std::result::Result<
   91     92   
        crate::operation::put_public_access_block::PutPublicAccessBlockOutput,
   92     93   
        ::aws_smithy_runtime_api::client::result::SdkError<
   93     94   
            crate::operation::put_public_access_block::PutPublicAccessBlockError,
   94     95   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   95     96   
        >,
   96     97   
    > {
   97     98   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/rename_object/builders.rs

@@ -61,61 +121,122 @@
   81     81   
    pub fn as_input(&self) -> &crate::operation::rename_object::builders::RenameObjectInputBuilder {
   82     82   
        &self.inner
   83     83   
    }
   84     84   
    /// Sends the request and returns the response.
   85     85   
    ///
   86     86   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   87     87   
    /// can be matched against.
   88     88   
    ///
   89     89   
    /// By default, any retryable failures will be retried twice. Retry behavior
   90     90   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   91         -
    /// set when configuring the client.
          91  +
    /// set when configuring the client. Note: retries are enabled by default when using
          92  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   92     93   
    pub async fn send(
   93     94   
        self,
   94     95   
    ) -> ::std::result::Result<
   95     96   
        crate::operation::rename_object::RenameObjectOutput,
   96     97   
        ::aws_smithy_runtime_api::client::result::SdkError<
   97     98   
            crate::operation::rename_object::RenameObjectError,
   98     99   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   99    100   
        >,
  100    101   
    > {
  101    102   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/restore_object/builders.rs

@@ -131,131 +191,192 @@
  151    151   
    pub fn as_input(&self) -> &crate::operation::restore_object::builders::RestoreObjectInputBuilder {
  152    152   
        &self.inner
  153    153   
    }
  154    154   
    /// Sends the request and returns the response.
  155    155   
    ///
  156    156   
    /// If an error occurs, an `SdkError` will be returned with additional details that
  157    157   
    /// can be matched against.
  158    158   
    ///
  159    159   
    /// By default, any retryable failures will be retried twice. Retry behavior
  160    160   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
  161         -
    /// set when configuring the client.
         161  +
    /// set when configuring the client. Note: retries are enabled by default when using
         162  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
  162    163   
    pub async fn send(
  163    164   
        self,
  164    165   
    ) -> ::std::result::Result<
  165    166   
        crate::operation::restore_object::RestoreObjectOutput,
  166    167   
        ::aws_smithy_runtime_api::client::result::SdkError<
  167    168   
            crate::operation::restore_object::RestoreObjectError,
  168    169   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  169    170   
        >,
  170    171   
    > {
  171    172   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/select_object_content/builders.rs

@@ -105,105 +165,166 @@
  125    125   
    pub fn as_input(&self) -> &crate::operation::select_object_content::builders::SelectObjectContentInputBuilder {
  126    126   
        &self.inner
  127    127   
    }
  128    128   
    /// Sends the request and returns the response.
  129    129   
    ///
  130    130   
    /// If an error occurs, an `SdkError` will be returned with additional details that
  131    131   
    /// can be matched against.
  132    132   
    ///
  133    133   
    /// By default, any retryable failures will be retried twice. Retry behavior
  134    134   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
  135         -
    /// set when configuring the client.
         135  +
    /// set when configuring the client. Note: retries are enabled by default when using
         136  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
  136    137   
    pub async fn send(
  137    138   
        self,
  138    139   
    ) -> ::std::result::Result<
  139    140   
        crate::operation::select_object_content::SelectObjectContentOutput,
  140    141   
        ::aws_smithy_runtime_api::client::result::SdkError<
  141    142   
            crate::operation::select_object_content::SelectObjectContentError,
  142    143   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  143    144   
        >,
  144    145   
    > {
  145    146   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/update_bucket_metadata_inventory_table_configuration/builders.rs

@@ -82,82 +142,143 @@
  102    102   
    {
  103    103   
        &self.inner
  104    104   
    }
  105    105   
    /// Sends the request and returns the response.
  106    106   
    ///
  107    107   
    /// If an error occurs, an `SdkError` will be returned with additional details that
  108    108   
    /// can be matched against.
  109    109   
    ///
  110    110   
    /// By default, any retryable failures will be retried twice. Retry behavior
  111    111   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
  112         -
    /// set when configuring the client.
         112  +
    /// set when configuring the client. Note: retries are enabled by default when using
         113  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
  113    114   
    pub async fn send(
  114    115   
        self,
  115    116   
    ) -> ::std::result::Result<
  116    117   
        crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationOutput,
  117    118   
        ::aws_smithy_runtime_api::client::result::SdkError<
  118    119   
            crate::operation::update_bucket_metadata_inventory_table_configuration::UpdateBucketMetadataInventoryTableConfigurationError,
  119    120   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  120    121   
        >,
  121    122   
    > {
  122    123   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/update_bucket_metadata_journal_table_configuration/builders.rs

@@ -62,62 +122,123 @@
   82     82   
    {
   83     83   
        &self.inner
   84     84   
    }
   85     85   
    /// Sends the request and returns the response.
   86     86   
    ///
   87     87   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   88     88   
    /// can be matched against.
   89     89   
    ///
   90     90   
    /// By default, any retryable failures will be retried twice. Retry behavior
   91     91   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   92         -
    /// set when configuring the client.
          92  +
    /// set when configuring the client. Note: retries are enabled by default when using
          93  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   93     94   
    pub async fn send(
   94     95   
        self,
   95     96   
    ) -> ::std::result::Result<
   96     97   
        crate::operation::update_bucket_metadata_journal_table_configuration::UpdateBucketMetadataJournalTableConfigurationOutput,
   97     98   
        ::aws_smithy_runtime_api::client::result::SdkError<
   98     99   
            crate::operation::update_bucket_metadata_journal_table_configuration::UpdateBucketMetadataJournalTableConfigurationError,
   99    100   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  100    101   
        >,
  101    102   
    > {
  102    103   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/upload_part/builders.rs

@@ -131,131 +191,192 @@
  151    151   
    pub fn as_input(&self) -> &crate::operation::upload_part::builders::UploadPartInputBuilder {
  152    152   
        &self.inner
  153    153   
    }
  154    154   
    /// Sends the request and returns the response.
  155    155   
    ///
  156    156   
    /// If an error occurs, an `SdkError` will be returned with additional details that
  157    157   
    /// can be matched against.
  158    158   
    ///
  159    159   
    /// By default, any retryable failures will be retried twice. Retry behavior
  160    160   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
  161         -
    /// set when configuring the client.
         161  +
    /// set when configuring the client. Note: retries are enabled by default when using
         162  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
  162    163   
    pub async fn send(
  163    164   
        self,
  164    165   
    ) -> ::std::result::Result<
  165    166   
        crate::operation::upload_part::UploadPartOutput,
  166    167   
        ::aws_smithy_runtime_api::client::result::SdkError<
  167    168   
            crate::operation::upload_part::UploadPartError,
  168    169   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  169    170   
        >,
  170    171   
    > {
  171    172   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/upload_part_copy/builders.rs

@@ -143,143 +203,204 @@
  163    163   
    pub fn as_input(&self) -> &crate::operation::upload_part_copy::builders::UploadPartCopyInputBuilder {
  164    164   
        &self.inner
  165    165   
    }
  166    166   
    /// Sends the request and returns the response.
  167    167   
    ///
  168    168   
    /// If an error occurs, an `SdkError` will be returned with additional details that
  169    169   
    /// can be matched against.
  170    170   
    ///
  171    171   
    /// By default, any retryable failures will be retried twice. Retry behavior
  172    172   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
  173         -
    /// set when configuring the client.
         173  +
    /// set when configuring the client. Note: retries are enabled by default when using
         174  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
  174    175   
    pub async fn send(
  175    176   
        self,
  176    177   
    ) -> ::std::result::Result<
  177    178   
        crate::operation::upload_part_copy::UploadPartCopyOutput,
  178    179   
        ::aws_smithy_runtime_api::client::result::SdkError<
  179    180   
            crate::operation::upload_part_copy::UploadPartCopyError,
  180    181   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
  181    182   
        >,
  182    183   
    > {
  183    184   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/src/operation/write_get_object_response/builders.rs

@@ -50,50 +110,111 @@
   70     70   
    pub fn as_input(&self) -> &crate::operation::write_get_object_response::builders::WriteGetObjectResponseInputBuilder {
   71     71   
        &self.inner
   72     72   
    }
   73     73   
    /// Sends the request and returns the response.
   74     74   
    ///
   75     75   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   76     76   
    /// can be matched against.
   77     77   
    ///
   78     78   
    /// By default, any retryable failures will be retried twice. Retry behavior
   79     79   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   80         -
    /// set when configuring the client.
          80  +
    /// set when configuring the client. Note: retries are enabled by default when using
          81  +
    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
   81     82   
    pub async fn send(
   82     83   
        self,
   83     84   
    ) -> ::std::result::Result<
   84     85   
        crate::operation::write_get_object_response::WriteGetObjectResponseOutput,
   85     86   
        ::aws_smithy_runtime_api::client::result::SdkError<
   86     87   
            crate::operation::write_get_object_response::WriteGetObjectResponseError,
   87     88   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   88     89   
        >,
   89     90   
    > {
   90     91   
        let input = self

tmp-codegen-diff/aws-sdk/sdk/s3/tests/client_construction.rs

@@ -11,11 +50,80 @@
   31     31   
    }
   32     32   
   33     33   
    #[test]
   34     34   
    fn bytestream_from_path_exists() {
   35     35   
        let _ = aws_sdk_s3::primitives::ByteStream::from_path("a/b.txt");
   36     36   
    }
   37     37   
}
   38     38   
   39     39   
mod with_service_config {
   40     40   
    use aws_sdk_s3 as s3;
          41  +
    use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
   41     42   
   42     43   
    #[test]
   43     44   
    fn manual_config_construction_all_defaults() {
   44     45   
        // When manually constructing `Config` with everything unset,
   45     46   
        // it should work since there will be no timeouts or retries enabled,
   46     47   
        // and thus, no sleep impl is required.
   47     48   
        let config = s3::Config::builder().build();
   48     49   
        let _s3 = s3::Client::from_conf(config);
   49     50   
    }
          51  +
          52  +
    #[test]
          53  +
    fn test_client_with_new_behavior_version_builds_successfully() {
          54  +
        // With v2025_01_17 and later, retries are enabled by default for AWS SDK clients
          55  +
        // This test verifies the client builds without panicking about missing sleep impl
          56  +
        let config = s3::Config::builder()
          57  +
            .behavior_version(BehaviorVersion::v2025_08_07())
          58  +
            .region(aws_types::region::Region::new("us-east-1"))
          59  +
            .credentials_provider(aws_credential_types::Credentials::for_tests())
          60  +
            .build();
          61  +
          62  +
        // Should build successfully even though retries are enabled
          63  +
        // (sleep impl is provided by default)
          64  +
        let _client = s3::Client::from_conf(config);
          65  +
    }
          66  +
          67  +
    #[test]
          68  +
    #[allow(deprecated)]
          69  +
    fn test_client_with_old_behavior_version_builds_successfully() {
          70  +
        // With v2024_03_28 (older than v2025_01_17), retries are disabled by default
          71  +
        let config = s3::Config::builder()
          72  +
            .behavior_version(BehaviorVersion::v2024_03_28())
          73  +
            .region(aws_types::region::Region::new("us-east-1"))
          74  +
            .credentials_provider(aws_credential_types::Credentials::for_tests())
          75  +
            .build();
          76  +
          77  +
        // Should build successfully with retries disabled (no sleep impl needed)
          78  +
        let _client = s3::Client::from_conf(config);
          79  +
    }
   50     80   
}

tmp-codegen-diff/aws-sdk/sdk/s3/tests/content-length-enforcement.rs

@@ -1,1 +106,111 @@
    1      1   
/*
    2      2   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    3      3   
 * SPDX-License-Identifier: Apache-2.0
    4      4   
 */
    5      5   
    6         -
use aws_sdk_s3::{config::Region, error::DisplayErrorContext, Client, Config};
           6  +
use aws_sdk_s3::{
           7  +
    config::retry::RetryConfig, config::Region, error::DisplayErrorContext, Client, Config,
           8  +
};
    7      9   
use aws_smithy_http_client::test_util::dvr::ReplayingClient;
    8     10   
    9     11   
#[tokio::test]
   10     12   
async fn test_content_length_enforcement_is_not_applied_to_head_request() {
   11     13   
    let http_client =
   12     14   
        ReplayingClient::from_file("tests/data/content-length-enforcement/head-object.json")
   13     15   
            .expect("recorded HTTP communication exists");
   14     16   
    let config = Config::builder()
   15     17   
        .with_test_defaults()
   16     18   
        .http_client(http_client.clone())
   17     19   
        .region(Region::new("us-east-1"))
          20  +
        .retry_config(RetryConfig::disabled()) // Disable retries for replay test
   18     21   
        .build();
   19     22   
    let client = Client::from_conf(config);
   20     23   
    let _resp = client
   21     24   
        .head_object()
   22     25   
        .key("dontcare.json")
   23     26   
        .bucket("dontcare")
   24     27   
        .send()
   25     28   
        .await
   26     29   
        .expect("content length enforcement must not apply to HEAD requests");
   27     30   
   28     31   
    // The body returned will be empty, so we pass an empty string for `media_type` to
   29     32   
    // `validate_body_and_headers_except`. That way, it'll do a string equality check on the empty
   30     33   
    // strings.
   31     34   
    http_client.relaxed_validate("").await.unwrap();
   32     35   
}
   33     36   
   34     37   
#[tokio::test]
   35     38   
async fn test_content_length_enforcement_get_request_short() {
   36     39   
    let http_client =
   37     40   
        ReplayingClient::from_file("tests/data/content-length-enforcement/get-object-short.json")
   38     41   
            .expect("recorded HTTP communication exists");
   39     42   
    let config = Config::builder()
   40     43   
        .with_test_defaults()
   41     44   
        .http_client(http_client.clone())
   42     45   
        .region(Region::new("us-east-1"))
          46  +
        .retry_config(RetryConfig::disabled()) // Disable retries for replay test
   43     47   
        .build();
   44     48   
    let client = Client::from_conf(config);
   45     49   
    // The file we're fetching is exactly 10,000 bytes long, but we've set the
   46     50   
    // response's content-length to 9,999 bytes. This should trigger the
   47     51   
    // content-length enforcement.
   48     52   
   49     53   
    // This will succeed.
   50     54   
    let output = client
   51     55   
        .get_object()
   52     56   
        .key("1000-lines.txt")
   53     57   
        .bucket("dontcare")
   54     58   
        .send()
   55     59   
        .await
   56     60   
        .unwrap();
   57     61   
   58     62   
    // This will fail with a content-length mismatch error.
   59     63   
    let content_length_err = output.body.collect().await.unwrap_err();
   60     64   
   61     65   
    http_client
   62     66   
        .relaxed_validate("application/text")
   63     67   
        .await
   64     68   
        .unwrap();
   65     69   
    assert_eq!(
   66     70   
        DisplayErrorContext(content_length_err).to_string(),
   67     71   
        "streaming error: Invalid Content-Length: Expected 9999 bytes but 10000 bytes were received (Error { kind: StreamingError(ContentLengthError { expected: 9999, received: 10000 }) })"
   68     72   
    );
   69     73   
}
   70     74   
   71     75   
#[tokio::test]
   72     76   
async fn test_content_length_enforcement_get_request_long() {
   73     77   
    let http_client =
   74     78   
        ReplayingClient::from_file("tests/data/content-length-enforcement/get-object-long.json")
   75     79   
            .expect("recorded HTTP communication exists");
   76     80   
    let config = Config::builder()
   77     81   
        .with_test_defaults()
   78     82   
        .http_client(http_client.clone())
   79     83   
        .region(Region::new("us-east-1"))
          84  +
        .retry_config(RetryConfig::disabled()) // Disable retries for replay test
   80     85   
        .build();
   81     86   
    let client = Client::from_conf(config);
   82     87   
    // The file we're fetching is exactly 10,000 bytes long, but we've set the
   83     88   
    // response's content-length to 9,999 bytes. This should trigger the
   84     89   
    // content-length enforcement.
   85     90   
   86     91   
    // This will succeed.
   87     92   
    let output = client
   88     93   
        .get_object()
   89     94   
        .key("1000-lines.txt")

tmp-codegen-diff/aws-sdk/sdk/s3/tests/request_id.rs

@@ -54,54 +113,114 @@
   74     74   
                  <Resource>/mybucket/myfoto.jpg</Resource>
   75     75   
                  <RequestId>incorrect-request-id</RequestId>
   76     76   
                </Error>"#,
   77     77   
            ))
   78     78   
            .unwrap(),
   79     79   
    ));
   80     80   
    let config = Config::builder()
   81     81   
        .http_client(http_client)
   82     82   
        .credentials_provider(Credentials::for_tests())
   83     83   
        .region(Region::new("us-east-1"))
          84  +
        .retry_config(aws_smithy_types::retry::RetryConfig::disabled())
   84     85   
        .build();
   85     86   
    let client = Client::from_conf(config);
   86     87   
    let err = client
   87     88   
        .get_object()
   88     89   
        .bucket("dontcare")
   89     90   
        .key("dontcare")
   90     91   
        .send()
   91     92   
        .await
   92     93   
        .expect_err("status 500")
   93     94   
        .into_service_error();