Unverified Commit 331df348 authored by Nugine's avatar Nugine
Browse files

codegen: aws_proxy: revert checksum hack

parent ff308686
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -43,14 +43,14 @@ pub fn codegen(ops: &Operations, rust_types: &RustTypes, g: &mut Codegen) {
                    s => s,
                };

                // hack
                if op.name == "PutObject" && field.type_ == "ChecksumAlgorithm" {
                    assert!(field.option_type);
                    let default_val = "aws_sdk_s3::model::ChecksumAlgorithm::Sha256";
                    let val = f!("try_into_aws(input.{s3s_field_name})?.or(Some({default_val}))");
                    g.ln(f!("b = b.set_{aws_field_name}({val});"));
                    continue;
                }
                // // hack
                // if op.name == "PutObject" && field.type_ == "ChecksumAlgorithm" {
                //     assert!(field.option_type);
                //     let default_val = "aws_sdk_s3::model::ChecksumAlgorithm::Sha256";
                //     let val = f!("try_into_aws(input.{s3s_field_name})?.or(Some({default_val}))");
                //     g.ln(f!("b = b.set_{aws_field_name}({val});"));
                //     continue;
                // }

                if field.option_type {
                    g.ln(f!("b = b.set_{aws_field_name}(try_into_aws(input.{s3s_field_name})?);"));
+0 −2
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@ mod generated;
use s3s::s3_error;
use s3s::{S3Error, S3Result};



pub trait AwsConversion: Sized {
    type Target;
    type Error;
+1 −3
Original line number Diff line number Diff line
@@ -1801,9 +1801,7 @@ impl S3 for Proxy {
        b = b.set_bucket(Some(try_into_aws(input.bucket)?));
        b = b.set_bucket_key_enabled(Some(try_into_aws(input.bucket_key_enabled)?));
        b = b.set_cache_control(try_into_aws(input.cache_control)?);
        b = b.set_checksum_algorithm(
            try_into_aws(input.checksum_algorithm)?.or(Some(aws_sdk_s3::model::ChecksumAlgorithm::Sha256)),
        );
        b = b.set_checksum_algorithm(try_into_aws(input.checksum_algorithm)?);
        b = b.set_checksum_crc32(try_into_aws(input.checksum_crc32)?);
        b = b.set_checksum_crc32_c(try_into_aws(input.checksum_crc32c)?);
        b = b.set_checksum_sha1(try_into_aws(input.checksum_sha1)?);