AWS SDK

AWS SDK

rev. ee474c7509d7728618c23068f3741e8e5b339ef9

Files changed:

tmp-codegen-diff/aws-sdk/sdk/sso/src/json_errors.rs

@@ -1,1 +45,45 @@
    5      5   
 */
    6      6   
    7      7   
use aws_smithy_json::deserialize::token::skip_value;
    8      8   
use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token};
    9      9   
use aws_smithy_runtime_api::http::Headers;
   10     10   
use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata};
   11     11   
use std::borrow::Cow;
   12     12   
   13     13   
// currently only used by AwsJson
   14     14   
#[allow(unused)]
   15         -
pub fn is_error<B>(response: &http::Response<B>) -> bool {
          15  +
pub fn is_error<B>(response: &http_1x::Response<B>) -> bool {
   16     16   
    !response.status().is_success()
   17     17   
}
   18     18   
   19     19   
fn sanitize_error_code(error_code: &str) -> &str {
   20     20   
    // Trim a trailing URL from the error code, which is done by removing the longest suffix
   21     21   
    // beginning with a `:`
   22     22   
    let error_code = match error_code.find(':') {
   23     23   
        Some(idx) => &error_code[..idx],
   24     24   
        None => error_code,
   25     25   
    };
@@ -60,60 +120,120 @@
   80     80   
#[cfg(test)]
   81     81   
mod test {
   82     82   
    use crate::json_errors::{parse_error_body, parse_error_metadata, sanitize_error_code};
   83     83   
    use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
   84     84   
    use aws_smithy_types::{body::SdkBody, error::ErrorMetadata};
   85     85   
    use std::borrow::Cow;
   86     86   
   87     87   
    #[test]
   88     88   
    fn error_metadata() {
   89     89   
        let response = HttpResponse::try_from(
   90         -
            http::Response::builder()
          90  +
            http_1x::Response::builder()
   91     91   
                .body(SdkBody::from(r#"{ "__type": "FooError", "message": "Go to foo" }"#))
   92     92   
                .unwrap(),
   93     93   
        )
   94     94   
        .unwrap();
   95     95   
        assert_eq!(
   96     96   
            parse_error_metadata(response.body().bytes().unwrap(), response.headers())
   97     97   
                .unwrap()
   98     98   
                .build(),
   99     99   
            ErrorMetadata::builder().code("FooError").message("Go to foo").build()
  100    100   
        )
@@ -129,129 +180,180 @@
  149    149   
  150    150   
    #[test]
  151    151   
    fn sanitize_namespace() {
  152    152   
        assert_eq!(sanitize_error_code("aws.protocoltests.restjson#FooError"), "FooError");
  153    153   
    }
  154    154   
  155    155   
    // services like lambda use an alternate `Message` instead of `message`
  156    156   
    #[test]
  157    157   
    fn alternative_error_message_names() {
  158    158   
        let response = HttpResponse::try_from(
  159         -
            http::Response::builder()
         159  +
            http_1x::Response::builder()
  160    160   
                .header("x-amzn-errortype", "ResourceNotFoundException")
  161    161   
                .body(SdkBody::from(
  162    162   
                    r#"{
  163    163   
                    "Type": "User",
  164    164   
                    "Message": "Functions from 'us-west-2' are not reachable from us-east-1"
  165    165   
                }"#,
  166    166   
                ))
  167    167   
                .unwrap(),
  168    168   
        )
  169    169   
        .unwrap();

tmp-codegen-diff/aws-sdk/sdk/sso/src/operation/get_role_credentials.rs

@@ -182,182 +250,250 @@
  202    202   
                        "account_id",
  203    203   
                        "cannot be empty or unset",
  204    204   
                    ));
  205    205   
                }
  206    206   
                query.push_kv("account_id", &::aws_smithy_http::query::fmt_string(inner_2));
  207    207   
                ::std::result::Result::Ok(())
  208    208   
            }
  209    209   
            #[allow(clippy::unnecessary_wraps)]
  210    210   
            fn update_http_builder(
  211    211   
                input: &crate::operation::get_role_credentials::GetRoleCredentialsInput,
  212         -
                builder: ::http::request::Builder,
  213         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         212  +
                builder: ::http_1x::request::Builder,
         213  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  214    214   
                let mut uri = ::std::string::String::new();
  215    215   
                uri_base(input, &mut uri)?;
  216    216   
                uri_query(input, &mut uri)?;
  217    217   
                let builder = crate::protocol_serde::shape_get_role_credentials::ser_get_role_credentials_headers(input, builder)?;
  218    218   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  219    219   
            }
  220         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         220  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  221    221   
            builder
  222    222   
        };
  223    223   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  224    224   
  225    225   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  226    226   
    }
  227    227   
}
  228    228   
#[derive(Debug)]
  229    229   
struct GetRoleCredentialsEndpointParamsInterceptor;
  230    230   

tmp-codegen-diff/aws-sdk/sdk/sso/src/operation/list_account_roles.rs

@@ -180,180 +248,248 @@
  200    200   
                        "account_id",
  201    201   
                        "cannot be empty or unset",
  202    202   
                    ));
  203    203   
                }
  204    204   
                query.push_kv("account_id", &::aws_smithy_http::query::fmt_string(inner_3));
  205    205   
                ::std::result::Result::Ok(())
  206    206   
            }
  207    207   
            #[allow(clippy::unnecessary_wraps)]
  208    208   
            fn update_http_builder(
  209    209   
                input: &crate::operation::list_account_roles::ListAccountRolesInput,
  210         -
                builder: ::http::request::Builder,
  211         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         210  +
                builder: ::http_1x::request::Builder,
         211  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  212    212   
                let mut uri = ::std::string::String::new();
  213    213   
                uri_base(input, &mut uri)?;
  214    214   
                uri_query(input, &mut uri)?;
  215    215   
                let builder = crate::protocol_serde::shape_list_account_roles::ser_list_account_roles_headers(input, builder)?;
  216    216   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  217    217   
            }
  218         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         218  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  219    219   
            builder
  220    220   
        };
  221    221   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  222    222   
  223    223   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  224    224   
    }
  225    225   
}
  226    226   
#[derive(Debug)]
  227    227   
struct ListAccountRolesEndpointParamsInterceptor;
  228    228   

tmp-codegen-diff/aws-sdk/sdk/sso/src/operation/list_accounts.rs

@@ -169,169 +237,237 @@
  189    189   
                if let ::std::option::Option::Some(inner_2) = &_input.max_results {
  190    190   
                    {
  191    191   
                        query.push_kv("max_result", ::aws_smithy_types::primitive::Encoder::from(*inner_2).encode());
  192    192   
                    }
  193    193   
                }
  194    194   
                ::std::result::Result::Ok(())
  195    195   
            }
  196    196   
            #[allow(clippy::unnecessary_wraps)]
  197    197   
            fn update_http_builder(
  198    198   
                input: &crate::operation::list_accounts::ListAccountsInput,
  199         -
                builder: ::http::request::Builder,
  200         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         199  +
                builder: ::http_1x::request::Builder,
         200  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  201    201   
                let mut uri = ::std::string::String::new();
  202    202   
                uri_base(input, &mut uri)?;
  203    203   
                uri_query(input, &mut uri)?;
  204    204   
                let builder = crate::protocol_serde::shape_list_accounts::ser_list_accounts_headers(input, builder)?;
  205    205   
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  206    206   
            }
  207         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         207  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  208    208   
            builder
  209    209   
        };
  210    210   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  211    211   
  212    212   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  213    213   
    }
  214    214   
}
  215    215   
#[derive(Debug)]
  216    216   
struct ListAccountsEndpointParamsInterceptor;
  217    217   

tmp-codegen-diff/aws-sdk/sdk/sso/src/operation/logout.rs

@@ -142,142 +209,209 @@
  162    162   
                _input: &crate::operation::logout::LogoutInput,
  163    163   
                output: &mut ::std::string::String,
  164    164   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  165    165   
                use ::std::fmt::Write as _;
  166    166   
                ::std::write!(output, "/logout").expect("formatting should succeed");
  167    167   
                ::std::result::Result::Ok(())
  168    168   
            }
  169    169   
            #[allow(clippy::unnecessary_wraps)]
  170    170   
            fn update_http_builder(
  171    171   
                input: &crate::operation::logout::LogoutInput,
  172         -
                builder: ::http::request::Builder,
  173         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         172  +
                builder: ::http_1x::request::Builder,
         173  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  174    174   
                let mut uri = ::std::string::String::new();
  175    175   
                uri_base(input, &mut uri)?;
  176    176   
                let builder = crate::protocol_serde::shape_logout::ser_logout_headers(input, builder)?;
  177    177   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  178    178   
            }
  179         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         179  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  180    180   
            builder
  181    181   
        };
  182    182   
        let body = ::aws_smithy_types::body::SdkBody::from("");
  183    183   
  184    184   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  185    185   
    }
  186    186   
}
  187    187   
#[derive(Debug)]
  188    188   
struct LogoutEndpointParamsInterceptor;
  189    189   

tmp-codegen-diff/aws-sdk/sdk/sso/src/protocol_serde/shape_get_role_credentials.rs

@@ -78,78 +143,143 @@
   98     98   
        let mut output = crate::operation::get_role_credentials::builders::GetRoleCredentialsOutputBuilder::default();
   99     99   
        output = crate::protocol_serde::shape_get_role_credentials::de_get_role_credentials(_response_body, output)
  100    100   
            .map_err(crate::operation::get_role_credentials::GetRoleCredentialsError::unhandled)?;
  101    101   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  102    102   
        output.build()
  103    103   
    })
  104    104   
}
  105    105   
  106    106   
pub fn ser_get_role_credentials_headers(
  107    107   
    input: &crate::operation::get_role_credentials::GetRoleCredentialsInput,
  108         -
    mut builder: ::http::request::Builder,
  109         -
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         108  +
    mut builder: ::http_1x::request::Builder,
         109  +
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  110    110   
    if let ::std::option::Option::Some(inner_1) = &input.access_token {
  111    111   
        let formatted_2 = inner_1.as_str();
  112    112   
        let header_value = formatted_2;
  113         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         113  +
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  114    114   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  115    115   
                "access_token",
  116    116   
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  117    117   
            )
  118    118   
        })?;
  119    119   
        builder = builder.header("x-amz-sso_bearer_token", header_value);
  120    120   
    }
  121    121   
    Ok(builder)
  122    122   
}
  123    123   

tmp-codegen-diff/aws-sdk/sdk/sso/src/protocol_serde/shape_list_account_roles.rs

@@ -72,72 +137,137 @@
   92     92   
        let mut output = crate::operation::list_account_roles::builders::ListAccountRolesOutputBuilder::default();
   93     93   
        output = crate::protocol_serde::shape_list_account_roles::de_list_account_roles(_response_body, output)
   94     94   
            .map_err(crate::operation::list_account_roles::ListAccountRolesError::unhandled)?;
   95     95   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   96     96   
        output.build()
   97     97   
    })
   98     98   
}
   99     99   
  100    100   
pub fn ser_list_account_roles_headers(
  101    101   
    input: &crate::operation::list_account_roles::ListAccountRolesInput,
  102         -
    mut builder: ::http::request::Builder,
  103         -
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         102  +
    mut builder: ::http_1x::request::Builder,
         103  +
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  104    104   
    if let ::std::option::Option::Some(inner_1) = &input.access_token {
  105    105   
        let formatted_2 = inner_1.as_str();
  106    106   
        let header_value = formatted_2;
  107         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         107  +
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  108    108   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  109    109   
                "access_token",
  110    110   
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  111    111   
            )
  112    112   
        })?;
  113    113   
        builder = builder.header("x-amz-sso_bearer_token", header_value);
  114    114   
    }
  115    115   
    Ok(builder)
  116    116   
}
  117    117   

tmp-codegen-diff/aws-sdk/sdk/sso/src/protocol_serde/shape_list_accounts.rs

@@ -72,72 +137,137 @@
   92     92   
        let mut output = crate::operation::list_accounts::builders::ListAccountsOutputBuilder::default();
   93     93   
        output = crate::protocol_serde::shape_list_accounts::de_list_accounts(_response_body, output)
   94     94   
            .map_err(crate::operation::list_accounts::ListAccountsError::unhandled)?;
   95     95   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   96     96   
        output.build()
   97     97   
    })
   98     98   
}
   99     99   
  100    100   
pub fn ser_list_accounts_headers(
  101    101   
    input: &crate::operation::list_accounts::ListAccountsInput,
  102         -
    mut builder: ::http::request::Builder,
  103         -
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         102  +
    mut builder: ::http_1x::request::Builder,
         103  +
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  104    104   
    if let ::std::option::Option::Some(inner_1) = &input.access_token {
  105    105   
        let formatted_2 = inner_1.as_str();
  106    106   
        let header_value = formatted_2;
  107         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         107  +
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  108    108   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  109    109   
                "access_token",
  110    110   
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  111    111   
            )
  112    112   
        })?;
  113    113   
        builder = builder.header("x-amz-sso_bearer_token", header_value);
  114    114   
    }
  115    115   
    Ok(builder)
  116    116   
}
  117    117   

tmp-codegen-diff/aws-sdk/sdk/sso/src/protocol_serde/shape_logout.rs

@@ -55,55 +99,99 @@
   75     75   
    Ok({
   76     76   
        #[allow(unused_mut)]
   77     77   
        let mut output = crate::operation::logout::builders::LogoutOutputBuilder::default();
   78     78   
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   79     79   
        output.build()
   80     80   
    })
   81     81   
}
   82     82   
   83     83   
pub fn ser_logout_headers(
   84     84   
    input: &crate::operation::logout::LogoutInput,
   85         -
    mut builder: ::http::request::Builder,
   86         -
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          85  +
    mut builder: ::http_1x::request::Builder,
          86  +
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   87     87   
    if let ::std::option::Option::Some(inner_1) = &input.access_token {
   88     88   
        let formatted_2 = inner_1.as_str();
   89     89   
        let header_value = formatted_2;
   90         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          90  +
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   91     91   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   92     92   
                "access_token",
   93     93   
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
   94     94   
            )
   95     95   
        })?;
   96     96   
        builder = builder.header("x-amz-sso_bearer_token", header_value);
   97     97   
    }
   98     98   
    Ok(builder)
   99     99   
}

tmp-codegen-diff/aws-sdk/sdk/sso/src/serialization_settings.rs

@@ -1,1 +78,83 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/*
    3      3   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
    4      4   
 * SPDX-License-Identifier: Apache-2.0
    5      5   
 */
    6      6   
    7      7   
#![allow(dead_code)]
    8      8   
    9      9   
use aws_smithy_http::header::set_request_header_if_absent;
   10     10   
use aws_smithy_types::config_bag::{Storable, StoreReplace};
   11         -
use http::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
          11  +
use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE};
   12     12   
   13     13   
/// Configuration for how default protocol headers are serialized
   14     14   
#[derive(Clone, Debug, Default)]
   15     15   
pub(crate) struct HeaderSerializationSettings {
   16     16   
    omit_default_content_length: bool,
   17     17   
    omit_default_content_type: bool,
   18     18   
}
   19     19   
   20     20   
impl HeaderSerializationSettings {
   21     21   
    /// Creates new [`HeaderSerializationSettings`]
   22     22   
    pub(crate) fn new() -> Self {
   23     23   
        Default::default()
   24     24   
    }
   25     25   
   26     26   
    /// Omit the default `Content-Length` header during serialization
   27     27   
    pub(crate) fn omit_default_content_length(self) -> Self {
   28     28   
        Self {
   29     29   
            omit_default_content_length: true,
   30     30   
            ..self
   31     31   
        }
   32     32   
    }
   33     33   
   34     34   
    /// Omit the default `Content-Type` header during serialization
   35     35   
    pub(crate) fn omit_default_content_type(self) -> Self {
   36     36   
        Self {
   37     37   
            omit_default_content_type: true,
   38     38   
            ..self
   39     39   
        }
   40     40   
    }
   41     41   
   42     42   
    /// Returns true if the given default header name should be serialized
   43     43   
    fn include_header(&self, header: &HeaderName) -> bool {
   44     44   
        (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE)
   45     45   
    }
   46     46   
   47     47   
    /// Sets a default header on the given request builder if it should be serialized
   48         -
    pub(crate) fn set_default_header(&self, mut request: http::request::Builder, header_name: HeaderName, value: &str) -> http::request::Builder {
          48  +
    pub(crate) fn set_default_header(
          49  +
        &self,
          50  +
        mut request: http_1x::request::Builder,
          51  +
        header_name: HeaderName,
          52  +
        value: &str,
          53  +
    ) -> http_1x::request::Builder {
   49     54   
        if self.include_header(&header_name) {
   50     55   
            request = set_request_header_if_absent(request, header_name, value);
   51     56   
        }
   52     57   
        request
   53     58   
    }
   54     59   
}
   55     60   
   56     61   
impl Storable for HeaderSerializationSettings {
   57     62   
    type Storer = StoreReplace<Self>;
   58     63   
}

tmp-codegen-diff/aws-sdk/sdk/ssooidc/Cargo.toml

@@ -1,1 +93,98 @@
   14     14   
protocol = "aws.protocols#restJson1"
   15     15   
[package.metadata.docs.rs]
   16     16   
all-features = true
   17     17   
targets = ["x86_64-unknown-linux-gnu"]
   18     18   
[dependencies.aws-credential-types]
   19     19   
path = "../aws-credential-types"
   20     20   
version = "1.2.11"
   21     21   
   22     22   
[dependencies.aws-runtime]
   23     23   
path = "../aws-runtime"
   24         -
version = "1.5.18"
          24  +
version = "1.6.0"
   25     25   
   26     26   
[dependencies.aws-smithy-async]
   27     27   
path = "../aws-smithy-async"
   28         -
version = "1.2.7"
          28  +
version = "1.2.8"
   29     29   
   30     30   
[dependencies.aws-smithy-http]
   31     31   
path = "../aws-smithy-http"
   32         -
version = "0.62.6"
          32  +
version = "0.63.0"
   33     33   
   34     34   
[dependencies.aws-smithy-json]
   35     35   
path = "../aws-smithy-json"
   36         -
version = "0.61.9"
          36  +
version = "0.62.0"
   37     37   
   38     38   
[dependencies.aws-smithy-observability]
   39     39   
path = "../aws-smithy-observability"
   40         -
version = "0.2.0"
          40  +
version = "0.2.1"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime]
   43     43   
path = "../aws-smithy-runtime"
   44     44   
features = ["client"]
   45         -
version = "1.9.8"
          45  +
version = "1.10.0"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49         -
features = ["client", "http-02x"]
   50         -
version = "1.10.0"
          49  +
features = ["client", "http-1x"]
          50  +
version = "1.11.0"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54         -
version = "1.3.6"
          54  +
features = ["http-body-1-x"]
          55  +
version = "1.4.0"
   55     56   
   56     57   
[dependencies.aws-types]
   57     58   
path = "../aws-types"
   58     59   
version = "1.3.11"
   59     60   
   60     61   
[dependencies.bytes]
   61     62   
version = "1.4.0"
   62     63   
   63     64   
[dependencies.fastrand]
   64     65   
version = "2.0.0"
   65     66   
   66     67   
[dependencies.http]
   67     68   
version = "0.2.9"
   68     69   
          70  +
[dependencies.http-1x]
          71  +
version = "1"
          72  +
package = "http"
          73  +
   69     74   
[dependencies.regex-lite]
   70     75   
version = "0.1.5"
   71     76   
   72     77   
[dependencies.tracing]
   73     78   
version = "0.1"
   74     79   
[dev-dependencies.aws-credential-types]
   75     80   
path = "../aws-credential-types"
   76     81   
features = ["test-util"]
   77     82   
version = "1.2.11"
   78     83   

tmp-codegen-diff/aws-sdk/sdk/ssooidc/src/json_errors.rs

@@ -1,1 +45,45 @@
    5      5   
 */
    6      6   
    7      7   
use aws_smithy_json::deserialize::token::skip_value;
    8      8   
use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token};
    9      9   
use aws_smithy_runtime_api::http::Headers;
   10     10   
use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata};
   11     11   
use std::borrow::Cow;
   12     12   
   13     13   
// currently only used by AwsJson
   14     14   
#[allow(unused)]
   15         -
pub fn is_error<B>(response: &http::Response<B>) -> bool {
          15  +
pub fn is_error<B>(response: &http_1x::Response<B>) -> bool {
   16     16   
    !response.status().is_success()
   17     17   
}
   18     18   
   19     19   
fn sanitize_error_code(error_code: &str) -> &str {
   20     20   
    // Trim a trailing URL from the error code, which is done by removing the longest suffix
   21     21   
    // beginning with a `:`
   22     22   
    let error_code = match error_code.find(':') {
   23     23   
        Some(idx) => &error_code[..idx],
   24     24   
        None => error_code,
   25     25   
    };
@@ -60,60 +120,120 @@
   80     80   
#[cfg(test)]
   81     81   
mod test {
   82     82   
    use crate::json_errors::{parse_error_body, parse_error_metadata, sanitize_error_code};
   83     83   
    use aws_smithy_runtime_api::client::orchestrator::HttpResponse;
   84     84   
    use aws_smithy_types::{body::SdkBody, error::ErrorMetadata};
   85     85   
    use std::borrow::Cow;
   86     86   
   87     87   
    #[test]
   88     88   
    fn error_metadata() {
   89     89   
        let response = HttpResponse::try_from(
   90         -
            http::Response::builder()
          90  +
            http_1x::Response::builder()
   91     91   
                .body(SdkBody::from(r#"{ "__type": "FooError", "message": "Go to foo" }"#))
   92     92   
                .unwrap(),
   93     93   
        )
   94     94   
        .unwrap();
   95     95   
        assert_eq!(
   96     96   
            parse_error_metadata(response.body().bytes().unwrap(), response.headers())
   97     97   
                .unwrap()
   98     98   
                .build(),
   99     99   
            ErrorMetadata::builder().code("FooError").message("Go to foo").build()
  100    100   
        )
@@ -129,129 +180,180 @@
  149    149   
  150    150   
    #[test]
  151    151   
    fn sanitize_namespace() {
  152    152   
        assert_eq!(sanitize_error_code("aws.protocoltests.restjson#FooError"), "FooError");
  153    153   
    }
  154    154   
  155    155   
    // services like lambda use an alternate `Message` instead of `message`
  156    156   
    #[test]
  157    157   
    fn alternative_error_message_names() {
  158    158   
        let response = HttpResponse::try_from(
  159         -
            http::Response::builder()
         159  +
            http_1x::Response::builder()
  160    160   
                .header("x-amzn-errortype", "ResourceNotFoundException")
  161    161   
                .body(SdkBody::from(
  162    162   
                    r#"{
  163    163   
                    "Type": "User",
  164    164   
                    "Message": "Functions from 'us-west-2' are not reachable from us-east-1"
  165    165   
                }"#,
  166    166   
                ))
  167    167   
                .unwrap(),
  168    168   
        )
  169    169   
        .unwrap();

tmp-codegen-diff/aws-sdk/sdk/ssooidc/src/operation/create_token.rs

@@ -153,153 +226,226 @@
  173    173   
                _input: &crate::operation::create_token::CreateTokenInput,
  174    174   
                output: &mut ::std::string::String,
  175    175   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  176    176   
                use ::std::fmt::Write as _;
  177    177   
                ::std::write!(output, "/token").expect("formatting should succeed");
  178    178   
                ::std::result::Result::Ok(())
  179    179   
            }
  180    180   
            #[allow(clippy::unnecessary_wraps)]
  181    181   
            fn update_http_builder(
  182    182   
                input: &crate::operation::create_token::CreateTokenInput,
  183         -
                builder: ::http::request::Builder,
  184         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         183  +
                builder: ::http_1x::request::Builder,
         184  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  185    185   
                let mut uri = ::std::string::String::new();
  186    186   
                uri_base(input, &mut uri)?;
  187    187   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  188    188   
            }
  189         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  190         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
         189  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         190  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  191    191   
            builder
  192    192   
        };
  193    193   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_token::ser_create_token_input(&input)?);
  194    194   
        if let Some(content_length) = body.content_length() {
  195    195   
            let content_length = content_length.to_string();
  196         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         196  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  197    197   
        }
  198    198   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  199    199   
    }
  200    200   
}
  201    201   
#[derive(Debug)]
  202    202   
struct CreateTokenEndpointParamsInterceptor;
  203    203   
  204    204   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateTokenEndpointParamsInterceptor {
  205    205   
    fn name(&self) -> &'static str {
  206    206   
        "CreateTokenEndpointParamsInterceptor"

tmp-codegen-diff/aws-sdk/sdk/ssooidc/src/operation/create_token_with_iam.rs

@@ -174,174 +250,250 @@
  194    194   
                _input: &crate::operation::create_token_with_iam::CreateTokenWithIamInput,
  195    195   
                mut output: &mut ::std::string::String,
  196    196   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  197    197   
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  198    198   
                query.push_kv("aws_iam", "t");
  199    199   
                ::std::result::Result::Ok(())
  200    200   
            }
  201    201   
            #[allow(clippy::unnecessary_wraps)]
  202    202   
            fn update_http_builder(
  203    203   
                input: &crate::operation::create_token_with_iam::CreateTokenWithIamInput,
  204         -
                builder: ::http::request::Builder,
  205         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         204  +
                builder: ::http_1x::request::Builder,
         205  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  206    206   
                let mut uri = ::std::string::String::new();
  207    207   
                uri_base(input, &mut uri)?;
  208    208   
                uri_query(input, &mut uri)?;
  209    209   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  210    210   
            }
  211         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  212         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
         211  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         212  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  213    213   
            builder
  214    214   
        };
  215    215   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_token_with_iam::ser_create_token_with_iam_input(
  216    216   
            &input,
  217    217   
        )?);
  218    218   
        if let Some(content_length) = body.content_length() {
  219    219   
            let content_length = content_length.to_string();
  220         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         220  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  221    221   
        }
  222    222   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  223    223   
    }
  224    224   
}
  225    225   
#[derive(Debug)]
  226    226   
struct CreateTokenWithIAMEndpointParamsInterceptor;
  227    227   
  228    228   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateTokenWithIAMEndpointParamsInterceptor {
  229    229   
    fn name(&self) -> &'static str {
  230    230   
        "CreateTokenWithIAMEndpointParamsInterceptor"

tmp-codegen-diff/aws-sdk/sdk/ssooidc/src/operation/register_client.rs

@@ -156,156 +229,229 @@
  176    176   
                _input: &crate::operation::register_client::RegisterClientInput,
  177    177   
                output: &mut ::std::string::String,
  178    178   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  179    179   
                use ::std::fmt::Write as _;
  180    180   
                ::std::write!(output, "/client/register").expect("formatting should succeed");
  181    181   
                ::std::result::Result::Ok(())
  182    182   
            }
  183    183   
            #[allow(clippy::unnecessary_wraps)]
  184    184   
            fn update_http_builder(
  185    185   
                input: &crate::operation::register_client::RegisterClientInput,
  186         -
                builder: ::http::request::Builder,
  187         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         186  +
                builder: ::http_1x::request::Builder,
         187  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  188    188   
                let mut uri = ::std::string::String::new();
  189    189   
                uri_base(input, &mut uri)?;
  190    190   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  191    191   
            }
  192         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  193         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
         192  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         193  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  194    194   
            builder
  195    195   
        };
  196    196   
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_register_client::ser_register_client_input(&input)?);
  197    197   
        if let Some(content_length) = body.content_length() {
  198    198   
            let content_length = content_length.to_string();
  199         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         199  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  200    200   
        }
  201    201   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  202    202   
    }
  203    203   
}
  204    204   
#[derive(Debug)]
  205    205   
struct RegisterClientEndpointParamsInterceptor;
  206    206   
  207    207   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RegisterClientEndpointParamsInterceptor {
  208    208   
    fn name(&self) -> &'static str {
  209    209   
        "RegisterClientEndpointParamsInterceptor"

tmp-codegen-diff/aws-sdk/sdk/ssooidc/src/operation/start_device_authorization.rs

@@ -155,155 +230,230 @@
  175    175   
                _input: &crate::operation::start_device_authorization::StartDeviceAuthorizationInput,
  176    176   
                output: &mut ::std::string::String,
  177    177   
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  178    178   
                use ::std::fmt::Write as _;
  179    179   
                ::std::write!(output, "/device_authorization").expect("formatting should succeed");
  180    180   
                ::std::result::Result::Ok(())
  181    181   
            }
  182    182   
            #[allow(clippy::unnecessary_wraps)]
  183    183   
            fn update_http_builder(
  184    184   
                input: &crate::operation::start_device_authorization::StartDeviceAuthorizationInput,
  185         -
                builder: ::http::request::Builder,
  186         -
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         185  +
                builder: ::http_1x::request::Builder,
         186  +
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  187    187   
                let mut uri = ::std::string::String::new();
  188    188   
                uri_base(input, &mut uri)?;
  189    189   
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  190    190   
            }
  191         -
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
  192         -
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
         191  +
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
         192  +
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  193    193   
            builder
  194    194   
        };
  195    195   
        let body = ::aws_smithy_types::body::SdkBody::from(
  196    196   
            crate::protocol_serde::shape_start_device_authorization::ser_start_device_authorization_input(&input)?,
  197    197   
        );
  198    198   
        if let Some(content_length) = body.content_length() {
  199    199   
            let content_length = content_length.to_string();
  200         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         200  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  201    201   
        }
  202    202   
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  203    203   
    }
  204    204   
}
  205    205   
#[derive(Debug)]
  206    206   
struct StartDeviceAuthorizationEndpointParamsInterceptor;
  207    207   
  208    208   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartDeviceAuthorizationEndpointParamsInterceptor {
  209    209   
    fn name(&self) -> &'static str {
  210    210   
        "StartDeviceAuthorizationEndpointParamsInterceptor"