AWS SDK

AWS SDK

rev. a25ccedd311e7562a03a1cd07d728cef10c9474c

Files changed:

tmp-codegen-diff/aws-sdk/sdk/glacier/src/protocol_serde/shape_upload_archive.rs

@@ -110,110 +161,165 @@
  130    130   
        output.build()
  131    131   
    })
  132    132   
}
  133    133   
  134    134   
pub fn ser_upload_archive_headers(
  135    135   
    input: &crate::operation::upload_archive::UploadArchiveInput,
  136    136   
    mut builder: ::http::request::Builder,
  137    137   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  138    138   
    if let ::std::option::Option::Some(inner_1) = &input.archive_description {
  139    139   
        let formatted_2 = inner_1.as_str();
  140         -
        let header_value = formatted_2;
  141         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  142         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  143         -
                "archive_description",
  144         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  145         -
            )
  146         -
        })?;
  147         -
        builder = builder.header("x-amz-archive-description", header_value);
         140  +
        if !formatted_2.is_empty() {
         141  +
            let header_value = formatted_2;
         142  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         143  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         144  +
                    "archive_description",
         145  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         146  +
                )
         147  +
            })?;
         148  +
            builder = builder.header("x-amz-archive-description", header_value);
         149  +
        }
  148    150   
    }
  149    151   
    if let ::std::option::Option::Some(inner_3) = &input.checksum {
  150    152   
        let formatted_4 = inner_3.as_str();
  151         -
        let header_value = formatted_4;
  152         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  153         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  154         -
                "checksum",
  155         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  156         -
            )
  157         -
        })?;
  158         -
        builder = builder.header("x-amz-sha256-tree-hash", header_value);
         153  +
        if !formatted_4.is_empty() {
         154  +
            let header_value = formatted_4;
         155  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         156  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         157  +
                    "checksum",
         158  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         159  +
                )
         160  +
            })?;
         161  +
            builder = builder.header("x-amz-sha256-tree-hash", header_value);
         162  +
        }
  159    163   
    }
  160    164   
    Ok(builder)
  161    165   
}

tmp-codegen-diff/aws-sdk/sdk/glacier/src/protocol_serde/shape_upload_multipart_part.rs

@@ -109,109 +160,164 @@
  129    129   
        output.build()
  130    130   
    })
  131    131   
}
  132    132   
  133    133   
pub fn ser_upload_multipart_part_headers(
  134    134   
    input: &crate::operation::upload_multipart_part::UploadMultipartPartInput,
  135    135   
    mut builder: ::http::request::Builder,
  136    136   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  137    137   
    if let ::std::option::Option::Some(inner_1) = &input.checksum {
  138    138   
        let formatted_2 = inner_1.as_str();
  139         -
        let header_value = formatted_2;
  140         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  141         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  142         -
                "checksum",
  143         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  144         -
            )
  145         -
        })?;
  146         -
        builder = builder.header("x-amz-sha256-tree-hash", header_value);
         139  +
        if !formatted_2.is_empty() {
         140  +
            let header_value = formatted_2;
         141  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         142  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         143  +
                    "checksum",
         144  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         145  +
                )
         146  +
            })?;
         147  +
            builder = builder.header("x-amz-sha256-tree-hash", header_value);
         148  +
        }
  147    149   
    }
  148    150   
    if let ::std::option::Option::Some(inner_3) = &input.range {
  149    151   
        let formatted_4 = inner_3.as_str();
  150         -
        let header_value = formatted_4;
  151         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  152         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  153         -
                "range",
  154         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  155         -
            )
  156         -
        })?;
  157         -
        builder = builder.header("Content-Range", header_value);
         152  +
        if !formatted_4.is_empty() {
         153  +
            let header_value = formatted_4;
         154  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         155  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         156  +
                    "range",
         157  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         158  +
                )
         159  +
            })?;
         160  +
            builder = builder.header("Content-Range", header_value);
         161  +
        }
  158    162   
    }
  159    163   
    Ok(builder)
  160    164   
}

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

@@ -46,46 +106,106 @@
   66     66   
[dependencies.once_cell]
   67     67   
version = "1.16"
   68     68   
   69     69   
[dependencies.regex-lite]
   70     70   
version = "0.1.5"
   71     71   
   72     72   
[dependencies.tracing]
   73     73   
version = "0.1"
   74     74   
[dev-dependencies.aws-config]
   75     75   
path = "../aws-config"
   76         -
version = "1.5.9"
          76  +
version = "1.5.8"
   77     77   
   78     78   
[dev-dependencies.aws-credential-types]
   79     79   
path = "../aws-credential-types"
   80     80   
features = ["test-util"]
   81     81   
version = "1.2.1"
   82     82   
   83     83   
[dev-dependencies.aws-runtime]
   84     84   
path = "../aws-runtime"
   85     85   
features = ["test-util"]
   86     86   
version = "1.4.3"

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

@@ -41,41 +101,101 @@
   61     61   
[dependencies.once_cell]
   62     62   
version = "1.16"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tracing]
   68     68   
version = "0.1"
   69     69   
[dev-dependencies.aws-config]
   70     70   
path = "../aws-config"
   71         -
version = "1.5.9"
          71  +
version = "1.5.8"
   72     72   
   73     73   
[dev-dependencies.aws-credential-types]
   74     74   
path = "../aws-credential-types"
   75     75   
features = ["test-util"]
   76     76   
version = "1.2.1"
   77     77   
   78     78   
[dev-dependencies.aws-runtime]
   79     79   
path = "../aws-runtime"
   80     80   
features = ["test-util"]
   81     81   
version = "1.4.3"

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

@@ -47,47 +107,107 @@
   67     67   
[dependencies.once_cell]
   68     68   
version = "1.16"
   69     69   
   70     70   
[dependencies.regex-lite]
   71     71   
version = "0.1.5"
   72     72   
   73     73   
[dependencies.tracing]
   74     74   
version = "0.1"
   75     75   
[dev-dependencies.aws-config]
   76     76   
path = "../aws-config"
   77         -
version = "1.5.9"
          77  +
version = "1.5.8"
   78     78   
   79     79   
[dev-dependencies.aws-credential-types]
   80     80   
path = "../aws-credential-types"
   81     81   
features = ["test-util"]
   82     82   
version = "1.2.1"
   83     83   
   84     84   
[dev-dependencies.aws-runtime]
   85     85   
path = "../aws-runtime"
   86     86   
features = ["test-util"]
   87     87   
version = "1.4.3"

tmp-codegen-diff/aws-sdk/sdk/lambda/src/protocol_serde/shape_invoke.rs

@@ -502,502 +564,570 @@
  522    522   
        output.build()
  523    523   
    })
  524    524   
}
  525    525   
  526    526   
pub fn ser_invoke_headers(
  527    527   
    input: &crate::operation::invoke::InvokeInput,
  528    528   
    mut builder: ::http::request::Builder,
  529    529   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  530    530   
    if let ::std::option::Option::Some(inner_1) = &input.invocation_type {
  531    531   
        let formatted_2 = inner_1.as_str();
  532         -
        let header_value = formatted_2;
  533         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  534         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  535         -
                "invocation_type",
  536         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  537         -
            )
  538         -
        })?;
  539         -
        builder = builder.header("X-Amz-Invocation-Type", header_value);
         532  +
        if !formatted_2.is_empty() {
         533  +
            let header_value = formatted_2;
         534  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         535  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         536  +
                    "invocation_type",
         537  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         538  +
                )
         539  +
            })?;
         540  +
            builder = builder.header("X-Amz-Invocation-Type", header_value);
         541  +
        }
  540    542   
    }
  541    543   
    if let ::std::option::Option::Some(inner_3) = &input.log_type {
  542    544   
        let formatted_4 = inner_3.as_str();
  543         -
        let header_value = formatted_4;
  544         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  545         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  546         -
                "log_type",
  547         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  548         -
            )
  549         -
        })?;
  550         -
        builder = builder.header("X-Amz-Log-Type", header_value);
         545  +
        if !formatted_4.is_empty() {
         546  +
            let header_value = formatted_4;
         547  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         548  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         549  +
                    "log_type",
         550  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         551  +
                )
         552  +
            })?;
         553  +
            builder = builder.header("X-Amz-Log-Type", header_value);
         554  +
        }
  551    555   
    }
  552    556   
    if let ::std::option::Option::Some(inner_5) = &input.client_context {
  553    557   
        let formatted_6 = inner_5.as_str();
  554         -
        let header_value = formatted_6;
  555         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  556         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  557         -
                "client_context",
  558         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  559         -
            )
  560         -
        })?;
  561         -
        builder = builder.header("X-Amz-Client-Context", header_value);
         558  +
        if !formatted_6.is_empty() {
         559  +
            let header_value = formatted_6;
         560  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         561  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         562  +
                    "client_context",
         563  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         564  +
                )
         565  +
            })?;
         566  +
            builder = builder.header("X-Amz-Client-Context", header_value);
         567  +
        }
  562    568   
    }
  563    569   
    Ok(builder)
  564    570   
}

tmp-codegen-diff/aws-sdk/sdk/lambda/src/protocol_serde/shape_invoke_with_response_stream.rs

@@ -539,539 +601,607 @@
  559    559   
        _ => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::generic(generic),
  560    560   
    })
  561    561   
}
  562    562   
  563    563   
pub fn ser_invoke_with_response_stream_headers(
  564    564   
    input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
  565    565   
    mut builder: ::http::request::Builder,
  566    566   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  567    567   
    if let ::std::option::Option::Some(inner_1) = &input.invocation_type {
  568    568   
        let formatted_2 = inner_1.as_str();
  569         -
        let header_value = formatted_2;
  570         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  571         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  572         -
                "invocation_type",
  573         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  574         -
            )
  575         -
        })?;
  576         -
        builder = builder.header("X-Amz-Invocation-Type", header_value);
         569  +
        if !formatted_2.is_empty() {
         570  +
            let header_value = formatted_2;
         571  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         572  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         573  +
                    "invocation_type",
         574  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         575  +
                )
         576  +
            })?;
         577  +
            builder = builder.header("X-Amz-Invocation-Type", header_value);
         578  +
        }
  577    579   
    }
  578    580   
    if let ::std::option::Option::Some(inner_3) = &input.log_type {
  579    581   
        let formatted_4 = inner_3.as_str();
  580         -
        let header_value = formatted_4;
  581         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  582         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  583         -
                "log_type",
  584         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  585         -
            )
  586         -
        })?;
  587         -
        builder = builder.header("X-Amz-Log-Type", header_value);
         582  +
        if !formatted_4.is_empty() {
         583  +
            let header_value = formatted_4;
         584  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         585  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         586  +
                    "log_type",
         587  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         588  +
                )
         589  +
            })?;
         590  +
            builder = builder.header("X-Amz-Log-Type", header_value);
         591  +
        }
  588    592   
    }
  589    593   
    if let ::std::option::Option::Some(inner_5) = &input.client_context {
  590    594   
        let formatted_6 = inner_5.as_str();
  591         -
        let header_value = formatted_6;
  592         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  593         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  594         -
                "client_context",
  595         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  596         -
            )
  597         -
        })?;
  598         -
        builder = builder.header("X-Amz-Client-Context", header_value);
         595  +
        if !formatted_6.is_empty() {
         596  +
            let header_value = formatted_6;
         597  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         598  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         599  +
                    "client_context",
         600  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         601  +
                )
         602  +
            })?;
         603  +
            builder = builder.header("X-Amz-Client-Context", header_value);
         604  +
        }
  599    605   
    }
  600    606   
    Ok(builder)
  601    607   
}

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

@@ -1,1 +115,115 @@
   17     17   
[dependencies.aws-credential-types]
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.1"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
version = "1.4.3"
   24     24   
   25     25   
[dependencies.aws-sigv4]
   26     26   
path = "../aws-sigv4"
   27         -
version = "1.2.5"
          27  +
version = "1.2.4"
   28     28   
   29     29   
[dependencies.aws-smithy-async]
   30     30   
path = "../aws-smithy-async"
   31     31   
version = "1.2.1"
   32     32   
   33     33   
[dependencies.aws-smithy-http]
   34     34   
path = "../aws-smithy-http"
   35     35   
version = "0.60.11"
   36     36   
   37     37   
[dependencies.aws-smithy-json]
   38     38   
path = "../aws-smithy-json"
   39     39   
version = "0.60.7"
   40     40   
   41     41   
[dependencies.aws-smithy-runtime]
   42     42   
path = "../aws-smithy-runtime"
   43     43   
features = ["client"]
   44     44   
version = "1.7.3"
   45     45   
   46     46   
[dependencies.aws-smithy-runtime-api]
   47     47   
path = "../aws-smithy-runtime-api"
   48     48   
features = ["client", "http-02x"]
   49     49   
version = "1.7.2"
   50     50   
   51     51   
[dependencies.aws-smithy-types]
   52     52   
path = "../aws-smithy-types"
   53     53   
version = "1.2.8"
   54     54   
   55     55   
[dependencies.aws-types]
   56     56   
path = "../aws-types"
   57     57   
version = "1.3.3"
   58     58   
   59     59   
[dependencies.bytes]
   60     60   
version = "1.4.0"
   61     61   
   62     62   
[dependencies.http]
   63     63   
version = "0.2.9"
   64     64   
   65     65   
[dependencies.http-1x]
   66     66   
version = "1"
   67     67   
optional = true
   68     68   
package = "http"
   69     69   
   70     70   
[dependencies.http-body-1x]
   71     71   
version = "1"
   72     72   
optional = true
   73     73   
package = "http-body"
   74     74   
   75     75   
[dependencies.once_cell]
   76     76   
version = "1.16"
   77     77   
   78     78   
[dependencies.regex-lite]
   79     79   
version = "0.1.5"
   80     80   
   81     81   
[dependencies.tracing]
   82     82   
version = "0.1"
   83     83   
[dev-dependencies.aws-config]
   84     84   
path = "../aws-config"
   85         -
version = "1.5.9"
          85  +
version = "1.5.8"
   86     86   
   87     87   
[dev-dependencies.aws-credential-types]
   88     88   
path = "../aws-credential-types"
   89     89   
features = ["test-util"]
   90     90   
version = "1.2.1"
   91     91   
   92     92   
[dev-dependencies.aws-runtime]
   93     93   
path = "../aws-runtime"
   94     94   
features = ["test-util"]
   95     95   
version = "1.4.3"

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

@@ -41,41 +101,101 @@
   61     61   
[dependencies.once_cell]
   62     62   
version = "1.16"
   63     63   
   64     64   
[dependencies.regex-lite]
   65     65   
version = "0.1.5"
   66     66   
   67     67   
[dependencies.tracing]
   68     68   
version = "0.1"
   69     69   
[dev-dependencies.aws-config]
   70     70   
path = "../aws-config"
   71         -
version = "1.5.9"
          71  +
version = "1.5.8"
   72     72   
   73     73   
[dev-dependencies.aws-credential-types]
   74     74   
path = "../aws-credential-types"
   75     75   
features = ["test-util"]
   76     76   
version = "1.2.1"
   77     77   
   78     78   
[dev-dependencies.aws-runtime]
   79     79   
path = "../aws-runtime"
   80     80   
features = ["test-util"]
   81     81   
version = "1.4.3"

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

@@ -42,42 +100,100 @@
   62     62   
[dependencies.once_cell]
   63     63   
version = "1.16"
   64     64   
   65     65   
[dependencies.regex-lite]
   66     66   
version = "0.1.5"
   67     67   
   68     68   
[dependencies.tracing]
   69     69   
version = "0.1"
   70     70   
[dev-dependencies.aws-config]
   71     71   
path = "../aws-config"
   72         -
version = "1.5.9"
          72  +
version = "1.5.8"
   73     73   
   74     74   
[dev-dependencies.aws-credential-types]
   75     75   
path = "../aws-credential-types"
   76     76   
features = ["test-util"]
   77     77   
version = "1.2.1"
   78     78   
   79     79   
[dev-dependencies.aws-smithy-runtime]
   80     80   
path = "../aws-smithy-runtime"
   81     81   
features = ["client", "test-util"]
   82     82   
version = "1.7.3"

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

@@ -1,1 +66,66 @@
   18     18   
path = "../aws-credential-types"
   19     19   
version = "1.2.1"
   20     20   
   21     21   
[dependencies.aws-runtime]
   22     22   
path = "../aws-runtime"
   23     23   
features = ["event-stream", "http-02x"]
   24     24   
version = "1.4.3"
   25     25   
   26     26   
[dependencies.aws-sigv4]
   27     27   
path = "../aws-sigv4"
   28         -
version = "1.2.5"
          28  +
version = "1.2.4"
   29     29   
   30     30   
[dependencies.aws-smithy-async]
   31     31   
path = "../aws-smithy-async"
   32     32   
version = "1.2.1"
   33     33   
   34     34   
[dependencies.aws-smithy-checksums]
   35     35   
path = "../aws-smithy-checksums"
   36         -
version = "0.60.13"
          36  +
version = "0.60.12"
   37     37   
   38     38   
[dependencies.aws-smithy-eventstream]
   39     39   
path = "../aws-smithy-eventstream"
   40     40   
version = "0.60.5"
   41     41   
   42     42   
[dependencies.aws-smithy-http]
   43     43   
path = "../aws-smithy-http"
   44     44   
features = ["event-stream"]
   45     45   
version = "0.60.11"
   46     46   
@@ -97,97 +157,157 @@
  117    117   
version = "0.1"
  118    118   
  119    119   
[dependencies.url]
  120    120   
version = "2.3.1"
  121    121   
[dev-dependencies.async-std]
  122    122   
version = "1.12.0"
  123    123   
  124    124   
[dev-dependencies.aws-config]
  125    125   
path = "../aws-config"
  126    126   
features = ["behavior-version-latest"]
  127         -
version = "1.5.9"
         127  +
version = "1.5.8"
  128    128   
  129    129   
[dev-dependencies.aws-credential-types]
  130    130   
path = "../aws-credential-types"
  131    131   
features = ["test-util"]
  132    132   
version = "1.2.1"
  133    133   
  134    134   
[dev-dependencies.aws-runtime]
  135    135   
path = "../aws-runtime"
  136    136   
features = ["test-util"]
  137    137   
version = "1.4.3"

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

@@ -44,44 +95,99 @@
   64     64   
        output.build()
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
pub fn ser_abort_multipart_upload_headers(
   69     69   
    input: &crate::operation::abort_multipart_upload::AbortMultipartUploadInput,
   70     70   
    mut builder: ::http::request::Builder,
   71     71   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   72     72   
    if let ::std::option::Option::Some(inner_1) = &input.request_payer {
   73     73   
        let formatted_2 = inner_1.as_str();
   74         -
        let header_value = formatted_2;
   75         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   76         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   77         -
                "request_payer",
   78         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   79         -
            )
   80         -
        })?;
   81         -
        builder = builder.header("x-amz-request-payer", header_value);
          74  +
        if !formatted_2.is_empty() {
          75  +
            let header_value = formatted_2;
          76  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          77  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          78  +
                    "request_payer",
          79  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          80  +
                )
          81  +
            })?;
          82  +
            builder = builder.header("x-amz-request-payer", header_value);
          83  +
        }
   82     84   
    }
   83     85   
    if let ::std::option::Option::Some(inner_3) = &input.expected_bucket_owner {
   84     86   
        let formatted_4 = inner_3.as_str();
   85         -
        let header_value = formatted_4;
   86         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   87         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   88         -
                "expected_bucket_owner",
   89         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   90         -
            )
   91         -
        })?;
   92         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
          87  +
        if !formatted_4.is_empty() {
          88  +
            let header_value = formatted_4;
          89  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
          90  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
          91  +
                    "expected_bucket_owner",
          92  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          93  +
                )
          94  +
            })?;
          95  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
          96  +
        }
   93     97   
    }
   94     98   
    Ok(builder)
   95     99   
}

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

@@ -60,60 +215,233 @@
   80     80   
        output.build()
   81     81   
    })
   82     82   
}
   83     83   
   84     84   
pub fn ser_complete_multipart_upload_headers(
   85     85   
    input: &crate::operation::complete_multipart_upload::CompleteMultipartUploadInput,
   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.checksum_crc32 {
   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         -
                "checksum_crc32",
   94         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   95         -
            )
   96         -
        })?;
   97         -
        builder = builder.header("x-amz-checksum-crc32", 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  +
                    "checksum_crc32",
          95  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
          96  +
                )
          97  +
            })?;
          98  +
            builder = builder.header("x-amz-checksum-crc32", header_value);
          99  +
        }
   98    100   
    }
   99    101   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_crc32_c {
  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         -
                "checksum_crc32_c",
  105         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  106         -
            )
  107         -
        })?;
  108         -
        builder = builder.header("x-amz-checksum-crc32c", 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  +
                    "checksum_crc32_c",
         108  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         109  +
                )
         110  +
            })?;
         111  +
            builder = builder.header("x-amz-checksum-crc32c", header_value);
         112  +
        }
  109    113   
    }
  110    114   
    if let ::std::option::Option::Some(inner_5) = &input.checksum_sha1 {
  111    115   
        let formatted_6 = inner_5.as_str();
  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         -
                "checksum_sha1",
  116         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  117         -
            )
  118         -
        })?;
  119         -
        builder = builder.header("x-amz-checksum-sha1", 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  +
                    "checksum_sha1",
         121  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         122  +
                )
         123  +
            })?;
         124  +
            builder = builder.header("x-amz-checksum-sha1", header_value);
         125  +
        }
  120    126   
    }
  121    127   
    if let ::std::option::Option::Some(inner_7) = &input.checksum_sha256 {
  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         -
                "checksum_sha256",
  127         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  128         -
            )
  129         -
        })?;
  130         -
        builder = builder.header("x-amz-checksum-sha256", 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  +
                    "checksum_sha256",
         134  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         135  +
                )
         136  +
            })?;
         137  +
            builder = builder.header("x-amz-checksum-sha256", header_value);
         138  +
        }
  131    139   
    }
  132    140   
    if let ::std::option::Option::Some(inner_9) = &input.request_payer {
  133    141   
        let formatted_10 = inner_9.as_str();
  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         -
                "request_payer",
  138         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  139         -
            )
  140         -
        })?;
  141         -
        builder = builder.header("x-amz-request-payer", 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  +
                    "request_payer",
         147  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         148  +
                )
         149  +
            })?;
         150  +
            builder = builder.header("x-amz-request-payer", header_value);
         151  +
        }
  142    152   
    }
  143    153   
    if let ::std::option::Option::Some(inner_11) = &input.expected_bucket_owner {
  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         -
                "expected_bucket_owner",
  149         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  150         -
            )
  151         -
        })?;
  152         -
        builder = builder.header("x-amz-expected-bucket-owner", 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  +
                    "expected_bucket_owner",
         160  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         161  +
                )
         162  +
            })?;
         163  +
            builder = builder.header("x-amz-expected-bucket-owner", 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   
    Ok(builder)
  188    206   
}
  189    207   
  190    208   
#[allow(unused_mut)]
  191    209   
pub fn de_complete_multipart_upload(
  192    210   
    inp: &[u8],
  193    211   
    mut builder: crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadOutputBuilder,
  194    212   
) -> Result<crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
  195    213   
    let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;

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

@@ -97,97 +566,642 @@
  117    117   
        output.build()
  118    118   
    })
  119    119   
}
  120    120   
  121    121   
pub fn ser_copy_object_headers(
  122    122   
    input: &crate::operation::copy_object::CopyObjectInput,
  123    123   
    mut builder: ::http::request::Builder,
  124    124   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  125    125   
    if let ::std::option::Option::Some(inner_1) = &input.acl {
  126    126   
        let formatted_2 = inner_1.as_str();
  127         -
        let header_value = formatted_2;
  128         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  129         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  130         -
                "acl",
  131         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  132         -
            )
  133         -
        })?;
  134         -
        builder = builder.header("x-amz-acl", header_value);
         127  +
        if !formatted_2.is_empty() {
         128  +
            let header_value = formatted_2;
         129  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         130  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         131  +
                    "acl",
         132  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         133  +
                )
         134  +
            })?;
         135  +
            builder = builder.header("x-amz-acl", header_value);
         136  +
        }
  135    137   
    }
  136    138   
    if let ::std::option::Option::Some(inner_3) = &input.cache_control {
  137    139   
        let formatted_4 = inner_3.as_str();
  138         -
        let header_value = formatted_4;
  139         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  140         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  141         -
                "cache_control",
  142         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  143         -
            )
  144         -
        })?;
  145         -
        builder = builder.header("Cache-Control", header_value);
         140  +
        if !formatted_4.is_empty() {
         141  +
            let header_value = formatted_4;
         142  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         143  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         144  +
                    "cache_control",
         145  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         146  +
                )
         147  +
            })?;
         148  +
            builder = builder.header("Cache-Control", header_value);
         149  +
        }
  146    150   
    }
  147    151   
    if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
  148    152   
        let formatted_6 = inner_5.as_str();
  149         -
        let header_value = formatted_6;
  150         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  151         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  152         -
                "checksum_algorithm",
  153         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  154         -
            )
  155         -
        })?;
  156         -
        builder = builder.header("x-amz-checksum-algorithm", header_value);
         153  +
        if !formatted_6.is_empty() {
         154  +
            let header_value = formatted_6;
         155  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         156  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         157  +
                    "checksum_algorithm",
         158  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         159  +
                )
         160  +
            })?;
         161  +
            builder = builder.header("x-amz-checksum-algorithm", header_value);
         162  +
        }
  157    163   
    }
  158    164   
    if let ::std::option::Option::Some(inner_7) = &input.content_disposition {
  159    165   
        let formatted_8 = inner_7.as_str();
  160         -
        let header_value = formatted_8;
  161         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  162         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  163         -
                "content_disposition",
  164         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  165         -
            )
  166         -
        })?;
  167         -
        builder = builder.header("Content-Disposition", header_value);
         166  +
        if !formatted_8.is_empty() {
         167  +
            let header_value = formatted_8;
         168  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         169  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         170  +
                    "content_disposition",
         171  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         172  +
                )
         173  +
            })?;
         174  +
            builder = builder.header("Content-Disposition", header_value);
         175  +
        }
  168    176   
    }
  169    177   
    if let ::std::option::Option::Some(inner_9) = &input.content_encoding {
  170    178   
        let formatted_10 = inner_9.as_str();
  171         -
        let header_value = formatted_10;
  172         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  173         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  174         -
                "content_encoding",
  175         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  176         -
            )
  177         -
        })?;
  178         -
        builder = builder.header("Content-Encoding", header_value);
         179  +
        if !formatted_10.is_empty() {
         180  +
            let header_value = formatted_10;
         181  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         182  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         183  +
                    "content_encoding",
         184  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         185  +
                )
         186  +
            })?;
         187  +
            builder = builder.header("Content-Encoding", header_value);
         188  +
        }
  179    189   
    }
  180    190   
    if let ::std::option::Option::Some(inner_11) = &input.content_language {
  181    191   
        let formatted_12 = inner_11.as_str();
  182         -
        let header_value = formatted_12;
  183         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  184         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  185         -
                "content_language",
  186         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  187         -
            )
  188         -
        })?;
  189         -
        builder = builder.header("Content-Language", header_value);
         192  +
        if !formatted_12.is_empty() {
         193  +
            let header_value = formatted_12;
         194  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         195  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         196  +
                    "content_language",
         197  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         198  +
                )
         199  +
            })?;
         200  +
            builder = builder.header("Content-Language", header_value);
         201  +
        }
  190    202   
    }
  191    203   
    if let ::std::option::Option::Some(inner_13) = &input.content_type {
  192    204   
        let formatted_14 = inner_13.as_str();
  193         -
        let header_value = formatted_14;
  194         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  195         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  196         -
                "content_type",
  197         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  198         -
            )
  199         -
        })?;
  200         -
        builder = builder.header("Content-Type", header_value);
         205  +
        if !formatted_14.is_empty() {
         206  +
            let header_value = formatted_14;
         207  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         208  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         209  +
                    "content_type",
         210  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         211  +
                )
         212  +
            })?;
         213  +
            builder = builder.header("Content-Type", header_value);
         214  +
        }
  201    215   
    }
  202    216   
    if let ::std::option::Option::Some(inner_15) = &input.copy_source {
  203    217   
        let formatted_16 = inner_15.as_str();
  204         -
        let header_value = formatted_16;
  205         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  206         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  207         -
                "copy_source",
  208         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  209         -
            )
  210         -
        })?;
  211         -
        builder = builder.header("x-amz-copy-source", header_value);
         218  +
        if !formatted_16.is_empty() {
         219  +
            let header_value = formatted_16;
         220  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         221  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         222  +
                    "copy_source",
         223  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         224  +
                )
         225  +
            })?;
         226  +
            builder = builder.header("x-amz-copy-source", header_value);
         227  +
        }
  212    228   
    }
  213    229   
    if let ::std::option::Option::Some(inner_17) = &input.copy_source_if_match {
  214    230   
        let formatted_18 = inner_17.as_str();
  215         -
        let header_value = formatted_18;
  216         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  217         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  218         -
                "copy_source_if_match",
  219         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  220         -
            )
  221         -
        })?;
  222         -
        builder = builder.header("x-amz-copy-source-if-match", header_value);
         231  +
        if !formatted_18.is_empty() {
         232  +
            let header_value = formatted_18;
         233  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         234  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         235  +
                    "copy_source_if_match",
         236  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         237  +
                )
         238  +
            })?;
         239  +
            builder = builder.header("x-amz-copy-source-if-match", header_value);
         240  +
        }
  223    241   
    }
  224    242   
    if let ::std::option::Option::Some(inner_19) = &input.copy_source_if_modified_since {
  225    243   
        let formatted_20 = inner_19.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  226         -
        let header_value = formatted_20;
  227         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  228         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  229         -
                "copy_source_if_modified_since",
  230         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  231         -
            )
  232         -
        })?;
  233         -
        builder = builder.header("x-amz-copy-source-if-modified-since", header_value);
         244  +
        if !formatted_20.is_empty() {
         245  +
            let header_value = formatted_20;
         246  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         247  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         248  +
                    "copy_source_if_modified_since",
         249  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         250  +
                )
         251  +
            })?;
         252  +
            builder = builder.header("x-amz-copy-source-if-modified-since", header_value);
         253  +
        }
  234    254   
    }
  235    255   
    if let ::std::option::Option::Some(inner_21) = &input.copy_source_if_none_match {
  236    256   
        let formatted_22 = inner_21.as_str();
  237         -
        let header_value = formatted_22;
  238         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  239         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  240         -
                "copy_source_if_none_match",
  241         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  242         -
            )
  243         -
        })?;
  244         -
        builder = builder.header("x-amz-copy-source-if-none-match", header_value);
         257  +
        if !formatted_22.is_empty() {
         258  +
            let header_value = formatted_22;
         259  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         260  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         261  +
                    "copy_source_if_none_match",
         262  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         263  +
                )
         264  +
            })?;
         265  +
            builder = builder.header("x-amz-copy-source-if-none-match", header_value);
         266  +
        }
  245    267   
    }
  246    268   
    if let ::std::option::Option::Some(inner_23) = &input.copy_source_if_unmodified_since {
  247    269   
        let formatted_24 = inner_23.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  248         -
        let header_value = formatted_24;
  249         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  250         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  251         -
                "copy_source_if_unmodified_since",
  252         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  253         -
            )
  254         -
        })?;
  255         -
        builder = builder.header("x-amz-copy-source-if-unmodified-since", header_value);
         270  +
        if !formatted_24.is_empty() {
         271  +
            let header_value = formatted_24;
         272  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         273  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         274  +
                    "copy_source_if_unmodified_since",
         275  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         276  +
                )
         277  +
            })?;
         278  +
            builder = builder.header("x-amz-copy-source-if-unmodified-since", header_value);
         279  +
        }
  256    280   
    }
  257    281   
    if let ::std::option::Option::Some(inner_25) = &input.expires {
  258    282   
        let formatted_26 = inner_25.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
  259         -
        let header_value = formatted_26;
  260         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  261         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  262         -
                "expires",
  263         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  264         -
            )
  265         -
        })?;
  266         -
        builder = builder.header("Expires", header_value);
         283  +
        if !formatted_26.is_empty() {
         284  +
            let header_value = formatted_26;
         285  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         286  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         287  +
                    "expires",
         288  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         289  +
                )
         290  +
            })?;
         291  +
            builder = builder.header("Expires", header_value);
         292  +
        }
  267    293   
    }
  268    294   
    if let ::std::option::Option::Some(inner_27) = &input.grant_full_control {
  269    295   
        let formatted_28 = inner_27.as_str();
  270         -
        let header_value = formatted_28;
  271         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  272         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  273         -
                "grant_full_control",
  274         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  275         -
            )
  276         -
        })?;
  277         -
        builder = builder.header("x-amz-grant-full-control", header_value);
         296  +
        if !formatted_28.is_empty() {
         297  +
            let header_value = formatted_28;
         298  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         299  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         300  +
                    "grant_full_control",
         301  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         302  +
                )
         303  +
            })?;
         304  +
            builder = builder.header("x-amz-grant-full-control", header_value);
         305  +
        }
  278    306   
    }
  279    307   
    if let ::std::option::Option::Some(inner_29) = &input.grant_read {
  280    308   
        let formatted_30 = inner_29.as_str();
  281         -
        let header_value = formatted_30;
  282         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  283         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  284         -
                "grant_read",
  285         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  286         -
            )
  287         -
        })?;
  288         -
        builder = builder.header("x-amz-grant-read", header_value);
         309  +
        if !formatted_30.is_empty() {
         310  +
            let header_value = formatted_30;
         311  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         312  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         313  +
                    "grant_read",
         314  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         315  +
                )
         316  +
            })?;
         317  +
            builder = builder.header("x-amz-grant-read", header_value);
         318  +
        }
  289    319   
    }
  290    320   
    if let ::std::option::Option::Some(inner_31) = &input.grant_read_acp {
  291    321   
        let formatted_32 = inner_31.as_str();
  292         -
        let header_value = formatted_32;
  293         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  294         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  295         -
                "grant_read_acp",
  296         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  297         -
            )
  298         -
        })?;
  299         -
        builder = builder.header("x-amz-grant-read-acp", header_value);
         322  +
        if !formatted_32.is_empty() {
         323  +
            let header_value = formatted_32;
         324  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         325  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         326  +
                    "grant_read_acp",
         327  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         328  +
                )
         329  +
            })?;
         330  +
            builder = builder.header("x-amz-grant-read-acp", header_value);
         331  +
        }
  300    332   
    }
  301    333   
    if let ::std::option::Option::Some(inner_33) = &input.grant_write_acp {
  302    334   
        let formatted_34 = inner_33.as_str();
  303         -
        let header_value = formatted_34;
  304         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  305         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  306         -
                "grant_write_acp",
  307         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  308         -
            )
  309         -
        })?;
  310         -
        builder = builder.header("x-amz-grant-write-acp", header_value);
         335  +
        if !formatted_34.is_empty() {
         336  +
            let header_value = formatted_34;
         337  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         338  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         339  +
                    "grant_write_acp",
         340  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         341  +
                )
         342  +
            })?;
         343  +
            builder = builder.header("x-amz-grant-write-acp", header_value);
         344  +
        }
  311    345   
    }
  312    346   
    if let ::std::option::Option::Some(inner_35) = &input.metadata_directive {
  313    347   
        let formatted_36 = inner_35.as_str();
  314         -
        let header_value = formatted_36;
  315         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  316         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  317         -
                "metadata_directive",
  318         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  319         -
            )
  320         -
        })?;
  321         -
        builder = builder.header("x-amz-metadata-directive", header_value);
         348  +
        if !formatted_36.is_empty() {
         349  +
            let header_value = formatted_36;
         350  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         351  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         352  +
                    "metadata_directive",
         353  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         354  +
                )
         355  +
            })?;
         356  +
            builder = builder.header("x-amz-metadata-directive", header_value);
         357  +
        }
  322    358   
    }
  323    359   
    if let ::std::option::Option::Some(inner_37) = &input.tagging_directive {
  324    360   
        let formatted_38 = inner_37.as_str();
  325         -
        let header_value = formatted_38;
  326         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  327         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  328         -
                "tagging_directive",
  329         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  330         -
            )
  331         -
        })?;
  332         -
        builder = builder.header("x-amz-tagging-directive", header_value);
         361  +
        if !formatted_38.is_empty() {
         362  +
            let header_value = formatted_38;
         363  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         364  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         365  +
                    "tagging_directive",
         366  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         367  +
                )
         368  +
            })?;
         369  +
            builder = builder.header("x-amz-tagging-directive", header_value);
         370  +
        }
  333    371   
    }
  334    372   
    if let ::std::option::Option::Some(inner_39) = &input.server_side_encryption {
  335    373   
        let formatted_40 = inner_39.as_str();
  336         -
        let header_value = formatted_40;
  337         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  338         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  339         -
                "server_side_encryption",
  340         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  341         -
            )
  342         -
        })?;
  343         -
        builder = builder.header("x-amz-server-side-encryption", header_value);
         374  +
        if !formatted_40.is_empty() {
         375  +
            let header_value = formatted_40;
         376  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         377  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         378  +
                    "server_side_encryption",
         379  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         380  +
                )
         381  +
            })?;
         382  +
            builder = builder.header("x-amz-server-side-encryption", header_value);
         383  +
        }
  344    384   
    }
  345    385   
    if let ::std::option::Option::Some(inner_41) = &input.storage_class {
  346    386   
        let formatted_42 = inner_41.as_str();
  347         -
        let header_value = formatted_42;
  348         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  349         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  350         -
                "storage_class",
  351         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  352         -
            )
  353         -
        })?;
  354         -
        builder = builder.header("x-amz-storage-class", header_value);
         387  +
        if !formatted_42.is_empty() {
         388  +
            let header_value = formatted_42;
         389  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         390  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         391  +
                    "storage_class",
         392  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         393  +
                )
         394  +
            })?;
         395  +
            builder = builder.header("x-amz-storage-class", header_value);
         396  +
        }
  355    397   
    }
  356    398   
    if let ::std::option::Option::Some(inner_43) = &input.website_redirect_location {
  357    399   
        let formatted_44 = inner_43.as_str();
  358         -
        let header_value = formatted_44;
  359         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  360         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  361         -
                "website_redirect_location",
  362         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  363         -
            )
  364         -
        })?;
  365         -
        builder = builder.header("x-amz-website-redirect-location", header_value);
         400  +
        if !formatted_44.is_empty() {
         401  +
            let header_value = formatted_44;
         402  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         403  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         404  +
                    "website_redirect_location",
         405  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         406  +
                )
         407  +
            })?;
         408  +
            builder = builder.header("x-amz-website-redirect-location", header_value);
         409  +
        }
  366    410   
    }
  367    411   
    if let ::std::option::Option::Some(inner_45) = &input.sse_customer_algorithm {
  368    412   
        let formatted_46 = inner_45.as_str();
  369         -
        let header_value = formatted_46;
  370         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  371         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  372         -
                "sse_customer_algorithm",
  373         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  374         -
            )
  375         -
        })?;
  376         -
        builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         413  +
        if !formatted_46.is_empty() {
         414  +
            let header_value = formatted_46;
         415  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         416  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         417  +
                    "sse_customer_algorithm",
         418  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         419  +
                )
         420  +
            })?;
         421  +
            builder = builder.header("x-amz-server-side-encryption-customer-algorithm", header_value);
         422  +
        }
  377    423   
    }
  378    424   
    if let ::std::option::Option::Some(inner_47) = &input.sse_customer_key {
  379    425   
        let formatted_48 = inner_47.as_str();
  380         -
        let header_value = formatted_48;
  381         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  382         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  383         -
                "sse_customer_key",
  384         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  385         -
            )
  386         -
        })?;
  387         -
        builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         426  +
        if !formatted_48.is_empty() {
         427  +
            let header_value = formatted_48;
         428  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         429  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         430  +
                    "sse_customer_key",
         431  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         432  +
                )
         433  +
            })?;
         434  +
            builder = builder.header("x-amz-server-side-encryption-customer-key", header_value);
         435  +
        }
  388    436   
    }
  389    437   
    if let ::std::option::Option::Some(inner_49) = &input.sse_customer_key_md5 {
  390    438   
        let formatted_50 = inner_49.as_str();
  391         -
        let header_value = formatted_50;
  392         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  393         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  394         -
                "sse_customer_key_md5",
  395         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  396         -
            )
  397         -
        })?;
  398         -
        builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         439  +
        if !formatted_50.is_empty() {
         440  +
            let header_value = formatted_50;
         441  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         442  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         443  +
                    "sse_customer_key_md5",
         444  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         445  +
                )
         446  +
            })?;
         447  +
            builder = builder.header("x-amz-server-side-encryption-customer-key-MD5", header_value);
         448  +
        }
  399    449   
    }
  400    450   
    if let ::std::option::Option::Some(inner_51) = &input.ssekms_key_id {
  401    451   
        let formatted_52 = inner_51.as_str();
  402         -
        let header_value = formatted_52;
  403         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  404         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  405         -
                "ssekms_key_id",
  406         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  407         -
            )
  408         -
        })?;
  409         -
        builder = builder.header("x-amz-server-side-encryption-aws-kms-key-id", header_value);
         452  +
        if !formatted_52.is_empty() {
         453  +
            let header_value = formatted_52;
         454  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         455  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         456  +
                    "ssekms_key_id",
         457  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         458  +
                )
         459  +
            })?;
         460  +
            builder = builder.header("x-amz-server-side-encryption-aws-kms-key-id", header_value);
         461  +
        }
  410    462   
    }
  411    463   
    if let ::std::option::Option::Some(inner_53) = &input.ssekms_encryption_context {
  412    464   
        let formatted_54 = inner_53.as_str();
  413         -
        let header_value = formatted_54;
  414         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  415         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  416         -
                "ssekms_encryption_context",
  417         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  418         -
            )
  419         -
        })?;
  420         -
        builder = builder.header("x-amz-server-side-encryption-context", header_value);
         465  +
        if !formatted_54.is_empty() {
         466  +
            let header_value = formatted_54;
         467  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         468  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         469  +
                    "ssekms_encryption_context",
         470  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         471  +
                )
         472  +
            })?;
         473  +
            builder = builder.header("x-amz-server-side-encryption-context", header_value);
         474  +
        }
  421    475   
    }
  422    476   
    if let ::std::option::Option::Some(inner_55) = &input.bucket_key_enabled {
  423    477   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_55);
  424    478   
        let formatted_56 = encoder.encode();
  425         -
        let header_value = formatted_56;
  426         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  427         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  428         -
                "bucket_key_enabled",
  429         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  430         -
            )
  431         -
        })?;
  432         -
        builder = builder.header("x-amz-server-side-encryption-bucket-key-enabled", header_value);
         479  +
        if !formatted_56.is_empty() {
         480  +
            let header_value = formatted_56;
         481  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         482  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         483  +
                    "bucket_key_enabled",
         484  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         485  +
                )
         486  +
            })?;
         487  +
            builder = builder.header("x-amz-server-side-encryption-bucket-key-enabled", header_value);
         488  +
        }
  433    489   
    }
  434    490   
    if let ::std::option::Option::Some(inner_57) = &input.copy_source_sse_customer_algorithm {
  435    491   
        let formatted_58 = inner_57.as_str();
  436         -
        let header_value = formatted_58;
  437         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  438         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  439         -
                "copy_source_sse_customer_algorithm",
  440         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  441         -
            )
  442         -
        })?;
  443         -
        builder = builder.header("x-amz-copy-source-server-side-encryption-customer-algorithm", header_value);
         492  +
        if !formatted_58.is_empty() {
         493  +
            let header_value = formatted_58;
         494  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         495  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         496  +
                    "copy_source_sse_customer_algorithm",
         497  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         498  +
                )
         499  +
            })?;
         500  +
            builder = builder.header("x-amz-copy-source-server-side-encryption-customer-algorithm", header_value);
         501  +
        }
  444    502   
    }
  445    503   
    if let ::std::option::Option::Some(inner_59) = &input.copy_source_sse_customer_key {
  446    504   
        let formatted_60 = inner_59.as_str();
  447         -
        let header_value = formatted_60;
  448         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  449         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  450         -
                "copy_source_sse_customer_key",
  451         -
                format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
  452         -
            )
  453         -
        })?;
  454         -
        builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key", header_value);
         505  +
        if !formatted_60.is_empty() {
         506  +
            let header_value = formatted_60;
         507  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         508  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         509  +
                    "copy_source_sse_customer_key",
         510  +
                    format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err),
         511  +
                )
         512  +
            })?;
         513  +
            builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key", header_value);
         514  +
        }
  455    515   
    }
  456    516   
    if let ::std::option::Option::Some(inner_61) = &input.copy_source_sse_customer_key_md5 {
  457    517   
        let formatted_62 = inner_61.as_str();
  458         -
        let header_value = formatted_62;
  459         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  460         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  461         -
                "copy_source_sse_customer_key_md5",
  462         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  463         -
            )
  464         -
        })?;
  465         -
        builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key-MD5", header_value);
         518  +
        if !formatted_62.is_empty() {
         519  +
            let header_value = formatted_62;
         520  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         521  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         522  +
                    "copy_source_sse_customer_key_md5",
         523  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         524  +
                )
         525  +
            })?;
         526  +
            builder = builder.header("x-amz-copy-source-server-side-encryption-customer-key-MD5", header_value);
         527  +
        }
  466    528   
    }
  467    529   
    if let ::std::option::Option::Some(inner_63) = &input.request_payer {
  468    530   
        let formatted_64 = inner_63.as_str();
  469         -
        let header_value = formatted_64;
  470         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  471         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  472         -
                "request_payer",
  473         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  474         -
            )
  475         -
        })?;
  476         -
        builder = builder.header("x-amz-request-payer", header_value);
         531  +
        if !formatted_64.is_empty() {
         532  +
            let header_value = formatted_64;
         533  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         534  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         535  +
                    "request_payer",
         536  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         537  +
                )
         538  +
            })?;
         539  +
            builder = builder.header("x-amz-request-payer", header_value);
         540  +
        }
  477    541   
    }
  478    542   
    if let ::std::option::Option::Some(inner_65) = &input.tagging {
  479    543   
        let formatted_66 = inner_65.as_str();
  480         -
        let header_value = formatted_66;
  481         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  482         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  483         -
                "tagging",
  484         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  485         -
            )
  486         -
        })?;
  487         -
        builder = builder.header("x-amz-tagging", header_value);
         544  +
        if !formatted_66.is_empty() {
         545  +
            let header_value = formatted_66;
         546  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         547  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         548  +
                    "tagging",
         549  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         550  +
                )
         551  +
            })?;
         552  +
            builder = builder.header("x-amz-tagging", header_value);
         553  +
        }
  488    554   
    }
  489    555   
    if let ::std::option::Option::Some(inner_67) = &input.object_lock_mode {
  490    556   
        let formatted_68 = inner_67.as_str();
  491         -
        let header_value = formatted_68;
  492         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  493         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  494         -
                "object_lock_mode",
  495         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  496         -
            )
  497         -
        })?;
  498         -
        builder = builder.header("x-amz-object-lock-mode", header_value);
         557  +
        if !formatted_68.is_empty() {
         558  +
            let header_value = formatted_68;
         559  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         560  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         561  +
                    "object_lock_mode",
         562  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         563  +
                )
         564  +
            })?;
         565  +
            builder = builder.header("x-amz-object-lock-mode", header_value);
         566  +
        }
  499    567   
    }
  500    568   
    if let ::std::option::Option::Some(inner_69) = &input.object_lock_retain_until_date {
  501    569   
        let formatted_70 = inner_69.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
  502         -
        let header_value = formatted_70;
  503         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  504         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  505         -
                "object_lock_retain_until_date",
  506         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  507         -
            )
  508         -
        })?;
  509         -
        builder = builder.header("x-amz-object-lock-retain-until-date", header_value);
         570  +
        if !formatted_70.is_empty() {
         571  +
            let header_value = formatted_70;
         572  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         573  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         574  +
                    "object_lock_retain_until_date",
         575  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         576  +
                )
         577  +
            })?;
         578  +
            builder = builder.header("x-amz-object-lock-retain-until-date", header_value);
         579  +
        }
  510    580   
    }
  511    581   
    if let ::std::option::Option::Some(inner_71) = &input.object_lock_legal_hold_status {
  512    582   
        let formatted_72 = inner_71.as_str();
  513         -
        let header_value = formatted_72;
  514         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  515         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  516         -
                "object_lock_legal_hold_status",
  517         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  518         -
            )
  519         -
        })?;
  520         -
        builder = builder.header("x-amz-object-lock-legal-hold", header_value);
         583  +
        if !formatted_72.is_empty() {
         584  +
            let header_value = formatted_72;
         585  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         586  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         587  +
                    "object_lock_legal_hold_status",
         588  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         589  +
                )
         590  +
            })?;
         591  +
            builder = builder.header("x-amz-object-lock-legal-hold", header_value);
         592  +
        }
  521    593   
    }
  522    594   
    if let ::std::option::Option::Some(inner_73) = &input.expected_bucket_owner {
  523    595   
        let formatted_74 = inner_73.as_str();
  524         -
        let header_value = formatted_74;
  525         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  526         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  527         -
                "expected_bucket_owner",
  528         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  529         -
            )
  530         -
        })?;
  531         -
        builder = builder.header("x-amz-expected-bucket-owner", header_value);
         596  +
        if !formatted_74.is_empty() {
         597  +
            let header_value = formatted_74;
         598  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         599  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         600  +
                    "expected_bucket_owner",
         601  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         602  +
                )
         603  +
            })?;
         604  +
            builder = builder.header("x-amz-expected-bucket-owner", header_value);
         605  +
        }
  532    606   
    }
  533    607   
    if let ::std::option::Option::Some(inner_75) = &input.expected_source_bucket_owner {
  534    608   
        let formatted_76 = inner_75.as_str();
  535         -
        let header_value = formatted_76;
  536         -
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  537         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  538         -
                "expected_source_bucket_owner",
  539         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  540         -
            )
  541         -
        })?;
  542         -
        builder = builder.header("x-amz-source-expected-bucket-owner", header_value);
         609  +
        if !formatted_76.is_empty() {
         610  +
            let header_value = formatted_76;
         611  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         612  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         613  +
                    "expected_source_bucket_owner",
         614  +
                    format!("`{}` cannot be used as a header value: {}", &header_value, err),
         615  +
                )
         616  +
            })?;
         617  +
            builder = builder.header("x-amz-source-expected-bucket-owner", header_value);
         618  +
        }
  543    619   
    }
  544    620   
    if let ::std::option::Option::Some(inner_77) = &input.metadata {
  545    621   
        {
  546    622   
            for (k, v) in inner_77 {
  547    623   
                use std::str::FromStr;
  548    624   
                let header_name = http::header::HeaderName::from_str(&format!("{}{}", "x-amz-meta-", &k)).map_err(|err| {
  549    625   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  550    626   
                        "metadata",
  551    627   
                        format!("`{k}` cannot be used as a header name: {err}"),
  552    628   
                    )