AWS SDK

AWS SDK

rev. 000b37a512bd3be1a17b4f3d5bf60e5446dbc2dd

Files changed:

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

@@ -211,211 +361,383 @@
  231    231   
        output.build()
  232    232   
    })
  233    233   
}
  234    234   
  235    235   
pub fn ser_head_object_headers(
  236    236   
    input: &crate::operation::head_object::HeadObjectInput,
  237    237   
    mut builder: ::http::request::Builder,
  238    238   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  239    239   
    if let ::std::option::Option::Some(inner_1) = &input.if_match {
  240    240   
        let formatted_2 = inner_1.as_str();
  241         -
        let header_value = formatted_2;
  242         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  243         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  244         -
                "if_match",
  245         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  246         -
            )
  247         -
        })?;
  248         -
        builder = builder.header("If-Match", header_value);
         241  +
        if !formatted_2.is_empty() {
         242  +
            let header_value = formatted_2;
         243  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         244  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         245  +
                    "if_match",
         246  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         247  +
                )
         248  +
            })?;
         249  +
            builder = builder.header("If-Match", header_value);
         250  +
        }
  249    251   
    }
  250    252   
    if let ::std::option::Option::Some(inner_3) = &input.if_modified_since {
  251    253   
        let formatted_4 = inner_3.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  252         -
        let header_value = formatted_4;
  253         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  254         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  255         -
                "if_modified_since",
  256         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  257         -
            )
  258         -
        })?;
  259         -
        builder = builder.header("If-Modified-Since", header_value);
         254  +
        if !formatted_4.is_empty() {
         255  +
            let header_value = formatted_4;
         256  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         257  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         258  +
                    "if_modified_since",
         259  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         260  +
                )
         261  +
            })?;
         262  +
            builder = builder.header("If-Modified-Since", header_value);
         263  +
        }
  260    264   
    }
  261    265   
    if let ::std::option::Option::Some(inner_5) = &input.if_none_match {
  262    266   
        let formatted_6 = inner_5.as_str();
  263         -
        let header_value = formatted_6;
  264         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  265         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  266         -
                "if_none_match",
  267         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  268         -
            )
  269         -
        })?;
  270         -
        builder = builder.header("If-None-Match", header_value);
         267  +
        if !formatted_6.is_empty() {
         268  +
            let header_value = formatted_6;
         269  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         270  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         271  +
                    "if_none_match",
         272  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         273  +
                )
         274  +
            })?;
         275  +
            builder = builder.header("If-None-Match", header_value);
         276  +
        }
  271    277   
    }
  272    278   
    if let ::std::option::Option::Some(inner_7) = &input.if_unmodified_since {
  273    279   
        let formatted_8 = inner_7.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  274         -
        let header_value = formatted_8;
  275         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  276         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  277         -
                "if_unmodified_since",
  278         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  279         -
            )
  280         -
        })?;
  281         -
        builder = builder.header("If-Unmodified-Since", header_value);
         280  +
        if !formatted_8.is_empty() {
         281  +
            let header_value = formatted_8;
         282  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         283  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         284  +
                    "if_unmodified_since",
         285  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         286  +
                )
         287  +
            })?;
         288  +
            builder = builder.header("If-Unmodified-Since", header_value);
         289  +
        }
  282    290   
    }
  283    291   
    if let ::std::option::Option::Some(inner_9) = &input.range {
  284    292   
        let formatted_10 = inner_9.as_str();
  285         -
        let header_value = formatted_10;
  286         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  287         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  288         -
                "range",
  289         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  290         -
            )
  291         -
        })?;
  292         -
        builder = builder.header("Range", header_value);
         293  +
        if !formatted_10.is_empty() {
         294  +
            let header_value = formatted_10;
         295  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         296  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         297  +
                    "range",
         298  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         299  +
                )
         300  +
            })?;
         301  +
            builder = builder.header("Range", header_value);
         302  +
        }
  293    303   
    }
  294    304   
    if let ::std::option::Option::Some(inner_11) = &input.sse_customer_algorithm {
  295    305   
        let formatted_12 = inner_11.as_str();
  296         -
        let header_value = formatted_12;
  297         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  298         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  299         -
                "sse_customer_algorithm",
  300         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  301         -
            )
  302         -
        })?;
  303         -
        builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         306  +
        if !formatted_12.is_empty() {
         307  +
            let header_value = formatted_12;
         308  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         309  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         310  +
                    "sse_customer_algorithm",
         311  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         312  +
                )
         313  +
            })?;
         314  +
            builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         315  +
        }
  304    316   
    }
  305    317   
    if let ::std::option::Option::Some(inner_13) = &input.sse_customer_key {
  306    318   
        let formatted_14 = inner_13.as_str();
  307         -
        let header_value = formatted_14;
  308         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  309         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  310         -
                "sse_customer_key",
  311         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  312         -
            )
  313         -
        })?;
  314         -
        builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         319  +
        if !formatted_14.is_empty() {
         320  +
            let header_value = formatted_14;
         321  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         322  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         323  +
                    "sse_customer_key",
         324  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         325  +
                )
         326  +
            })?;
         327  +
            builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         328  +
        }
  315    329   
    }
  316    330   
    if let ::std::option::Option::Some(inner_15) = &input.sse_customer_key_md5 {
  317    331   
        let formatted_16 = inner_15.as_str();
  318         -
        let header_value = formatted_16;
  319         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  320         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  321         -
                "sse_customer_key_md5",
  322         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  323         -
            )
  324         -
        })?;
  325         -
        builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         332  +
        if !formatted_16.is_empty() {
         333  +
            let header_value = formatted_16;
         334  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         335  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         336  +
                    "sse_customer_key_md5",
         337  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         338  +
                )
         339  +
            })?;
         340  +
            builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         341  +
        }
  326    342   
    }
  327    343   
    if let ::std::option::Option::Some(inner_17) = &input.request_payer {
  328    344   
        let formatted_18 = inner_17.as_str();
  329         -
        let header_value = formatted_18;
  330         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  331         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  332         -
                "request_payer",
  333         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  334         -
            )
  335         -
        })?;
  336         -
        builder = builder.header("x-amz-request-payer", header_value);
         345  +
        if !formatted_18.is_empty() {
         346  +
            let header_value = formatted_18;
         347  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         348  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         349  +
                    "request_payer",
         350  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         351  +
                )
         352  +
            })?;
         353  +
            builder = builder.header("x-amz-request-payer", header_value);
         354  +
        }
  337    355   
    }
  338    356   
    if let ::std::option::Option::Some(inner_19) = &input.expected_bucket_owner {
  339    357   
        let formatted_20 = inner_19.as_str();
  340         -
        let header_value = formatted_20;
  341         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  342         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  343         -
                "expected_bucket_owner",
  344         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  345         -
            )
  346         -
        })?;
  347         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         358  +
        if !formatted_20.is_empty() {
         359  +
            let header_value = formatted_20;
         360  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         361  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         362  +
                    "expected_bucket_owner",
         363  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         364  +
                )
         365  +
            })?;
         366  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         367  +
        }
  348    368   
    }
  349    369   
    if let ::std::option::Option::Some(inner_21) = &input.checksum_mode {
  350    370   
        let formatted_22 = inner_21.as_str();
  351         -
        let header_value = formatted_22;
  352         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  353         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  354         -
                "checksum_mode",
  355         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  356         -
            )
  357         -
        })?;
  358         -
        builder = builder.header("x-amz-checksum-mode", header_value);
         371  +
        if !formatted_22.is_empty() {
         372  +
            let header_value = formatted_22;
         373  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         374  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         375  +
                    "checksum_mode",
         376  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         377  +
                )
         378  +
            })?;
         379  +
            builder = builder.header("x-amz-checksum-mode", header_value);
         380  +
        }
  359    381   
    }
  360    382   
    Ok(builder)
  361    383   
}

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

@@ -16,16 +83,85 @@
   36     36   
        output.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
pub fn ser_list_bucket_analytics_configurations_headers(
   41     41   
    input: &crate::operation::list_bucket_analytics_configurations::ListBucketAnalyticsConfigurationsInput,
   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   
}
   57     59   
   58     60   
#[allow(unused_mut)]
   59     61   
pub fn de_list_bucket_analytics_configurations(
   60     62   
    inp: &[u8],
   61     63   
    mut builder: crate::operation::list_bucket_analytics_configurations::builders::ListBucketAnalyticsConfigurationsOutputBuilder,
   62     64   
) -> Result<
   63     65   
    crate::operation::list_bucket_analytics_configurations::builders::ListBucketAnalyticsConfigurationsOutputBuilder,

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

@@ -16,16 +83,85 @@
   36     36   
        output.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
pub fn ser_list_bucket_inventory_configurations_headers(
   41     41   
    input: &crate::operation::list_bucket_inventory_configurations::ListBucketInventoryConfigurationsInput,
   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   
}
   57     59   
   58     60   
#[allow(unused_mut)]
   59     61   
pub fn de_list_bucket_inventory_configurations(
   60     62   
    inp: &[u8],
   61     63   
    mut builder: crate::operation::list_bucket_inventory_configurations::builders::ListBucketInventoryConfigurationsOutputBuilder,
   62     64   
) -> Result<
   63     65   
    crate::operation::list_bucket_inventory_configurations::builders::ListBucketInventoryConfigurationsOutputBuilder,

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

@@ -16,16 +83,85 @@
   36     36   
        output.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
pub fn ser_list_bucket_metrics_configurations_headers(
   41     41   
    input: &crate::operation::list_bucket_metrics_configurations::ListBucketMetricsConfigurationsInput,
   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   
}
   57     59   
   58     60   
#[allow(unused_mut)]
   59     61   
pub fn de_list_bucket_metrics_configurations(
   60     62   
    inp: &[u8],
   61     63   
    mut builder: crate::operation::list_bucket_metrics_configurations::builders::ListBucketMetricsConfigurationsOutputBuilder,
   62     64   
) -> Result<
   63     65   
    crate::operation::list_bucket_metrics_configurations::builders::ListBucketMetricsConfigurationsOutputBuilder,

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

@@ -23,23 +101,105 @@
   43     43   
        output.build()
   44     44   
    })
   45     45   
}
   46     46   
   47     47   
pub fn ser_list_multipart_uploads_headers(
   48     48   
    input: &crate::operation::list_multipart_uploads::ListMultipartUploadsInput,
   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.expected_bucket_owner {
   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         -
                "expected_bucket_owner",
   57         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   58         -
            )
   59         -
        })?;
   60         -
        builder = builder.header("x-amz-expected-bucket-owner", 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  +
                    "expected_bucket_owner",
          58  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          59  +
                )
          60  +
            })?;
          61  +
            builder = builder.header("x-amz-expected-bucket-owner", 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   
    Ok(builder)
   74     78   
}
   75     79   
   76     80   
#[allow(unused_mut)]
   77     81   
pub fn de_list_multipart_uploads(
   78     82   
    inp: &[u8],
   79     83   
    mut builder: crate::operation::list_multipart_uploads::builders::ListMultipartUploadsOutputBuilder,
   80     84   
) -> Result<crate::operation::list_multipart_uploads::builders::ListMultipartUploadsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
   81     85   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;

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

@@ -23,23 +109,110 @@
   43     43   
        output.build()
   44     44   
    })
   45     45   
}
   46     46   
   47     47   
pub fn ser_list_object_versions_headers(
   48     48   
    input: &crate::operation::list_object_versions::ListObjectVersionsInput,
   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.expected_bucket_owner {
   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         -
                "expected_bucket_owner",
   57         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   58         -
            )
   59         -
        })?;
   60         -
        builder = builder.header("x-amz-expected-bucket-owner", 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  +
                    "expected_bucket_owner",
          58  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          59  +
                )
          60  +
            })?;
          61  +
            builder = builder.header("x-amz-expected-bucket-owner", 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.optional_object_attributes {
   74         -
        // Empty vec in header is serialized as an empty string
   75         -
        if inner_5.is_empty() {
   76         -
            builder = builder.header("x-amz-optional-object-attributes", "");
   77         -
        } else {
   78         -
            for inner_6 in inner_5 {
   79         -
                let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
          78  +
        for inner_6 in inner_5 {
          79  +
            let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
          80  +
            if !formatted_7.is_empty() {
   80     81   
                let header_value = formatted_7;
   81     82   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   82     83   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   83     84   
                        "optional_object_attributes",
   84     85   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
   85     86   
                    )
   86     87   
                })?;
   87     88   
                builder = builder.header("x-amz-optional-object-attributes", header_value);
   88     89   
            }
   89     90   
        }

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

@@ -38,38 +124,125 @@
   58     58   
        output.build()
   59     59   
    })
   60     60   
}
   61     61   
   62     62   
pub fn ser_list_objects_headers(
   63     63   
    input: &crate::operation::list_objects::ListObjectsInput,
   64     64   
    mut builder: ::http::request::Builder,
   65     65   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   66     66   
    if let ::std::option::Option::Some(inner_1) = &input.request_payer {
   67     67   
        let formatted_2 = inner_1.as_str();
   68         -
        let header_value = formatted_2;
   69         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   70         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   71         -
                "request_payer",
   72         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   73         -
            )
   74         -
        })?;
   75         -
        builder = builder.header("x-amz-request-payer", header_value);
          68  +
        if !formatted_2.is_empty() {
          69  +
            let header_value = formatted_2;
          70  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          71  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          72  +
                    "request_payer",
          73  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          74  +
                )
          75  +
            })?;
          76  +
            builder = builder.header("x-amz-request-payer", header_value);
          77  +
        }
   76     78   
    }
   77     79   
    if let ::std::option::Option::Some(inner_3) = &input.expected_bucket_owner {
   78     80   
        let formatted_4 = inner_3.as_str();
   79         -
        let header_value = formatted_4;
   80         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   81         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   82         -
                "expected_bucket_owner",
   83         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   84         -
            )
   85         -
        })?;
   86         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          81  +
        if !formatted_4.is_empty() {
          82  +
            let header_value = formatted_4;
          83  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          84  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          85  +
                    "expected_bucket_owner",
          86  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          87  +
                )
          88  +
            })?;
          89  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          90  +
        }
   87     91   
    }
   88     92   
    if let ::std::option::Option::Some(inner_5) = &input.optional_object_attributes {
   89         -
        // Empty vec in header is serialized as an empty string
   90         -
        if inner_5.is_empty() {
   91         -
            builder = builder.header("x-amz-optional-object-attributes", "");
   92         -
        } else {
   93         -
            for inner_6 in inner_5 {
   94         -
                let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
          93  +
        for inner_6 in inner_5 {
          94  +
            let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
          95  +
            if !formatted_7.is_empty() {
   95     96   
                let header_value = formatted_7;
   96     97   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   97     98   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   98     99   
                        "optional_object_attributes",
   99    100   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  100    101   
                    )
  101    102   
                })?;
  102    103   
                builder = builder.header("x-amz-optional-object-attributes", header_value);
  103    104   
            }
  104    105   
        }

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

@@ -38,38 +124,125 @@
   58     58   
        output.build()
   59     59   
    })
   60     60   
}
   61     61   
   62     62   
pub fn ser_list_objects_v2_headers(
   63     63   
    input: &crate::operation::list_objects_v2::ListObjectsV2Input,
   64     64   
    mut builder: ::http::request::Builder,
   65     65   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   66     66   
    if let ::std::option::Option::Some(inner_1) = &input.request_payer {
   67     67   
        let formatted_2 = inner_1.as_str();
   68         -
        let header_value = formatted_2;
   69         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   70         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   71         -
                "request_payer",
   72         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   73         -
            )
   74         -
        })?;
   75         -
        builder = builder.header("x-amz-request-payer", header_value);
          68  +
        if !formatted_2.is_empty() {
          69  +
            let header_value = formatted_2;
          70  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          71  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          72  +
                    "request_payer",
          73  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          74  +
                )
          75  +
            })?;
          76  +
            builder = builder.header("x-amz-request-payer", header_value);
          77  +
        }
   76     78   
    }
   77     79   
    if let ::std::option::Option::Some(inner_3) = &input.expected_bucket_owner {
   78     80   
        let formatted_4 = inner_3.as_str();
   79         -
        let header_value = formatted_4;
   80         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   81         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   82         -
                "expected_bucket_owner",
   83         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   84         -
            )
   85         -
        })?;
   86         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          81  +
        if !formatted_4.is_empty() {
          82  +
            let header_value = formatted_4;
          83  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          84  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          85  +
                    "expected_bucket_owner",
          86  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          87  +
                )
          88  +
            })?;
          89  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          90  +
        }
   87     91   
    }
   88     92   
    if let ::std::option::Option::Some(inner_5) = &input.optional_object_attributes {
   89         -
        // Empty vec in header is serialized as an empty string
   90         -
        if inner_5.is_empty() {
   91         -
            builder = builder.header("x-amz-optional-object-attributes", "");
   92         -
        } else {
   93         -
            for inner_6 in inner_5 {
   94         -
                let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
          93  +
        for inner_6 in inner_5 {
          94  +
            let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
          95  +
            if !formatted_7.is_empty() {
   95     96   
                let header_value = formatted_7;
   96     97   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   97     98   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   98     99   
                        "optional_object_attributes",
   99    100   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  100    101   
                    )
  101    102   
                })?;
  102    103   
                builder = builder.header("x-amz-optional-object-attributes", header_value);
  103    104   
            }
  104    105   
        }

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

@@ -24,24 +135,145 @@
   44     44   
        output.build()
   45     45   
    })
   46     46   
}
   47     47   
   48     48   
pub fn ser_list_parts_headers(
   49     49   
    input: &crate::operation::list_parts::ListPartsInput,
   50     50   
    mut builder: ::http::request::Builder,
   51     51   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   52     52   
    if let ::std::option::Option::Some(inner_1) = &input.request_payer {
   53     53   
        let formatted_2 = inner_1.as_str();
   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         -
                "request_payer",
   58         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   59         -
            )
   60         -
        })?;
   61         -
        builder = builder.header("x-amz-request-payer", header_value);
          54  +
        if !formatted_2.is_empty() {
          55  +
            let header_value = formatted_2;
          56  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          57  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          58  +
                    "request_payer",
          59  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          60  +
                )
          61  +
            })?;
          62  +
            builder = builder.header("x-amz-request-payer", header_value);
          63  +
        }
   62     64   
    }
   63     65   
    if let ::std::option::Option::Some(inner_3) = &input.expected_bucket_owner {
   64     66   
        let formatted_4 = inner_3.as_str();
   65         -
        let header_value = formatted_4;
   66         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   67         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   68         -
                "expected_bucket_owner",
   69         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   70         -
            )
   71         -
        })?;
   72         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          67  +
        if !formatted_4.is_empty() {
          68  +
            let header_value = formatted_4;
          69  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          70  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          71  +
                    "expected_bucket_owner",
          72  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          73  +
                )
          74  +
            })?;
          75  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          76  +
        }
   73     77   
    }
   74     78   
    if let ::std::option::Option::Some(inner_5) = &input.sse_customer_algorithm {
   75     79   
        let formatted_6 = inner_5.as_str();
   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         -
                "sse_customer_algorithm",
   80         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   81         -
            )
   82         -
        })?;
   83         -
        builder = builder.header("x-amz-server-side-encryption-customer-algorithm", 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  +
                    "sse_customer_algorithm",
          85  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          86  +
                )
          87  +
            })?;
          88  +
            builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
          89  +
        }
   84     90   
    }
   85     91   
    if let ::std::option::Option::Some(inner_7) = &input.sse_customer_key {
   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         -
                "sse_customer_key",
   91         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
   92         -
            )
   93         -
        })?;
   94         -
        builder = builder.header("x-amz-server-side-encryption-customer-key", 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  +
                    "sse_customer_key",
          98  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
          99  +
                )
         100  +
            })?;
         101  +
            builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         102  +
        }
   95    103   
    }
   96    104   
    if let ::std::option::Option::Some(inner_9) = &input.sse_customer_key_md5 {
   97    105   
        let formatted_10 = inner_9.as_str();
   98         -
        let header_value = formatted_10;
   99         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  100         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  101         -
                "sse_customer_key_md5",
  102         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  103         -
            )
  104         -
        })?;
  105         -
        builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         106  +
        if !formatted_10.is_empty() {
         107  +
            let header_value = formatted_10;
         108  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         109  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         110  +
                    "sse_customer_key_md5",
         111  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         112  +
                )
         113  +
            })?;
         114  +
            builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         115  +
        }
  106    116   
    }
  107    117   
    Ok(builder)
  108    118   
}
  109    119   
  110    120   
#[allow(unused_mut)]
  111    121   
pub fn de_list_parts(
  112    122   
    inp: &[u8],
  113    123   
    mut builder: crate::operation::list_parts::builders::ListPartsOutputBuilder,
  114    124   
) -> Result<crate::operation::list_parts::builders::ListPartsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
  115    125   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;

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

@@ -14,14 +65,69 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_put_bucket_accelerate_configuration_headers(
   39     39   
    input: &crate::operation::put_bucket_accelerate_configuration::PutBucketAccelerateConfigurationInput,
   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   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
   54     56   
        let formatted_4 = inner_3.as_str();
   55         -
        let header_value = formatted_4;
   56         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   57         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   58         -
                "checksum_algorithm",
   59         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   60         -
            )
   61         -
        })?;
   62         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          57  +
        if !formatted_4.is_empty() {
          58  +
            let header_value = formatted_4;
          59  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          60  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          61  +
                    "checksum_algorithm",
          62  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          63  +
                )
          64  +
            })?;
          65  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          66  +
        }
   63     67   
    }
   64     68   
    Ok(builder)
   65     69   
}

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

@@ -8,8 +136,154 @@
   28     28   
        output.build()
   29     29   
    })
   30     30   
}
   31     31   
   32     32   
pub fn ser_put_bucket_acl_headers(
   33     33   
    input: &crate::operation::put_bucket_acl::PutBucketAclInput,
   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.acl {
   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         -
                "acl",
   42         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   43         -
            )
   44         -
        })?;
   45         -
        builder = builder.header("x-amz-acl", 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  +
                    "acl",
          43  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          44  +
                )
          45  +
            })?;
          46  +
            builder = builder.header("x-amz-acl", header_value);
          47  +
        }
   46     48   
    }
   47     49   
    if let ::std::option::Option::Some(inner_3) = &input.content_md5 {
   48     50   
        let formatted_4 = inner_3.as_str();
   49         -
        let header_value = formatted_4;
   50         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   51         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   52         -
                "content_md5",
   53         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   54         -
            )
   55         -
        })?;
   56         -
        builder = builder.header("Content-MD5", header_value);
          51  +
        if !formatted_4.is_empty() {
          52  +
            let header_value = formatted_4;
          53  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          54  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          55  +
                    "content_md5",
          56  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          57  +
                )
          58  +
            })?;
          59  +
            builder = builder.header("Content-MD5", header_value);
          60  +
        }
   57     61   
    }
   58     62   
    if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
   59     63   
        let formatted_6 = inner_5.as_str();
   60         -
        let header_value = formatted_6;
   61         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   62         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   63         -
                "checksum_algorithm",
   64         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   65         -
            )
   66         -
        })?;
   67         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          64  +
        if !formatted_6.is_empty() {
          65  +
            let header_value = formatted_6;
          66  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          67  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          68  +
                    "checksum_algorithm",
          69  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          70  +
                )
          71  +
            })?;
          72  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          73  +
        }
   68     74   
    }
   69     75   
    if let ::std::option::Option::Some(inner_7) = &input.grant_full_control {
   70     76   
        let formatted_8 = inner_7.as_str();
   71         -
        let header_value = formatted_8;
   72         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   73         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   74         -
                "grant_full_control",
   75         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   76         -
            )
   77         -
        })?;
   78         -
        builder = builder.header("x-amz-grant-full-control", header_value);
          77  +
        if !formatted_8.is_empty() {
          78  +
            let header_value = formatted_8;
          79  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          80  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          81  +
                    "grant_full_control",
          82  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          83  +
                )
          84  +
            })?;
          85  +
            builder = builder.header("x-amz-grant-full-control", header_value);
          86  +
        }
   79     87   
    }
   80     88   
    if let ::std::option::Option::Some(inner_9) = &input.grant_read {
   81     89   
        let formatted_10 = inner_9.as_str();
   82         -
        let header_value = formatted_10;
   83         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   84         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   85         -
                "grant_read",
   86         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   87         -
            )
   88         -
        })?;
   89         -
        builder = builder.header("x-amz-grant-read", header_value);
          90  +
        if !formatted_10.is_empty() {
          91  +
            let header_value = formatted_10;
          92  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          93  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          94  +
                    "grant_read",
          95  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          96  +
                )
          97  +
            })?;
          98  +
            builder = builder.header("x-amz-grant-read", header_value);
          99  +
        }
   90    100   
    }
   91    101   
    if let ::std::option::Option::Some(inner_11) = &input.grant_read_acp {
   92    102   
        let formatted_12 = inner_11.as_str();
   93         -
        let header_value = formatted_12;
   94         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   95         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   96         -
                "grant_read_acp",
   97         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   98         -
            )
   99         -
        })?;
  100         -
        builder = builder.header("x-amz-grant-read-acp", header_value);
         103  +
        if !formatted_12.is_empty() {
         104  +
            let header_value = formatted_12;
         105  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         106  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         107  +
                    "grant_read_acp",
         108  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         109  +
                )
         110  +
            })?;
         111  +
            builder = builder.header("x-amz-grant-read-acp", header_value);
         112  +
        }
  101    113   
    }
  102    114   
    if let ::std::option::Option::Some(inner_13) = &input.grant_write {
  103    115   
        let formatted_14 = inner_13.as_str();
  104         -
        let header_value = formatted_14;
  105         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  106         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  107         -
                "grant_write",
  108         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  109         -
            )
  110         -
        })?;
  111         -
        builder = builder.header("x-amz-grant-write", header_value);
         116  +
        if !formatted_14.is_empty() {
         117  +
            let header_value = formatted_14;
         118  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         119  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         120  +
                    "grant_write",
         121  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         122  +
                )
         123  +
            })?;
         124  +
            builder = builder.header("x-amz-grant-write", header_value);
         125  +
        }
  112    126   
    }
  113    127   
    if let ::std::option::Option::Some(inner_15) = &input.grant_write_acp {
  114    128   
        let formatted_16 = inner_15.as_str();
  115         -
        let header_value = formatted_16;
  116         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  117         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  118         -
                "grant_write_acp",
  119         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  120         -
            )
  121         -
        })?;
  122         -
        builder = builder.header("x-amz-grant-write-acp", header_value);
         129  +
        if !formatted_16.is_empty() {
         130  +
            let header_value = formatted_16;
         131  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         132  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         133  +
                    "grant_write_acp",
         134  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         135  +
                )
         136  +
            })?;
         137  +
            builder = builder.header("x-amz-grant-write-acp", header_value);
         138  +
        }
  123    139   
    }
  124    140   
    if let ::std::option::Option::Some(inner_17) = &input.expected_bucket_owner {
  125    141   
        let formatted_18 = inner_17.as_str();
  126         -
        let header_value = formatted_18;
  127         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  128         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  129         -
                "expected_bucket_owner",
  130         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  131         -
            )
  132         -
        })?;
  133         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         142  +
        if !formatted_18.is_empty() {
         143  +
            let header_value = formatted_18;
         144  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         145  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         146  +
                    "expected_bucket_owner",
         147  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         148  +
                )
         149  +
            })?;
         150  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         151  +
        }
  134    152   
    }
  135    153   
    Ok(builder)
  136    154   
}

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

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_put_bucket_analytics_configuration_headers(
   39     39   
    input: &crate::operation::put_bucket_analytics_configuration::PutBucketAnalyticsConfigurationInput,
   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_put_bucket_cors.rs

@@ -8,8 +70,76 @@
   28     28   
        output.build()
   29     29   
    })
   30     30   
}
   31     31   
   32     32   
pub fn ser_put_bucket_cors_headers(
   33     33   
    input: &crate::operation::put_bucket_cors::PutBucketCorsInput,
   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.content_md5 {
   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         -
                "content_md5",
   42         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   43         -
            )
   44         -
        })?;
   45         -
        builder = builder.header("Content-MD5", 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  +
                    "content_md5",
          43  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          44  +
                )
          45  +
            })?;
          46  +
            builder = builder.header("Content-MD5", header_value);
          47  +
        }
   46     48   
    }
   47     49   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
   48     50   
        let formatted_4 = inner_3.as_str();
   49         -
        let header_value = formatted_4;
   50         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   51         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   52         -
                "checksum_algorithm",
   53         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   54         -
            )
   55         -
        })?;
   56         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          51  +
        if !formatted_4.is_empty() {
          52  +
            let header_value = formatted_4;
          53  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          54  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          55  +
                    "checksum_algorithm",
          56  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          57  +
                )
          58  +
            })?;
          59  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          60  +
        }
   57     61   
    }
   58     62   
    if let ::std::option::Option::Some(inner_5) = &input.expected_bucket_owner {
   59     63   
        let formatted_6 = inner_5.as_str();
   60         -
        let header_value = formatted_6;
   61         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   62         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   63         -
                "expected_bucket_owner",
   64         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   65         -
            )
   66         -
        })?;
   67         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          64  +
        if !formatted_6.is_empty() {
          65  +
            let header_value = formatted_6;
          66  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          67  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          68  +
                    "expected_bucket_owner",
          69  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          70  +
                )
          71  +
            })?;
          72  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          73  +
        }
   68     74   
    }
   69     75   
    Ok(builder)
   70     76   
}

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

@@ -14,14 +76,82 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_put_bucket_encryption_headers(
   39     39   
    input: &crate::operation::put_bucket_encryption::PutBucketEncryptionInput,
   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.content_md5 {
   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         -
                "content_md5",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("Content-MD5", 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  +
                    "content_md5",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("Content-MD5", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
   54     56   
        let formatted_4 = inner_3.as_str();
   55         -
        let header_value = formatted_4;
   56         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   57         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   58         -
                "checksum_algorithm",
   59         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   60         -
            )
   61         -
        })?;
   62         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          57  +
        if !formatted_4.is_empty() {
          58  +
            let header_value = formatted_4;
          59  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          60  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          61  +
                    "checksum_algorithm",
          62  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          63  +
                )
          64  +
            })?;
          65  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          66  +
        }
   63     67   
    }
   64     68   
    if let ::std::option::Option::Some(inner_5) = &input.expected_bucket_owner {
   65     69   
        let formatted_6 = inner_5.as_str();
   66         -
        let header_value = formatted_6;
   67         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   68         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   69         -
                "expected_bucket_owner",
   70         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   71         -
            )
   72         -
        })?;
   73         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          70  +
        if !formatted_6.is_empty() {
          71  +
            let header_value = formatted_6;
          72  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          73  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          74  +
                    "expected_bucket_owner",
          75  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          76  +
                )
          77  +
            })?;
          78  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          79  +
        }
   74     80   
    }
   75     81   
    Ok(builder)
   76     82   
}

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

@@ -14,14 +54,56 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_put_bucket_inventory_configuration_headers(
   39     39   
    input: &crate::operation::put_bucket_inventory_configuration::PutBucketInventoryConfigurationInput,
   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_put_bucket_lifecycle_configuration.rs

@@ -14,14 +65,69 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_put_bucket_lifecycle_configuration_headers(
   39     39   
    input: &crate::operation::put_bucket_lifecycle_configuration::PutBucketLifecycleConfigurationInput,
   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.checksum_algorithm {
   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         -
                "checksum_algorithm",
   48         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   49         -
            )
   50         -
        })?;
   51         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", 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  +
                    "checksum_algorithm",
          49  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          50  +
                )
          51  +
            })?;
          52  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          53  +
        }
   52     54   
    }
   53     55   
    if let ::std::option::Option::Some(inner_3) = &input.expected_bucket_owner {
   54     56   
        let formatted_4 = inner_3.as_str();
   55         -
        let header_value = formatted_4;
   56         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   57         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   58         -
                "expected_bucket_owner",
   59         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   60         -
            )
   61         -
        })?;
   62         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          57  +
        if !formatted_4.is_empty() {
          58  +
            let header_value = formatted_4;
          59  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          60  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          61  +
                    "expected_bucket_owner",
          62  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          63  +
                )
          64  +
            })?;
          65  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          66  +
        }
   63     67   
    }
   64     68   
    Ok(builder)
   65     69   
}