AWS SDK

AWS SDK

rev. a25ccedd311e7562a03a1cd07d728cef10c9474c

Files changed:

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_create_bucket.rs

@@ -50,50 +168,184 @@
   70     70   
        output.build()
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
pub fn ser_create_bucket_headers(
   75     75   
    input: &crate::operation::create_bucket::CreateBucketInput,
   76     76   
    mut builder: ::http::request::Builder,
   77     77   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   78     78   
    if let ::std::option::Option::Some(inner_1) = &input.acl {
   79     79   
        let formatted_2 = inner_1.as_str();
   80         -
        let header_value = formatted_2;
   81         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   82         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   83         -
                "acl",
   84         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   85         -
            )
   86         -
        })?;
   87         -
        builder = builder.header("x-amz-acl", header_value);
          80  +
        if !formatted_2.is_empty() {
          81  +
            let header_value = formatted_2;
          82  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          83  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          84  +
                    "acl",
          85  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          86  +
                )
          87  +
            })?;
          88  +
            builder = builder.header("x-amz-acl", header_value);
          89  +
        }
   88     90   
    }
   89     91   
    if let ::std::option::Option::Some(inner_3) = &input.grant_full_control {
   90     92   
        let formatted_4 = inner_3.as_str();
   91         -
        let header_value = formatted_4;
   92         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   93         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   94         -
                "grant_full_control",
   95         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   96         -
            )
   97         -
        })?;
   98         -
        builder = builder.header("x-amz-grant-full-control", header_value);
          93  +
        if !formatted_4.is_empty() {
          94  +
            let header_value = formatted_4;
          95  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          96  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          97  +
                    "grant_full_control",
          98  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          99  +
                )
         100  +
            })?;
         101  +
            builder = builder.header("x-amz-grant-full-control", header_value);
         102  +
        }
   99    103   
    }
  100    104   
    if let ::std::option::Option::Some(inner_5) = &input.grant_read {
  101    105   
        let formatted_6 = inner_5.as_str();
  102         -
        let header_value = formatted_6;
  103         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  104         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  105         -
                "grant_read",
  106         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  107         -
            )
  108         -
        })?;
  109         -
        builder = builder.header("x-amz-grant-read", header_value);
         106  +
        if !formatted_6.is_empty() {
         107  +
            let header_value = formatted_6;
         108  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         109  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         110  +
                    "grant_read",
         111  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         112  +
                )
         113  +
            })?;
         114  +
            builder = builder.header("x-amz-grant-read", header_value);
         115  +
        }
  110    116   
    }
  111    117   
    if let ::std::option::Option::Some(inner_7) = &input.grant_read_acp {
  112    118   
        let formatted_8 = inner_7.as_str();
  113         -
        let header_value = formatted_8;
  114         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  115         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  116         -
                "grant_read_acp",
  117         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  118         -
            )
  119         -
        })?;
  120         -
        builder = builder.header("x-amz-grant-read-acp", header_value);
         119  +
        if !formatted_8.is_empty() {
         120  +
            let header_value = formatted_8;
         121  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         122  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         123  +
                    "grant_read_acp",
         124  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         125  +
                )
         126  +
            })?;
         127  +
            builder = builder.header("x-amz-grant-read-acp", header_value);
         128  +
        }
  121    129   
    }
  122    130   
    if let ::std::option::Option::Some(inner_9) = &input.grant_write {
  123    131   
        let formatted_10 = inner_9.as_str();
  124         -
        let header_value = formatted_10;
  125         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  126         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  127         -
                "grant_write",
  128         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  129         -
            )
  130         -
        })?;
  131         -
        builder = builder.header("x-amz-grant-write", header_value);
         132  +
        if !formatted_10.is_empty() {
         133  +
            let header_value = formatted_10;
         134  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         135  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         136  +
                    "grant_write",
         137  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         138  +
                )
         139  +
            })?;
         140  +
            builder = builder.header("x-amz-grant-write", header_value);
         141  +
        }
  132    142   
    }
  133    143   
    if let ::std::option::Option::Some(inner_11) = &input.grant_write_acp {
  134    144   
        let formatted_12 = inner_11.as_str();
  135         -
        let header_value = formatted_12;
  136         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  137         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  138         -
                "grant_write_acp",
  139         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  140         -
            )
  141         -
        })?;
  142         -
        builder = builder.header("x-amz-grant-write-acp", header_value);
         145  +
        if !formatted_12.is_empty() {
         146  +
            let header_value = formatted_12;
         147  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         148  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         149  +
                    "grant_write_acp",
         150  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         151  +
                )
         152  +
            })?;
         153  +
            builder = builder.header("x-amz-grant-write-acp", header_value);
         154  +
        }
  143    155   
    }
  144    156   
    if let ::std::option::Option::Some(inner_13) = &input.object_lock_enabled_for_bucket {
  145    157   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_13);
  146    158   
        let formatted_14 = encoder.encode();
  147         -
        let header_value = formatted_14;
  148         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  149         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  150         -
                "object_lock_enabled_for_bucket",
  151         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  152         -
            )
  153         -
        })?;
  154         -
        builder = builder.header("x-amz-bucket-object-lock-enabled", header_value);
         159  +
        if !formatted_14.is_empty() {
         160  +
            let header_value = formatted_14;
         161  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         162  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         163  +
                    "object_lock_enabled_for_bucket",
         164  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         165  +
                )
         166  +
            })?;
         167  +
            builder = builder.header("x-amz-bucket-object-lock-enabled", header_value);
         168  +
        }
  155    169   
    }
  156    170   
    if let ::std::option::Option::Some(inner_15) = &input.object_ownership {
  157    171   
        let formatted_16 = inner_15.as_str();
  158         -
        let header_value = formatted_16;
  159         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  160         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  161         -
                "object_ownership",
  162         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  163         -
            )
  164         -
        })?;
  165         -
        builder = builder.header("x-amz-object-ownership", header_value);
         172  +
        if !formatted_16.is_empty() {
         173  +
            let header_value = formatted_16;
         174  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         175  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         176  +
                    "object_ownership",
         177  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         178  +
                )
         179  +
            })?;
         180  +
            builder = builder.header("x-amz-object-ownership", header_value);
         181  +
        }
  166    182   
    }
  167    183   
    Ok(builder)
  168    184   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_create_multipart_upload.rs

@@ -86,86 +440,494 @@
  106    106   
        output.build()
  107    107   
    })
  108    108   
}
  109    109   
  110    110   
pub fn ser_create_multipart_upload_headers(
  111    111   
    input: &crate::operation::create_multipart_upload::CreateMultipartUploadInput,
  112    112   
    mut builder: ::http::request::Builder,
  113    113   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  114    114   
    if let ::std::option::Option::Some(inner_1) = &input.acl {
  115    115   
        let formatted_2 = inner_1.as_str();
  116         -
        let header_value = formatted_2;
  117         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  118         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  119         -
                "acl",
  120         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  121         -
            )
  122         -
        })?;
  123         -
        builder = builder.header("x-amz-acl", header_value);
         116  +
        if !formatted_2.is_empty() {
         117  +
            let header_value = formatted_2;
         118  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         119  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         120  +
                    "acl",
         121  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         122  +
                )
         123  +
            })?;
         124  +
            builder = builder.header("x-amz-acl", header_value);
         125  +
        }
  124    126   
    }
  125    127   
    if let ::std::option::Option::Some(inner_3) = &input.cache_control {
  126    128   
        let formatted_4 = inner_3.as_str();
  127         -
        let header_value = formatted_4;
  128         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  129         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  130         -
                "cache_control",
  131         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  132         -
            )
  133         -
        })?;
  134         -
        builder = builder.header("Cache-Control", header_value);
         129  +
        if !formatted_4.is_empty() {
         130  +
            let header_value = formatted_4;
         131  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         132  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         133  +
                    "cache_control",
         134  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         135  +
                )
         136  +
            })?;
         137  +
            builder = builder.header("Cache-Control", header_value);
         138  +
        }
  135    139   
    }
  136    140   
    if let ::std::option::Option::Some(inner_5) = &input.content_disposition {
  137    141   
        let formatted_6 = inner_5.as_str();
  138         -
        let header_value = formatted_6;
  139         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  140         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  141         -
                "content_disposition",
  142         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  143         -
            )
  144         -
        })?;
  145         -
        builder = builder.header("Content-Disposition", header_value);
         142  +
        if !formatted_6.is_empty() {
         143  +
            let header_value = formatted_6;
         144  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         145  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         146  +
                    "content_disposition",
         147  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         148  +
                )
         149  +
            })?;
         150  +
            builder = builder.header("Content-Disposition", header_value);
         151  +
        }
  146    152   
    }
  147    153   
    if let ::std::option::Option::Some(inner_7) = &input.content_encoding {
  148    154   
        let formatted_8 = inner_7.as_str();
  149         -
        let header_value = formatted_8;
  150         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  151         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  152         -
                "content_encoding",
  153         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  154         -
            )
  155         -
        })?;
  156         -
        builder = builder.header("Content-Encoding", header_value);
         155  +
        if !formatted_8.is_empty() {
         156  +
            let header_value = formatted_8;
         157  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         158  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         159  +
                    "content_encoding",
         160  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         161  +
                )
         162  +
            })?;
         163  +
            builder = builder.header("Content-Encoding", header_value);
         164  +
        }
  157    165   
    }
  158    166   
    if let ::std::option::Option::Some(inner_9) = &input.content_language {
  159    167   
        let formatted_10 = inner_9.as_str();
  160         -
        let header_value = formatted_10;
  161         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  162         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  163         -
                "content_language",
  164         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  165         -
            )
  166         -
        })?;
  167         -
        builder = builder.header("Content-Language", header_value);
         168  +
        if !formatted_10.is_empty() {
         169  +
            let header_value = formatted_10;
         170  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         171  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         172  +
                    "content_language",
         173  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         174  +
                )
         175  +
            })?;
         176  +
            builder = builder.header("Content-Language", header_value);
         177  +
        }
  168    178   
    }
  169    179   
    if let ::std::option::Option::Some(inner_11) = &input.content_type {
  170    180   
        let formatted_12 = inner_11.as_str();
  171         -
        let header_value = formatted_12;
  172         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  173         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  174         -
                "content_type",
  175         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  176         -
            )
  177         -
        })?;
  178         -
        builder = builder.header("Content-Type", header_value);
         181  +
        if !formatted_12.is_empty() {
         182  +
            let header_value = formatted_12;
         183  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         184  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         185  +
                    "content_type",
         186  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         187  +
                )
         188  +
            })?;
         189  +
            builder = builder.header("Content-Type", header_value);
         190  +
        }
  179    191   
    }
  180    192   
    if let ::std::option::Option::Some(inner_13) = &input.expires {
  181    193   
        let formatted_14 = inner_13.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  182         -
        let header_value = formatted_14;
  183         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  184         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  185         -
                "expires",
  186         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  187         -
            )
  188         -
        })?;
  189         -
        builder = builder.header("Expires", header_value);
         194  +
        if !formatted_14.is_empty() {
         195  +
            let header_value = formatted_14;
         196  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         197  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         198  +
                    "expires",
         199  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         200  +
                )
         201  +
            })?;
         202  +
            builder = builder.header("Expires", header_value);
         203  +
        }
  190    204   
    }
  191    205   
    if let ::std::option::Option::Some(inner_15) = &input.grant_full_control {
  192    206   
        let formatted_16 = inner_15.as_str();
  193         -
        let header_value = formatted_16;
  194         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  195         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  196         -
                "grant_full_control",
  197         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  198         -
            )
  199         -
        })?;
  200         -
        builder = builder.header("x-amz-grant-full-control", header_value);
         207  +
        if !formatted_16.is_empty() {
         208  +
            let header_value = formatted_16;
         209  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         210  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         211  +
                    "grant_full_control",
         212  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         213  +
                )
         214  +
            })?;
         215  +
            builder = builder.header("x-amz-grant-full-control", header_value);
         216  +
        }
  201    217   
    }
  202    218   
    if let ::std::option::Option::Some(inner_17) = &input.grant_read {
  203    219   
        let formatted_18 = inner_17.as_str();
  204         -
        let header_value = formatted_18;
  205         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  206         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  207         -
                "grant_read",
  208         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  209         -
            )
  210         -
        })?;
  211         -
        builder = builder.header("x-amz-grant-read", header_value);
         220  +
        if !formatted_18.is_empty() {
         221  +
            let header_value = formatted_18;
         222  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         223  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         224  +
                    "grant_read",
         225  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         226  +
                )
         227  +
            })?;
         228  +
            builder = builder.header("x-amz-grant-read", header_value);
         229  +
        }
  212    230   
    }
  213    231   
    if let ::std::option::Option::Some(inner_19) = &input.grant_read_acp {
  214    232   
        let formatted_20 = inner_19.as_str();
  215         -
        let header_value = formatted_20;
  216         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  217         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  218         -
                "grant_read_acp",
  219         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  220         -
            )
  221         -
        })?;
  222         -
        builder = builder.header("x-amz-grant-read-acp", header_value);
         233  +
        if !formatted_20.is_empty() {
         234  +
            let header_value = formatted_20;
         235  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         236  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         237  +
                    "grant_read_acp",
         238  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         239  +
                )
         240  +
            })?;
         241  +
            builder = builder.header("x-amz-grant-read-acp", header_value);
         242  +
        }
  223    243   
    }
  224    244   
    if let ::std::option::Option::Some(inner_21) = &input.grant_write_acp {
  225    245   
        let formatted_22 = inner_21.as_str();
  226         -
        let header_value = formatted_22;
  227         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  228         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  229         -
                "grant_write_acp",
  230         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  231         -
            )
  232         -
        })?;
  233         -
        builder = builder.header("x-amz-grant-write-acp", header_value);
         246  +
        if !formatted_22.is_empty() {
         247  +
            let header_value = formatted_22;
         248  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         249  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         250  +
                    "grant_write_acp",
         251  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         252  +
                )
         253  +
            })?;
         254  +
            builder = builder.header("x-amz-grant-write-acp", header_value);
         255  +
        }
  234    256   
    }
  235    257   
    if let ::std::option::Option::Some(inner_23) = &input.server_side_encryption {
  236    258   
        let formatted_24 = inner_23.as_str();
  237         -
        let header_value = formatted_24;
  238         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  239         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  240         -
                "server_side_encryption",
  241         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  242         -
            )
  243         -
        })?;
  244         -
        builder = builder.header("x-amz-server-side-encryption", header_value);
         259  +
        if !formatted_24.is_empty() {
         260  +
            let header_value = formatted_24;
         261  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         262  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         263  +
                    "server_side_encryption",
         264  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         265  +
                )
         266  +
            })?;
         267  +
            builder = builder.header("x-amz-server-side-encryption", header_value);
         268  +
        }
  245    269   
    }
  246    270   
    if let ::std::option::Option::Some(inner_25) = &input.storage_class {
  247    271   
        let formatted_26 = inner_25.as_str();
  248         -
        let header_value = formatted_26;
  249         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  250         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  251         -
                "storage_class",
  252         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  253         -
            )
  254         -
        })?;
  255         -
        builder = builder.header("x-amz-storage-class", header_value);
         272  +
        if !formatted_26.is_empty() {
         273  +
            let header_value = formatted_26;
         274  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         275  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         276  +
                    "storage_class",
         277  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         278  +
                )
         279  +
            })?;
         280  +
            builder = builder.header("x-amz-storage-class", header_value);
         281  +
        }
  256    282   
    }
  257    283   
    if let ::std::option::Option::Some(inner_27) = &input.website_redirect_location {
  258    284   
        let formatted_28 = inner_27.as_str();
  259         -
        let header_value = formatted_28;
  260         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  261         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  262         -
                "website_redirect_location",
  263         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  264         -
            )
  265         -
        })?;
  266         -
        builder = builder.header("x-amz-website-redirect-location", header_value);
         285  +
        if !formatted_28.is_empty() {
         286  +
            let header_value = formatted_28;
         287  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         288  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         289  +
                    "website_redirect_location",
         290  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         291  +
                )
         292  +
            })?;
         293  +
            builder = builder.header("x-amz-website-redirect-location", header_value);
         294  +
        }
  267    295   
    }
  268    296   
    if let ::std::option::Option::Some(inner_29) = &input.sse_customer_algorithm {
  269    297   
        let formatted_30 = inner_29.as_str();
  270         -
        let header_value = formatted_30;
  271         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  272         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  273         -
                "sse_customer_algorithm",
  274         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  275         -
            )
  276         -
        })?;
  277         -
        builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         298  +
        if !formatted_30.is_empty() {
         299  +
            let header_value = formatted_30;
         300  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         301  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         302  +
                    "sse_customer_algorithm",
         303  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         304  +
                )
         305  +
            })?;
         306  +
            builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         307  +
        }
  278    308   
    }
  279    309   
    if let ::std::option::Option::Some(inner_31) = &input.sse_customer_key {
  280    310   
        let formatted_32 = inner_31.as_str();
  281         -
        let header_value = formatted_32;
  282         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  283         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  284         -
                "sse_customer_key",
  285         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  286         -
            )
  287         -
        })?;
  288         -
        builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         311  +
        if !formatted_32.is_empty() {
         312  +
            let header_value = formatted_32;
         313  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         314  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         315  +
                    "sse_customer_key",
         316  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         317  +
                )
         318  +
            })?;
         319  +
            builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         320  +
        }
  289    321   
    }
  290    322   
    if let ::std::option::Option::Some(inner_33) = &input.sse_customer_key_md5 {
  291    323   
        let formatted_34 = inner_33.as_str();
  292         -
        let header_value = formatted_34;
  293         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  294         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  295         -
                "sse_customer_key_md5",
  296         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  297         -
            )
  298         -
        })?;
  299         -
        builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         324  +
        if !formatted_34.is_empty() {
         325  +
            let header_value = formatted_34;
         326  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         327  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         328  +
                    "sse_customer_key_md5",
         329  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         330  +
                )
         331  +
            })?;
         332  +
            builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         333  +
        }
  300    334   
    }
  301    335   
    if let ::std::option::Option::Some(inner_35) = &input.ssekms_key_id {
  302    336   
        let formatted_36 = inner_35.as_str();
  303         -
        let header_value = formatted_36;
  304         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  305         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  306         -
                "ssekms_key_id",
  307         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  308         -
            )
  309         -
        })?;
  310         -
        builder = builder.header("x-amz-server-side-encryption-aws-kms-key-id", header_value);
         337  +
        if !formatted_36.is_empty() {
         338  +
            let header_value = formatted_36;
         339  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         340  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         341  +
                    "ssekms_key_id",
         342  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         343  +
                )
         344  +
            })?;
         345  +
            builder = builder.header("x-amz-server-side-encryption-aws-kms-key-id", header_value);
         346  +
        }
  311    347   
    }
  312    348   
    if let ::std::option::Option::Some(inner_37) = &input.ssekms_encryption_context {
  313    349   
        let formatted_38 = inner_37.as_str();
  314         -
        let header_value = formatted_38;
  315         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  316         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  317         -
                "ssekms_encryption_context",
  318         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  319         -
            )
  320         -
        })?;
  321         -
        builder = builder.header("x-amz-server-side-encryption-context", header_value);
         350  +
        if !formatted_38.is_empty() {
         351  +
            let header_value = formatted_38;
         352  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         353  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         354  +
                    "ssekms_encryption_context",
         355  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         356  +
                )
         357  +
            })?;
         358  +
            builder = builder.header("x-amz-server-side-encryption-context", header_value);
         359  +
        }
  322    360   
    }
  323    361   
    if let ::std::option::Option::Some(inner_39) = &input.bucket_key_enabled {
  324    362   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_39);
  325    363   
        let formatted_40 = encoder.encode();
  326         -
        let header_value = formatted_40;
  327         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  328         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  329         -
                "bucket_key_enabled",
  330         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  331         -
            )
  332         -
        })?;
  333         -
        builder = builder.header("x-amz-server-side-encryption-bucket-key-enabled", header_value);
         364  +
        if !formatted_40.is_empty() {
         365  +
            let header_value = formatted_40;
         366  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         367  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         368  +
                    "bucket_key_enabled",
         369  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         370  +
                )
         371  +
            })?;
         372  +
            builder = builder.header("x-amz-server-side-encryption-bucket-key-enabled", header_value);
         373  +
        }
  334    374   
    }
  335    375   
    if let ::std::option::Option::Some(inner_41) = &input.request_payer {
  336    376   
        let formatted_42 = inner_41.as_str();
  337         -
        let header_value = formatted_42;
  338         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  339         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  340         -
                "request_payer",
  341         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  342         -
            )
  343         -
        })?;
  344         -
        builder = builder.header("x-amz-request-payer", header_value);
         377  +
        if !formatted_42.is_empty() {
         378  +
            let header_value = formatted_42;
         379  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         380  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         381  +
                    "request_payer",
         382  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         383  +
                )
         384  +
            })?;
         385  +
            builder = builder.header("x-amz-request-payer", header_value);
         386  +
        }
  345    387   
    }
  346    388   
    if let ::std::option::Option::Some(inner_43) = &input.tagging {
  347    389   
        let formatted_44 = inner_43.as_str();
  348         -
        let header_value = formatted_44;
  349         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  350         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  351         -
                "tagging",
  352         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  353         -
            )
  354         -
        })?;
  355         -
        builder = builder.header("x-amz-tagging", header_value);
         390  +
        if !formatted_44.is_empty() {
         391  +
            let header_value = formatted_44;
         392  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         393  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         394  +
                    "tagging",
         395  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         396  +
                )
         397  +
            })?;
         398  +
            builder = builder.header("x-amz-tagging", header_value);
         399  +
        }
  356    400   
    }
  357    401   
    if let ::std::option::Option::Some(inner_45) = &input.object_lock_mode {
  358    402   
        let formatted_46 = inner_45.as_str();
  359         -
        let header_value = formatted_46;
  360         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  361         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  362         -
                "object_lock_mode",
  363         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  364         -
            )
  365         -
        })?;
  366         -
        builder = builder.header("x-amz-object-lock-mode", header_value);
         403  +
        if !formatted_46.is_empty() {
         404  +
            let header_value = formatted_46;
         405  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         406  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         407  +
                    "object_lock_mode",
         408  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         409  +
                )
         410  +
            })?;
         411  +
            builder = builder.header("x-amz-object-lock-mode", header_value);
         412  +
        }
  367    413   
    }
  368    414   
    if let ::std::option::Option::Some(inner_47) = &input.object_lock_retain_until_date {
  369    415   
        let formatted_48 = inner_47.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
  370         -
        let header_value = formatted_48;
  371         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  372         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  373         -
                "object_lock_retain_until_date",
  374         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  375         -
            )
  376         -
        })?;
  377         -
        builder = builder.header("x-amz-object-lock-retain-until-date", header_value);
         416  +
        if !formatted_48.is_empty() {
         417  +
            let header_value = formatted_48;
         418  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         419  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         420  +
                    "object_lock_retain_until_date",
         421  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         422  +
                )
         423  +
            })?;
         424  +
            builder = builder.header("x-amz-object-lock-retain-until-date", header_value);
         425  +
        }
  378    426   
    }
  379    427   
    if let ::std::option::Option::Some(inner_49) = &input.object_lock_legal_hold_status {
  380    428   
        let formatted_50 = inner_49.as_str();
  381         -
        let header_value = formatted_50;
  382         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  383         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  384         -
                "object_lock_legal_hold_status",
  385         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  386         -
            )
  387         -
        })?;
  388         -
        builder = builder.header("x-amz-object-lock-legal-hold", header_value);
         429  +
        if !formatted_50.is_empty() {
         430  +
            let header_value = formatted_50;
         431  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         432  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         433  +
                    "object_lock_legal_hold_status",
         434  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         435  +
                )
         436  +
            })?;
         437  +
            builder = builder.header("x-amz-object-lock-legal-hold", header_value);
         438  +
        }
  389    439   
    }
  390    440   
    if let ::std::option::Option::Some(inner_51) = &input.expected_bucket_owner {
  391    441   
        let formatted_52 = inner_51.as_str();
  392         -
        let header_value = formatted_52;
  393         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  394         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  395         -
                "expected_bucket_owner",
  396         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  397         -
            )
  398         -
        })?;
  399         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         442  +
        if !formatted_52.is_empty() {
         443  +
            let header_value = formatted_52;
         444  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         445  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         446  +
                    "expected_bucket_owner",
         447  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         448  +
                )
         449  +
            })?;
         450  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         451  +
        }
  400    452   
    }
  401    453   
    if let ::std::option::Option::Some(inner_53) = &input.checksum_algorithm {
  402    454   
        let formatted_54 = inner_53.as_str();
  403         -
        let header_value = formatted_54;
  404         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  405         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  406         -
                "checksum_algorithm",
  407         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  408         -
            )
  409         -
        })?;
  410         -
        builder = builder.header("x-amz-checksum-algorithm", header_value);
         455  +
        if !formatted_54.is_empty() {
         456  +
            let header_value = formatted_54;
         457  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         458  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         459  +
                    "checksum_algorithm",
         460  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         461  +
                )
         462  +
            })?;
         463  +
            builder = builder.header("x-amz-checksum-algorithm", header_value);
         464  +
        }
  411    465   
    }
  412    466   
    if let ::std::option::Option::Some(inner_55) = &input.metadata {
  413    467   
        {
  414    468   
            for (k, v) in inner_55 {
  415    469   
                use std::str::FromStr;
  416    470   
                let header_name = http::header::HeaderName::from_str(&format!("{}{}", "x-amz-meta-", &k)).map_err(|err| {
  417    471   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  418    472   
                        "metadata",
  419    473   
                        format!("`{k}` cannot be used as a header name: {err}"),
  420    474   
                    )

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_create_session.rs

@@ -33,33 +100,102 @@
   53     53   
        crate::serde_util::create_session_output_output_correct_errors(output).build()
   54     54   
    })
   55     55   
}
   56     56   
   57     57   
pub fn ser_create_session_headers(
   58     58   
    input: &crate::operation::create_session::CreateSessionInput,
   59     59   
    mut builder: ::http::request::Builder,
   60     60   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   61     61   
    if let ::std::option::Option::Some(inner_1) = &input.session_mode {
   62     62   
        let formatted_2 = inner_1.as_str();
   63         -
        let header_value = formatted_2;
   64         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   65         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   66         -
                "session_mode",
   67         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   68         -
            )
   69         -
        })?;
   70         -
        builder = builder.header("x-amz-create-session-mode", header_value);
          63  +
        if !formatted_2.is_empty() {
          64  +
            let header_value = formatted_2;
          65  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          66  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          67  +
                    "session_mode",
          68  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          69  +
                )
          70  +
            })?;
          71  +
            builder = builder.header("x-amz-create-session-mode", header_value);
          72  +
        }
   71     73   
    }
   72     74   
    Ok(builder)
   73     75   
}
   74     76   
   75     77   
#[allow(unused_mut)]
   76     78   
pub fn de_create_session(
   77     79   
    inp: &[u8],
   78     80   
    mut builder: crate::operation::create_session::builders::CreateSessionOutputBuilder,
   79     81   
) -> Result<crate::operation::create_session::builders::CreateSessionOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
   80     82   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket.rs

@@ -8,8 +48,50 @@
   28     28   
        output.build()
   29     29   
    })
   30     30   
}
   31     31   
   32     32   
pub fn ser_delete_bucket_headers(
   33     33   
    input: &crate::operation::delete_bucket::DeleteBucketInput,
   34     34   
    mut builder: ::http::request::Builder,
   35     35   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   36     36   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   37     37   
        let formatted_2 = inner_1.as_str();
   38         -
        let header_value = formatted_2;
   39         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   40         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   41         -
                "expected_bucket_owner",
   42         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   43         -
            )
   44         -
        })?;
   45         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          38  +
        if !formatted_2.is_empty() {
          39  +
            let header_value = formatted_2;
          40  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          41  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          42  +
                    "expected_bucket_owner",
          43  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          44  +
                )
          45  +
            })?;
          46  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          47  +
        }
   46     48   
    }
   47     49   
    Ok(builder)
   48     50   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_analytics_configuration.rs

@@ -15,15 +55,57 @@
   35     35   
        output.build()
   36     36   
    })
   37     37   
}
   38     38   
   39     39   
pub fn ser_delete_bucket_analytics_configuration_headers(
   40     40   
    input: &crate::operation::delete_bucket_analytics_configuration::DeleteBucketAnalyticsConfigurationInput,
   41     41   
    mut builder: ::http::request::Builder,
   42     42   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   43     43   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   44     44   
        let formatted_2 = inner_1.as_str();
   45         -
        let header_value = formatted_2;
   46         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   47         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   48         -
                "expected_bucket_owner",
   49         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   50         -
            )
   51         -
        })?;
   52         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          45  +
        if !formatted_2.is_empty() {
          46  +
            let header_value = formatted_2;
          47  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          48  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          49  +
                    "expected_bucket_owner",
          50  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          51  +
                )
          52  +
            })?;
          53  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          54  +
        }
   53     55   
    }
   54     56   
    Ok(builder)
   55     57   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_cors.rs

@@ -8,8 +48,50 @@
   28     28   
        output.build()
   29     29   
    })
   30     30   
}
   31     31   
   32     32   
pub fn ser_delete_bucket_cors_headers(
   33     33   
    input: &crate::operation::delete_bucket_cors::DeleteBucketCorsInput,
   34     34   
    mut builder: ::http::request::Builder,
   35     35   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   36     36   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   37     37   
        let formatted_2 = inner_1.as_str();
   38         -
        let header_value = formatted_2;
   39         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   40         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   41         -
                "expected_bucket_owner",
   42         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   43         -
            )
   44         -
        })?;
   45         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          38  +
        if !formatted_2.is_empty() {
          39  +
            let header_value = formatted_2;
          40  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          41  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          42  +
                    "expected_bucket_owner",
          43  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          44  +
                )
          45  +
            })?;
          46  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          47  +
        }
   46     48   
    }
   47     49   
    Ok(builder)
   48     50   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_encryption.rs

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_delete_bucket_encryption_headers(
   39     39   
    input: &crate::operation::delete_bucket_encryption::DeleteBucketEncryptionInput,
   40     40   
    mut builder: ::http::request::Builder,
   41     41   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   42     42   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   43     43   
        let formatted_2 = inner_1.as_str();
   44         -
        let header_value = formatted_2;
   45         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   46         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   47         -
                "expected_bucket_owner",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          44  +
        if !formatted_2.is_empty() {
          45  +
            let header_value = formatted_2;
          46  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          47  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          48  +
                    "expected_bucket_owner",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    Ok(builder)
   54     56   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_inventory_configuration.rs

@@ -15,15 +55,57 @@
   35     35   
        output.build()
   36     36   
    })
   37     37   
}
   38     38   
   39     39   
pub fn ser_delete_bucket_inventory_configuration_headers(
   40     40   
    input: &crate::operation::delete_bucket_inventory_configuration::DeleteBucketInventoryConfigurationInput,
   41     41   
    mut builder: ::http::request::Builder,
   42     42   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   43     43   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   44     44   
        let formatted_2 = inner_1.as_str();
   45         -
        let header_value = formatted_2;
   46         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   47         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   48         -
                "expected_bucket_owner",
   49         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   50         -
            )
   51         -
        })?;
   52         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          45  +
        if !formatted_2.is_empty() {
          46  +
            let header_value = formatted_2;
          47  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          48  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          49  +
                    "expected_bucket_owner",
          50  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          51  +
                )
          52  +
            })?;
          53  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          54  +
        }
   53     55   
    }
   54     56   
    Ok(builder)
   55     57   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_lifecycle.rs

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_delete_bucket_lifecycle_headers(
   39     39   
    input: &crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleInput,
   40     40   
    mut builder: ::http::request::Builder,
   41     41   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   42     42   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   43     43   
        let formatted_2 = inner_1.as_str();
   44         -
        let header_value = formatted_2;
   45         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   46         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   47         -
                "expected_bucket_owner",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          44  +
        if !formatted_2.is_empty() {
          45  +
            let header_value = formatted_2;
          46  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          47  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          48  +
                    "expected_bucket_owner",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    Ok(builder)
   54     56   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_metrics_configuration.rs

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_delete_bucket_metrics_configuration_headers(
   39     39   
    input: &crate::operation::delete_bucket_metrics_configuration::DeleteBucketMetricsConfigurationInput,
   40     40   
    mut builder: ::http::request::Builder,
   41     41   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   42     42   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   43     43   
        let formatted_2 = inner_1.as_str();
   44         -
        let header_value = formatted_2;
   45         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   46         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   47         -
                "expected_bucket_owner",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          44  +
        if !formatted_2.is_empty() {
          45  +
            let header_value = formatted_2;
          46  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          47  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          48  +
                    "expected_bucket_owner",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    Ok(builder)
   54     56   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_ownership_controls.rs

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_delete_bucket_ownership_controls_headers(
   39     39   
    input: &crate::operation::delete_bucket_ownership_controls::DeleteBucketOwnershipControlsInput,
   40     40   
    mut builder: ::http::request::Builder,
   41     41   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   42     42   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   43     43   
        let formatted_2 = inner_1.as_str();
   44         -
        let header_value = formatted_2;
   45         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   46         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   47         -
                "expected_bucket_owner",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          44  +
        if !formatted_2.is_empty() {
          45  +
            let header_value = formatted_2;
          46  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          47  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          48  +
                    "expected_bucket_owner",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    Ok(builder)
   54     56   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_policy.rs

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_delete_bucket_policy_headers(
   39     39   
    input: &crate::operation::delete_bucket_policy::DeleteBucketPolicyInput,
   40     40   
    mut builder: ::http::request::Builder,
   41     41   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   42     42   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   43     43   
        let formatted_2 = inner_1.as_str();
   44         -
        let header_value = formatted_2;
   45         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   46         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   47         -
                "expected_bucket_owner",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          44  +
        if !formatted_2.is_empty() {
          45  +
            let header_value = formatted_2;
          46  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          47  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          48  +
                    "expected_bucket_owner",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    Ok(builder)
   54     56   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_replication.rs

@@ -16,16 +56,58 @@
   36     36   
        output.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
pub fn ser_delete_bucket_replication_headers(
   41     41   
    input: &crate::operation::delete_bucket_replication::DeleteBucketReplicationInput,
   42     42   
    mut builder: ::http::request::Builder,
   43     43   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   44     44   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   45     45   
        let formatted_2 = inner_1.as_str();
   46         -
        let header_value = formatted_2;
   47         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   48         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   49         -
                "expected_bucket_owner",
   50         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   51         -
            )
   52         -
        })?;
   53         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          46  +
        if !formatted_2.is_empty() {
          47  +
            let header_value = formatted_2;
          48  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          49  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          50  +
                    "expected_bucket_owner",
          51  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          52  +
                )
          53  +
            })?;
          54  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          55  +
        }
   54     56   
    }
   55     57   
    Ok(builder)
   56     58   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_tagging.rs

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_delete_bucket_tagging_headers(
   39     39   
    input: &crate::operation::delete_bucket_tagging::DeleteBucketTaggingInput,
   40     40   
    mut builder: ::http::request::Builder,
   41     41   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   42     42   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   43     43   
        let formatted_2 = inner_1.as_str();
   44         -
        let header_value = formatted_2;
   45         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   46         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   47         -
                "expected_bucket_owner",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          44  +
        if !formatted_2.is_empty() {
          45  +
            let header_value = formatted_2;
          46  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          47  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          48  +
                    "expected_bucket_owner",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    Ok(builder)
   54     56   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_bucket_website.rs

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_delete_bucket_website_headers(
   39     39   
    input: &crate::operation::delete_bucket_website::DeleteBucketWebsiteInput,
   40     40   
    mut builder: ::http::request::Builder,
   41     41   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   42     42   
    if let ::std::option::Option::Some(inner_1) = &input.expected_bucket_owner {
   43     43   
        let formatted_2 = inner_1.as_str();
   44         -
        let header_value = formatted_2;
   45         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   46         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   47         -
                "expected_bucket_owner",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          44  +
        if !formatted_2.is_empty() {
          45  +
            let header_value = formatted_2;
          46  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          47  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          48  +
                    "expected_bucket_owner",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    Ok(builder)
   54     56   
}

tmp-codegen-diff/aws-sdk/sdk/s3/src/protocol_serde/shape_delete_object.rs

@@ -23,23 +97,105 @@
   43     43   
        output.build()
   44     44   
    })
   45     45   
}
   46     46   
   47     47   
pub fn ser_delete_object_headers(
   48     48   
    input: &crate::operation::delete_object::DeleteObjectInput,
   49     49   
    mut builder: ::http::request::Builder,
   50     50   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   51     51   
    if let ::std::option::Option::Some(inner_1) = &input.mfa {
   52     52   
        let formatted_2 = inner_1.as_str();
   53         -
        let header_value = formatted_2;
   54         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   55         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   56         -
                "mfa",
   57         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   58         -
            )
   59         -
        })?;
   60         -
        builder = builder.header("x-amz-mfa", header_value);
          53  +
        if !formatted_2.is_empty() {
          54  +
            let header_value = formatted_2;
          55  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          56  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          57  +
                    "mfa",
          58  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          59  +
                )
          60  +
            })?;
          61  +
            builder = builder.header("x-amz-mfa", header_value);
          62  +
        }
   61     63   
    }
   62     64   
    if let ::std::option::Option::Some(inner_3) = &input.request_payer {
   63     65   
        let formatted_4 = inner_3.as_str();
   64         -
        let header_value = formatted_4;
   65         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   66         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   67         -
                "request_payer",
   68         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   69         -
            )
   70         -
        })?;
   71         -
        builder = builder.header("x-amz-request-payer", header_value);
          66  +
        if !formatted_4.is_empty() {
          67  +
            let header_value = formatted_4;
          68  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          69  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          70  +
                    "request_payer",
          71  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          72  +
                )
          73  +
            })?;
          74  +
            builder = builder.header("x-amz-request-payer", header_value);
          75  +
        }
   72     76   
    }
   73     77   
    if let ::std::option::Option::Some(inner_5) = &input.bypass_governance_retention {
   74     78   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
   75     79   
        let formatted_6 = encoder.encode();
   76         -
        let header_value = formatted_6;
   77         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   78         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   79         -
                "bypass_governance_retention",
   80         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   81         -
            )
   82         -
        })?;
   83         -
        builder = builder.header("x-amz-bypass-governance-retention", header_value);
          80  +
        if !formatted_6.is_empty() {
          81  +
            let header_value = formatted_6;
          82  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          83  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          84  +
                    "bypass_governance_retention",
          85  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          86  +
                )
          87  +
            })?;
          88  +
            builder = builder.header("x-amz-bypass-governance-retention", header_value);
          89  +
        }
   84     90   
    }
   85     91   
    if let ::std::option::Option::Some(inner_7) = &input.expected_bucket_owner {
   86     92   
        let formatted_8 = inner_7.as_str();
   87         -
        let header_value = formatted_8;
   88         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   89         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   90         -
                "expected_bucket_owner",
   91         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   92         -
            )
   93         -
        })?;
   94         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          93  +
        if !formatted_8.is_empty() {
          94  +
            let header_value = formatted_8;
          95  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          96  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          97  +
                    "expected_bucket_owner",
          98  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          99  +
                )
         100  +
            })?;
         101  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         102  +
        }
   95    103   
    }
   96    104   
    Ok(builder)
   97    105   
}