AWS SDK

AWS SDK

rev. a7fb2e3446d314cfbe48069306e4e0a389b39aeb

Files changed:

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

@@ -36,36 +175,195 @@
   56     56   
        output.build()
   57     57   
    })
   58     58   
}
   59     59   
   60     60   
pub fn ser_put_object_acl_headers(
   61     61   
    input: &crate::operation::put_object_acl::PutObjectAclInput,
   62     62   
    mut builder: ::http::request::Builder,
   63     63   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   64     64   
    if let ::std::option::Option::Some(inner_1) = &input.acl {
   65     65   
        let formatted_2 = inner_1.as_str();
   66         -
        let header_value = formatted_2;
   67         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   68         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   69         -
                "acl",
   70         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   71         -
            )
   72         -
        })?;
   73         -
        builder = builder.header("x-amz-acl", header_value);
          66  +
        if !formatted_2.is_empty() {
          67  +
            let header_value = formatted_2;
          68  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          69  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          70  +
                    "acl",
          71  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          72  +
                )
          73  +
            })?;
          74  +
            builder = builder.header("x-amz-acl", header_value);
          75  +
        }
   74     76   
    }
   75     77   
    if let ::std::option::Option::Some(inner_3) = &input.content_md5 {
   76     78   
        let formatted_4 = inner_3.as_str();
   77         -
        let header_value = formatted_4;
   78         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   79         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   80         -
                "content_md5",
   81         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   82         -
            )
   83         -
        })?;
   84         -
        builder = builder.header("Content-MD5", header_value);
          79  +
        if !formatted_4.is_empty() {
          80  +
            let header_value = formatted_4;
          81  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          82  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          83  +
                    "content_md5",
          84  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          85  +
                )
          86  +
            })?;
          87  +
            builder = builder.header("Content-MD5", header_value);
          88  +
        }
   85     89   
    }
   86     90   
    if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
   87     91   
        let formatted_6 = inner_5.as_str();
   88         -
        let header_value = formatted_6;
   89         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   90         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   91         -
                "checksum_algorithm",
   92         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   93         -
            )
   94         -
        })?;
   95         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          92  +
        if !formatted_6.is_empty() {
          93  +
            let header_value = formatted_6;
          94  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          95  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          96  +
                    "checksum_algorithm",
          97  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          98  +
                )
          99  +
            })?;
         100  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
         101  +
        }
   96    102   
    }
   97    103   
    if let ::std::option::Option::Some(inner_7) = &input.grant_full_control {
   98    104   
        let formatted_8 = inner_7.as_str();
   99         -
        let header_value = formatted_8;
  100         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  101         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  102         -
                "grant_full_control",
  103         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  104         -
            )
  105         -
        })?;
  106         -
        builder = builder.header("x-amz-grant-full-control", header_value);
         105  +
        if !formatted_8.is_empty() {
         106  +
            let header_value = formatted_8;
         107  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         108  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         109  +
                    "grant_full_control",
         110  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         111  +
                )
         112  +
            })?;
         113  +
            builder = builder.header("x-amz-grant-full-control", header_value);
         114  +
        }
  107    115   
    }
  108    116   
    if let ::std::option::Option::Some(inner_9) = &input.grant_read {
  109    117   
        let formatted_10 = inner_9.as_str();
  110         -
        let header_value = formatted_10;
  111         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  112         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  113         -
                "grant_read",
  114         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  115         -
            )
  116         -
        })?;
  117         -
        builder = builder.header("x-amz-grant-read", header_value);
         118  +
        if !formatted_10.is_empty() {
         119  +
            let header_value = formatted_10;
         120  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         121  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         122  +
                    "grant_read",
         123  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         124  +
                )
         125  +
            })?;
         126  +
            builder = builder.header("x-amz-grant-read", header_value);
         127  +
        }
  118    128   
    }
  119    129   
    if let ::std::option::Option::Some(inner_11) = &input.grant_read_acp {
  120    130   
        let formatted_12 = inner_11.as_str();
  121         -
        let header_value = formatted_12;
  122         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  123         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  124         -
                "grant_read_acp",
  125         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  126         -
            )
  127         -
        })?;
  128         -
        builder = builder.header("x-amz-grant-read-acp", header_value);
         131  +
        if !formatted_12.is_empty() {
         132  +
            let header_value = formatted_12;
         133  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         134  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         135  +
                    "grant_read_acp",
         136  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         137  +
                )
         138  +
            })?;
         139  +
            builder = builder.header("x-amz-grant-read-acp", header_value);
         140  +
        }
  129    141   
    }
  130    142   
    if let ::std::option::Option::Some(inner_13) = &input.grant_write {
  131    143   
        let formatted_14 = inner_13.as_str();
  132         -
        let header_value = formatted_14;
  133         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  134         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  135         -
                "grant_write",
  136         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  137         -
            )
  138         -
        })?;
  139         -
        builder = builder.header("x-amz-grant-write", header_value);
         144  +
        if !formatted_14.is_empty() {
         145  +
            let header_value = formatted_14;
         146  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         147  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         148  +
                    "grant_write",
         149  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         150  +
                )
         151  +
            })?;
         152  +
            builder = builder.header("x-amz-grant-write", header_value);
         153  +
        }
  140    154   
    }
  141    155   
    if let ::std::option::Option::Some(inner_15) = &input.grant_write_acp {
  142    156   
        let formatted_16 = inner_15.as_str();
  143         -
        let header_value = formatted_16;
  144         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  145         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  146         -
                "grant_write_acp",
  147         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  148         -
            )
  149         -
        })?;
  150         -
        builder = builder.header("x-amz-grant-write-acp", header_value);
         157  +
        if !formatted_16.is_empty() {
         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  +
                    "grant_write_acp",
         162  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         163  +
                )
         164  +
            })?;
         165  +
            builder = builder.header("x-amz-grant-write-acp", header_value);
         166  +
        }
  151    167   
    }
  152    168   
    if let ::std::option::Option::Some(inner_17) = &input.request_payer {
  153    169   
        let formatted_18 = inner_17.as_str();
  154         -
        let header_value = formatted_18;
  155         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  156         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  157         -
                "request_payer",
  158         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  159         -
            )
  160         -
        })?;
  161         -
        builder = builder.header("x-amz-request-payer", header_value);
         170  +
        if !formatted_18.is_empty() {
         171  +
            let header_value = formatted_18;
         172  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         173  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         174  +
                    "request_payer",
         175  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         176  +
                )
         177  +
            })?;
         178  +
            builder = builder.header("x-amz-request-payer", header_value);
         179  +
        }
  162    180   
    }
  163    181   
    if let ::std::option::Option::Some(inner_19) = &input.expected_bucket_owner {
  164    182   
        let formatted_20 = inner_19.as_str();
  165         -
        let header_value = formatted_20;
  166         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  167         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  168         -
                "expected_bucket_owner",
  169         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  170         -
            )
  171         -
        })?;
  172         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         183  +
        if !formatted_20.is_empty() {
         184  +
            let header_value = formatted_20;
         185  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         186  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         187  +
                    "expected_bucket_owner",
         188  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         189  +
                )
         190  +
            })?;
         191  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         192  +
        }
  173    193   
    }
  174    194   
    Ok(builder)
  175    195   
}

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

@@ -21,21 +94,102 @@
   41     41   
        output.build()
   42     42   
    })
   43     43   
}
   44     44   
   45     45   
pub fn ser_put_object_legal_hold_headers(
   46     46   
    input: &crate::operation::put_object_legal_hold::PutObjectLegalHoldInput,
   47     47   
    mut builder: ::http::request::Builder,
   48     48   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   49     49   
    if let ::std::option::Option::Some(inner_1) = &input.request_payer {
   50     50   
        let formatted_2 = inner_1.as_str();
   51         -
        let header_value = formatted_2;
   52         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   53         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   54         -
                "request_payer",
   55         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   56         -
            )
   57         -
        })?;
   58         -
        builder = builder.header("x-amz-request-payer", header_value);
          51  +
        if !formatted_2.is_empty() {
          52  +
            let header_value = formatted_2;
          53  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          54  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          55  +
                    "request_payer",
          56  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          57  +
                )
          58  +
            })?;
          59  +
            builder = builder.header("x-amz-request-payer", header_value);
          60  +
        }
   59     61   
    }
   60     62   
    if let ::std::option::Option::Some(inner_3) = &input.content_md5 {
   61     63   
        let formatted_4 = inner_3.as_str();
   62         -
        let header_value = formatted_4;
   63         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   64         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   65         -
                "content_md5",
   66         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   67         -
            )
   68         -
        })?;
   69         -
        builder = builder.header("Content-MD5", header_value);
          64  +
        if !formatted_4.is_empty() {
          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  +
                    "content_md5",
          69  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          70  +
                )
          71  +
            })?;
          72  +
            builder = builder.header("Content-MD5", header_value);
          73  +
        }
   70     74   
    }
   71     75   
    if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
   72     76   
        let formatted_6 = inner_5.as_str();
   73         -
        let header_value = formatted_6;
   74         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   75         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   76         -
                "checksum_algorithm",
   77         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   78         -
            )
   79         -
        })?;
   80         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          77  +
        if !formatted_6.is_empty() {
          78  +
            let header_value = formatted_6;
          79  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          80  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          81  +
                    "checksum_algorithm",
          82  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          83  +
                )
          84  +
            })?;
          85  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          86  +
        }
   81     87   
    }
   82     88   
    if let ::std::option::Option::Some(inner_7) = &input.expected_bucket_owner {
   83     89   
        let formatted_8 = inner_7.as_str();
   84         -
        let header_value = formatted_8;
   85         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   86         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   87         -
                "expected_bucket_owner",
   88         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   89         -
            )
   90         -
        })?;
   91         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          90  +
        if !formatted_8.is_empty() {
          91  +
            let header_value = formatted_8;
          92  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          93  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          94  +
                    "expected_bucket_owner",
          95  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          96  +
                )
          97  +
            })?;
          98  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          99  +
        }
   92    100   
    }
   93    101   
    Ok(builder)
   94    102   
}

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

@@ -23,23 +107,117 @@
   43     43   
        output.build()
   44     44   
    })
   45     45   
}
   46     46   
   47     47   
pub fn ser_put_object_lock_configuration_headers(
   48     48   
    input: &crate::operation::put_object_lock_configuration::PutObjectLockConfigurationInput,
   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.request_payer {
   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         -
                "request_payer",
   57         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   58         -
            )
   59         -
        })?;
   60         -
        builder = builder.header("x-amz-request-payer", 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  +
                    "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);
          62  +
        }
   61     63   
    }
   62     64   
    if let ::std::option::Option::Some(inner_3) = &input.token {
   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         -
                "token",
   68         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   69         -
            )
   70         -
        })?;
   71         -
        builder = builder.header("x-amz-bucket-object-lock-token", 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  +
                    "token",
          71  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          72  +
                )
          73  +
            })?;
          74  +
            builder = builder.header("x-amz-bucket-object-lock-token", header_value);
          75  +
        }
   72     76   
    }
   73     77   
    if let ::std::option::Option::Some(inner_5) = &input.content_md5 {
   74     78   
        let formatted_6 = inner_5.as_str();
   75         -
        let header_value = formatted_6;
   76         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   77         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   78         -
                "content_md5",
   79         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   80         -
            )
   81         -
        })?;
   82         -
        builder = builder.header("Content-MD5", header_value);
          79  +
        if !formatted_6.is_empty() {
          80  +
            let header_value = formatted_6;
          81  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          82  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          83  +
                    "content_md5",
          84  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          85  +
                )
          86  +
            })?;
          87  +
            builder = builder.header("Content-MD5", header_value);
          88  +
        }
   83     89   
    }
   84     90   
    if let ::std::option::Option::Some(inner_7) = &input.checksum_algorithm {
   85     91   
        let formatted_8 = inner_7.as_str();
   86         -
        let header_value = formatted_8;
   87         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   88         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   89         -
                "checksum_algorithm",
   90         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   91         -
            )
   92         -
        })?;
   93         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          92  +
        if !formatted_8.is_empty() {
          93  +
            let header_value = formatted_8;
          94  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          95  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          96  +
                    "checksum_algorithm",
          97  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          98  +
                )
          99  +
            })?;
         100  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
         101  +
        }
   94    102   
    }
   95    103   
    if let ::std::option::Option::Some(inner_9) = &input.expected_bucket_owner {
   96    104   
        let formatted_10 = inner_9.as_str();
   97         -
        let header_value = formatted_10;
   98         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   99         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  100         -
                "expected_bucket_owner",
  101         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  102         -
            )
  103         -
        })?;
  104         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         105  +
        if !formatted_10.is_empty() {
         106  +
            let header_value = formatted_10;
         107  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         108  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         109  +
                    "expected_bucket_owner",
         110  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         111  +
                )
         112  +
            })?;
         113  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         114  +
        }
  105    115   
    }
  106    116   
    Ok(builder)
  107    117   
}

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

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

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

@@ -13,13 +86,94 @@
   33     33   
        output.build()
   34     34   
    })
   35     35   
}
   36     36   
   37     37   
pub fn ser_put_object_tagging_headers(
   38     38   
    input: &crate::operation::put_object_tagging::PutObjectTaggingInput,
   39     39   
    mut builder: ::http::request::Builder,
   40     40   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   41     41   
    if let ::std::option::Option::Some(inner_1) = &input.content_md5 {
   42     42   
        let formatted_2 = inner_1.as_str();
   43         -
        let header_value = formatted_2;
   44         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   45         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   46         -
                "content_md5",
   47         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   48         -
            )
   49         -
        })?;
   50         -
        builder = builder.header("Content-MD5", header_value);
          43  +
        if !formatted_2.is_empty() {
          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);
          52  +
        }
   51     53   
    }
   52     54   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
   53     55   
        let formatted_4 = inner_3.as_str();
   54         -
        let header_value = formatted_4;
   55         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   56         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   57         -
                "checksum_algorithm",
   58         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   59         -
            )
   60         -
        })?;
   61         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          56  +
        if !formatted_4.is_empty() {
          57  +
            let header_value = formatted_4;
          58  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          59  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          60  +
                    "checksum_algorithm",
          61  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          62  +
                )
          63  +
            })?;
          64  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          65  +
        }
   62     66   
    }
   63     67   
    if let ::std::option::Option::Some(inner_5) = &input.expected_bucket_owner {
   64     68   
        let formatted_6 = inner_5.as_str();
   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);
          69  +
        if !formatted_6.is_empty() {
          70  +
            let header_value = formatted_6;
          71  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          72  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          73  +
                    "expected_bucket_owner",
          74  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          75  +
                )
          76  +
            })?;
          77  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          78  +
        }
   73     79   
    }
   74     80   
    if let ::std::option::Option::Some(inner_7) = &input.request_payer {
   75     81   
        let formatted_8 = inner_7.as_str();
   76         -
        let header_value = formatted_8;
   77         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   78         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   79         -
                "request_payer",
   80         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   81         -
            )
   82         -
        })?;
   83         -
        builder = builder.header("x-amz-request-payer", header_value);
          82  +
        if !formatted_8.is_empty() {
          83  +
            let header_value = formatted_8;
          84  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          85  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          86  +
                    "request_payer",
          87  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          88  +
                )
          89  +
            })?;
          90  +
            builder = builder.header("x-amz-request-payer", header_value);
          91  +
        }
   84     92   
    }
   85     93   
    Ok(builder)
   86     94   
}

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

@@ -14,14 +76,82 @@
   34     34   
        output.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
pub fn ser_put_public_access_block_headers(
   39     39   
    input: &crate::operation::put_public_access_block::PutPublicAccessBlockInput,
   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_restore_object.rs

@@ -46,46 +108,114 @@
   66     66   
        output.build()
   67     67   
    })
   68     68   
}
   69     69   
   70     70   
pub fn ser_restore_object_headers(
   71     71   
    input: &crate::operation::restore_object::RestoreObjectInput,
   72     72   
    mut builder: ::http::request::Builder,
   73     73   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   74     74   
    if let ::std::option::Option::Some(inner_1) = &input.request_payer {
   75     75   
        let formatted_2 = inner_1.as_str();
   76         -
        let header_value = formatted_2;
   77         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   78         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   79         -
                "request_payer",
   80         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   81         -
            )
   82         -
        })?;
   83         -
        builder = builder.header("x-amz-request-payer", header_value);
          76  +
        if !formatted_2.is_empty() {
          77  +
            let header_value = formatted_2;
          78  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          79  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          80  +
                    "request_payer",
          81  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          82  +
                )
          83  +
            })?;
          84  +
            builder = builder.header("x-amz-request-payer", header_value);
          85  +
        }
   84     86   
    }
   85     87   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_algorithm {
   86     88   
        let formatted_4 = inner_3.as_str();
   87         -
        let header_value = formatted_4;
   88         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   89         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   90         -
                "checksum_algorithm",
   91         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   92         -
            )
   93         -
        })?;
   94         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          89  +
        if !formatted_4.is_empty() {
          90  +
            let header_value = formatted_4;
          91  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          92  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          93  +
                    "checksum_algorithm",
          94  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          95  +
                )
          96  +
            })?;
          97  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
          98  +
        }
   95     99   
    }
   96    100   
    if let ::std::option::Option::Some(inner_5) = &input.expected_bucket_owner {
   97    101   
        let formatted_6 = inner_5.as_str();
   98         -
        let header_value = formatted_6;
   99         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  100         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  101         -
                "expected_bucket_owner",
  102         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  103         -
            )
  104         -
        })?;
  105         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         102  +
        if !formatted_6.is_empty() {
         103  +
            let header_value = formatted_6;
         104  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         105  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         106  +
                    "expected_bucket_owner",
         107  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         108  +
                )
         109  +
            })?;
         110  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         111  +
        }
  106    112   
    }
  107    113   
    Ok(builder)
  108    114   
}

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

@@ -23,23 +111,119 @@
   43     43   
    let generic = generic_builder.build();
   44     44   
    Err(crate::operation::select_object_content::SelectObjectContentError::generic(generic))
   45     45   
}
   46     46   
   47     47   
pub fn ser_select_object_content_headers(
   48     48   
    input: &crate::operation::select_object_content::SelectObjectContentInput,
   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.sse_customer_algorithm {
   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         -
                "sse_customer_algorithm",
   57         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   58         -
            )
   59         -
        })?;
   60         -
        builder = builder.header("x-amz-server-side-encryption-customer-algorithm", 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  +
                    "sse_customer_algorithm",
          58  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          59  +
                )
          60  +
            })?;
          61  +
            builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
          62  +
        }
   61     63   
    }
   62     64   
    if let ::std::option::Option::Some(inner_3) = &input.sse_customer_key {
   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         -
                "sse_customer_key",
   68         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
   69         -
            )
   70         -
        })?;
   71         -
        builder = builder.header("x-amz-server-side-encryption-customer-key", 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  +
                    "sse_customer_key",
          71  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
          72  +
                )
          73  +
            })?;
          74  +
            builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
          75  +
        }
   72     76   
    }
   73     77   
    if let ::std::option::Option::Some(inner_5) = &input.sse_customer_key_md5 {
   74     78   
        let formatted_6 = inner_5.as_str();
   75         -
        let header_value = formatted_6;
   76         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   77         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   78         -
                "sse_customer_key_md5",
   79         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   80         -
            )
   81         -
        })?;
   82         -
        builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
          79  +
        if !formatted_6.is_empty() {
          80  +
            let header_value = formatted_6;
          81  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          82  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          83  +
                    "sse_customer_key_md5",
          84  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          85  +
                )
          86  +
            })?;
          87  +
            builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
          88  +
        }
   83     89   
    }
   84     90   
    if let ::std::option::Option::Some(inner_7) = &input.expected_bucket_owner {
   85     91   
        let formatted_8 = inner_7.as_str();
   86         -
        let header_value = formatted_8;
   87         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   88         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   89         -
                "expected_bucket_owner",
   90         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   91         -
            )
   92         -
        })?;
   93         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          92  +
        if !formatted_8.is_empty() {
          93  +
            let header_value = formatted_8;
          94  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          95  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          96  +
                    "expected_bucket_owner",
          97  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          98  +
                )
          99  +
            })?;
         100  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         101  +
        }
   94    102   
    }
   95    103   
    Ok(builder)
   96    104   
}
   97    105   
   98    106   
pub fn ser_select_object_content_op_input(
   99    107   
    input: &crate::operation::select_object_content::SelectObjectContentInput,
  100    108   
) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  101    109   
    let mut out = String::new();
  102    110   
    {
  103    111   
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);

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

@@ -73,73 +234,258 @@
   93     93   
    })
   94     94   
}
   95     95   
   96     96   
pub fn ser_upload_part_headers(
   97     97   
    input: &crate::operation::upload_part::UploadPartInput,
   98     98   
    mut builder: ::http::request::Builder,
   99     99   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  100    100   
    if let ::std::option::Option::Some(inner_1) = &input.content_length {
  101    101   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
  102    102   
        let formatted_2 = encoder.encode();
  103         -
        let header_value = formatted_2;
  104         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  105         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  106         -
                "content_length",
  107         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  108         -
            )
  109         -
        })?;
  110         -
        builder = builder.header("Content-Length", header_value);
         103  +
        if !formatted_2.is_empty() {
         104  +
            let header_value = formatted_2;
         105  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         106  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         107  +
                    "content_length",
         108  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         109  +
                )
         110  +
            })?;
         111  +
            builder = builder.header("Content-Length", header_value);
         112  +
        }
  111    113   
    }
  112    114   
    if let ::std::option::Option::Some(inner_3) = &input.content_md5 {
  113    115   
        let formatted_4 = inner_3.as_str();
  114         -
        let header_value = formatted_4;
  115         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  116         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  117         -
                "content_md5",
  118         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  119         -
            )
  120         -
        })?;
  121         -
        builder = builder.header("Content-MD5", header_value);
         116  +
        if !formatted_4.is_empty() {
         117  +
            let header_value = formatted_4;
         118  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         119  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         120  +
                    "content_md5",
         121  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         122  +
                )
         123  +
            })?;
         124  +
            builder = builder.header("Content-MD5", header_value);
         125  +
        }
  122    126   
    }
  123    127   
    if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
  124    128   
        let formatted_6 = inner_5.as_str();
  125         -
        let header_value = formatted_6;
  126         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  127         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  128         -
                "checksum_algorithm",
  129         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  130         -
            )
  131         -
        })?;
  132         -
        builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
         129  +
        if !formatted_6.is_empty() {
         130  +
            let header_value = formatted_6;
         131  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         132  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         133  +
                    "checksum_algorithm",
         134  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         135  +
                )
         136  +
            })?;
         137  +
            builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
         138  +
        }
  133    139   
    }
  134    140   
    if let ::std::option::Option::Some(inner_7) = &input.checksum_crc32 {
  135    141   
        let formatted_8 = inner_7.as_str();
  136         -
        let header_value = formatted_8;
  137         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  138         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  139         -
                "checksum_crc32",
  140         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  141         -
            )
  142         -
        })?;
  143         -
        builder = builder.header("x-amz-checksum-crc32", header_value);
         142  +
        if !formatted_8.is_empty() {
         143  +
            let header_value = formatted_8;
         144  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         145  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         146  +
                    "checksum_crc32",
         147  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         148  +
                )
         149  +
            })?;
         150  +
            builder = builder.header("x-amz-checksum-crc32", header_value);
         151  +
        }
  144    152   
    }
  145    153   
    if let ::std::option::Option::Some(inner_9) = &input.checksum_crc32_c {
  146    154   
        let formatted_10 = inner_9.as_str();
  147         -
        let header_value = formatted_10;
  148         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  149         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  150         -
                "checksum_crc32_c",
  151         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  152         -
            )
  153         -
        })?;
  154         -
        builder = builder.header("x-amz-checksum-crc32c", header_value);
         155  +
        if !formatted_10.is_empty() {
         156  +
            let header_value = formatted_10;
         157  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         158  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         159  +
                    "checksum_crc32_c",
         160  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         161  +
                )
         162  +
            })?;
         163  +
            builder = builder.header("x-amz-checksum-crc32c", header_value);
         164  +
        }
  155    165   
    }
  156    166   
    if let ::std::option::Option::Some(inner_11) = &input.checksum_sha1 {
  157    167   
        let formatted_12 = inner_11.as_str();
  158         -
        let header_value = formatted_12;
  159         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  160         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  161         -
                "checksum_sha1",
  162         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  163         -
            )
  164         -
        })?;
  165         -
        builder = builder.header("x-amz-checksum-sha1", header_value);
         168  +
        if !formatted_12.is_empty() {
         169  +
            let header_value = formatted_12;
         170  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         171  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         172  +
                    "checksum_sha1",
         173  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         174  +
                )
         175  +
            })?;
         176  +
            builder = builder.header("x-amz-checksum-sha1", header_value);
         177  +
        }
  166    178   
    }
  167    179   
    if let ::std::option::Option::Some(inner_13) = &input.checksum_sha256 {
  168    180   
        let formatted_14 = inner_13.as_str();
  169         -
        let header_value = formatted_14;
  170         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  171         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  172         -
                "checksum_sha256",
  173         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  174         -
            )
  175         -
        })?;
  176         -
        builder = builder.header("x-amz-checksum-sha256", header_value);
         181  +
        if !formatted_14.is_empty() {
         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  +
                    "checksum_sha256",
         186  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         187  +
                )
         188  +
            })?;
         189  +
            builder = builder.header("x-amz-checksum-sha256", header_value);
         190  +
        }
  177    191   
    }
  178    192   
    if let ::std::option::Option::Some(inner_15) = &input.sse_customer_algorithm {
  179    193   
        let formatted_16 = inner_15.as_str();
  180         -
        let header_value = formatted_16;
  181         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  182         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  183         -
                "sse_customer_algorithm",
  184         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  185         -
            )
  186         -
        })?;
  187         -
        builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         194  +
        if !formatted_16.is_empty() {
         195  +
            let header_value = formatted_16;
         196  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         197  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         198  +
                    "sse_customer_algorithm",
         199  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         200  +
                )
         201  +
            })?;
         202  +
            builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         203  +
        }
  188    204   
    }
  189    205   
    if let ::std::option::Option::Some(inner_17) = &input.sse_customer_key {
  190    206   
        let formatted_18 = inner_17.as_str();
  191         -
        let header_value = formatted_18;
  192         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  193         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  194         -
                "sse_customer_key",
  195         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  196         -
            )
  197         -
        })?;
  198         -
        builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         207  +
        if !formatted_18.is_empty() {
         208  +
            let header_value = formatted_18;
         209  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         210  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         211  +
                    "sse_customer_key",
         212  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         213  +
                )
         214  +
            })?;
         215  +
            builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         216  +
        }
  199    217   
    }
  200    218   
    if let ::std::option::Option::Some(inner_19) = &input.sse_customer_key_md5 {
  201    219   
        let formatted_20 = inner_19.as_str();
  202         -
        let header_value = formatted_20;
  203         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  204         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  205         -
                "sse_customer_key_md5",
  206         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  207         -
            )
  208         -
        })?;
  209         -
        builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         220  +
        if !formatted_20.is_empty() {
         221  +
            let header_value = formatted_20;
         222  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         223  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         224  +
                    "sse_customer_key_md5",
         225  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         226  +
                )
         227  +
            })?;
         228  +
            builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         229  +
        }
  210    230   
    }
  211    231   
    if let ::std::option::Option::Some(inner_21) = &input.request_payer {
  212    232   
        let formatted_22 = inner_21.as_str();
  213         -
        let header_value = formatted_22;
  214         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  215         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  216         -
                "request_payer",
  217         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  218         -
            )
  219         -
        })?;
  220         -
        builder = builder.header("x-amz-request-payer", header_value);
         233  +
        if !formatted_22.is_empty() {
         234  +
            let header_value = formatted_22;
         235  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         236  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         237  +
                    "request_payer",
         238  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         239  +
                )
         240  +
            })?;
         241  +
            builder = builder.header("x-amz-request-payer", header_value);
         242  +
        }
  221    243   
    }
  222    244   
    if let ::std::option::Option::Some(inner_23) = &input.expected_bucket_owner {
  223    245   
        let formatted_24 = inner_23.as_str();
  224         -
        let header_value = formatted_24;
  225         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  226         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  227         -
                "expected_bucket_owner",
  228         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  229         -
            )
  230         -
        })?;
  231         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         246  +
        if !formatted_24.is_empty() {
         247  +
            let header_value = formatted_24;
         248  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         249  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         250  +
                    "expected_bucket_owner",
         251  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         252  +
                )
         253  +
            })?;
         254  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         255  +
        }
  232    256   
    }
  233    257   
    Ok(builder)
  234    258   
}

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

@@ -60,60 +254,284 @@
   80     80   
        output.build()
   81     81   
    })
   82     82   
}
   83     83   
   84     84   
pub fn ser_upload_part_copy_headers(
   85     85   
    input: &crate::operation::upload_part_copy::UploadPartCopyInput,
   86     86   
    mut builder: ::http::request::Builder,
   87     87   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   88     88   
    if let ::std::option::Option::Some(inner_1) = &input.copy_source {
   89     89   
        let formatted_2 = inner_1.as_str();
   90         -
        let header_value = formatted_2;
   91         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   92         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   93         -
                "copy_source",
   94         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   95         -
            )
   96         -
        })?;
   97         -
        builder = builder.header("x-amz-copy-source", header_value);
          90  +
        if !formatted_2.is_empty() {
          91  +
            let header_value = formatted_2;
          92  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          93  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          94  +
                    "copy_source",
          95  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          96  +
                )
          97  +
            })?;
          98  +
            builder = builder.header("x-amz-copy-source", header_value);
          99  +
        }
   98    100   
    }
   99    101   
    if let ::std::option::Option::Some(inner_3) = &input.copy_source_if_match {
  100    102   
        let formatted_4 = inner_3.as_str();
  101         -
        let header_value = formatted_4;
  102         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  103         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  104         -
                "copy_source_if_match",
  105         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  106         -
            )
  107         -
        })?;
  108         -
        builder = builder.header("x-amz-copy-source-if-match", header_value);
         103  +
        if !formatted_4.is_empty() {
         104  +
            let header_value = formatted_4;
         105  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         106  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         107  +
                    "copy_source_if_match",
         108  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         109  +
                )
         110  +
            })?;
         111  +
            builder = builder.header("x-amz-copy-source-if-match", header_value);
         112  +
        }
  109    113   
    }
  110    114   
    if let ::std::option::Option::Some(inner_5) = &input.copy_source_if_modified_since {
  111    115   
        let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  112         -
        let header_value = formatted_6;
  113         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  114         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  115         -
                "copy_source_if_modified_since",
  116         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  117         -
            )
  118         -
        })?;
  119         -
        builder = builder.header("x-amz-copy-source-if-modified-since", header_value);
         116  +
        if !formatted_6.is_empty() {
         117  +
            let header_value = formatted_6;
         118  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         119  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         120  +
                    "copy_source_if_modified_since",
         121  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         122  +
                )
         123  +
            })?;
         124  +
            builder = builder.header("x-amz-copy-source-if-modified-since", header_value);
         125  +
        }
  120    126   
    }
  121    127   
    if let ::std::option::Option::Some(inner_7) = &input.copy_source_if_none_match {
  122    128   
        let formatted_8 = inner_7.as_str();
  123         -
        let header_value = formatted_8;
  124         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  125         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  126         -
                "copy_source_if_none_match",
  127         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  128         -
            )
  129         -
        })?;
  130         -
        builder = builder.header("x-amz-copy-source-if-none-match", header_value);
         129  +
        if !formatted_8.is_empty() {
         130  +
            let header_value = formatted_8;
         131  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         132  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         133  +
                    "copy_source_if_none_match",
         134  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         135  +
                )
         136  +
            })?;
         137  +
            builder = builder.header("x-amz-copy-source-if-none-match", header_value);
         138  +
        }
  131    139   
    }
  132    140   
    if let ::std::option::Option::Some(inner_9) = &input.copy_source_if_unmodified_since {
  133    141   
        let formatted_10 = inner_9.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  134         -
        let header_value = formatted_10;
  135         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  136         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  137         -
                "copy_source_if_unmodified_since",
  138         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  139         -
            )
  140         -
        })?;
  141         -
        builder = builder.header("x-amz-copy-source-if-unmodified-since", header_value);
         142  +
        if !formatted_10.is_empty() {
         143  +
            let header_value = formatted_10;
         144  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         145  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         146  +
                    "copy_source_if_unmodified_since",
         147  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         148  +
                )
         149  +
            })?;
         150  +
            builder = builder.header("x-amz-copy-source-if-unmodified-since", header_value);
         151  +
        }
  142    152   
    }
  143    153   
    if let ::std::option::Option::Some(inner_11) = &input.copy_source_range {
  144    154   
        let formatted_12 = inner_11.as_str();
  145         -
        let header_value = formatted_12;
  146         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  147         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  148         -
                "copy_source_range",
  149         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  150         -
            )
  151         -
        })?;
  152         -
        builder = builder.header("x-amz-copy-source-range", header_value);
         155  +
        if !formatted_12.is_empty() {
         156  +
            let header_value = formatted_12;
         157  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         158  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         159  +
                    "copy_source_range",
         160  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         161  +
                )
         162  +
            })?;
         163  +
            builder = builder.header("x-amz-copy-source-range", header_value);
         164  +
        }
  153    165   
    }
  154    166   
    if let ::std::option::Option::Some(inner_13) = &input.sse_customer_algorithm {
  155    167   
        let formatted_14 = inner_13.as_str();
  156         -
        let header_value = formatted_14;
  157         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  158         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  159         -
                "sse_customer_algorithm",
  160         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  161         -
            )
  162         -
        })?;
  163         -
        builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         168  +
        if !formatted_14.is_empty() {
         169  +
            let header_value = formatted_14;
         170  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         171  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         172  +
                    "sse_customer_algorithm",
         173  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         174  +
                )
         175  +
            })?;
         176  +
            builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         177  +
        }
  164    178   
    }
  165    179   
    if let ::std::option::Option::Some(inner_15) = &input.sse_customer_key {
  166    180   
        let formatted_16 = inner_15.as_str();
  167         -
        let header_value = formatted_16;
  168         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  169         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  170         -
                "sse_customer_key",
  171         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  172         -
            )
  173         -
        })?;
  174         -
        builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         181  +
        if !formatted_16.is_empty() {
         182  +
            let header_value = formatted_16;
         183  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         184  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         185  +
                    "sse_customer_key",
         186  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         187  +
                )
         188  +
            })?;
         189  +
            builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         190  +
        }
  175    191   
    }
  176    192   
    if let ::std::option::Option::Some(inner_17) = &input.sse_customer_key_md5 {
  177    193   
        let formatted_18 = inner_17.as_str();
  178         -
        let header_value = formatted_18;
  179         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  180         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  181         -
                "sse_customer_key_md5",
  182         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  183         -
            )
  184         -
        })?;
  185         -
        builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         194  +
        if !formatted_18.is_empty() {
         195  +
            let header_value = formatted_18;
         196  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         197  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         198  +
                    "sse_customer_key_md5",
         199  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         200  +
                )
         201  +
            })?;
         202  +
            builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         203  +
        }
  186    204   
    }
  187    205   
    if let ::std::option::Option::Some(inner_19) = &input.copy_source_sse_customer_algorithm {
  188    206   
        let formatted_20 = inner_19.as_str();
  189         -
        let header_value = formatted_20;
  190         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  191         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  192         -
                "copy_source_sse_customer_algorithm",
  193         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  194         -
            )
  195         -
        })?;
  196         -
        builder = builder.header("x-amz-copy-source-server-side-encryption-customer-algorithm", header_value);
         207  +
        if !formatted_20.is_empty() {
         208  +
            let header_value = formatted_20;
         209  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         210  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         211  +
                    "copy_source_sse_customer_algorithm",
         212  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         213  +
                )
         214  +
            })?;
         215  +
            builder = builder.header("x-amz-copy-source-server-side-encryption-customer-algorithm", header_value);
         216  +
        }
  197    217   
    }
  198    218   
    if let ::std::option::Option::Some(inner_21) = &input.copy_source_sse_customer_key {
  199    219   
        let formatted_22 = inner_21.as_str();
  200         -
        let header_value = formatted_22;
  201         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  202         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  203         -
                "copy_source_sse_customer_key",
  204         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  205         -
            )
  206         -
        })?;
  207         -
        builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key", header_value);
         220  +
        if !formatted_22.is_empty() {
         221  +
            let header_value = formatted_22;
         222  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         223  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         224  +
                    "copy_source_sse_customer_key",
         225  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         226  +
                )
         227  +
            })?;
         228  +
            builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key", header_value);
         229  +
        }
  208    230   
    }
  209    231   
    if let ::std::option::Option::Some(inner_23) = &input.copy_source_sse_customer_key_md5 {
  210    232   
        let formatted_24 = inner_23.as_str();
  211         -
        let header_value = formatted_24;
  212         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  213         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  214         -
                "copy_source_sse_customer_key_md5",
  215         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  216         -
            )
  217         -
        })?;
  218         -
        builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key-MD5", header_value);
         233  +
        if !formatted_24.is_empty() {
         234  +
            let header_value = formatted_24;
         235  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         236  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         237  +
                    "copy_source_sse_customer_key_md5",
         238  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         239  +
                )
         240  +
            })?;
         241  +
            builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key-MD5", header_value);
         242  +
        }
  219    243   
    }
  220    244   
    if let ::std::option::Option::Some(inner_25) = &input.request_payer {
  221    245   
        let formatted_26 = inner_25.as_str();
  222         -
        let header_value = formatted_26;
  223         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  224         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  225         -
                "request_payer",
  226         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  227         -
            )
  228         -
        })?;
  229         -
        builder = builder.header("x-amz-request-payer", header_value);
         246  +
        if !formatted_26.is_empty() {
         247  +
            let header_value = formatted_26;
         248  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         249  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         250  +
                    "request_payer",
         251  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         252  +
                )
         253  +
            })?;
         254  +
            builder = builder.header("x-amz-request-payer", header_value);
         255  +
        }
  230    256   
    }
  231    257   
    if let ::std::option::Option::Some(inner_27) = &input.expected_bucket_owner {
  232    258   
        let formatted_28 = inner_27.as_str();
  233         -
        let header_value = formatted_28;
  234         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  235         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  236         -
                "expected_bucket_owner",
  237         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  238         -
            )
  239         -
        })?;
  240         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         259  +
        if !formatted_28.is_empty() {
         260  +
            let header_value = formatted_28;
         261  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         262  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         263  +
                    "expected_bucket_owner",
         264  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         265  +
                )
         266  +
            })?;
         267  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         268  +
        }
  241    269   
    }
  242    270   
    if let ::std::option::Option::Some(inner_29) = &input.expected_source_bucket_owner {
  243    271   
        let formatted_30 = inner_29.as_str();
  244         -
        let header_value = formatted_30;
  245         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  246         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  247         -
                "expected_source_bucket_owner",
  248         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  249         -
            )
  250         -
        })?;
  251         -
        builder = builder.header("x-amz-source-expected-bucket-owner", header_value);
         272  +
        if !formatted_30.is_empty() {
         273  +
            let header_value = formatted_30;
         274  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         275  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         276  +
                    "expected_source_bucket_owner",
         277  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         278  +
                )
         279  +
            })?;
         280  +
            builder = builder.header("x-amz-source-expected-bucket-owner", header_value);
         281  +
        }
  252    282   
    }
  253    283   
    Ok(builder)
  254    284   
}