131 135 |
|
132 136 | #[derive(Debug)]
|
133 137 | struct JsonUnionsResponseDeserializer;
|
134 138 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for JsonUnionsResponseDeserializer {
|
135 139 | fn deserialize_nonstreaming_with_config(
|
136 140 | &self,
|
137 141 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
138 142 | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
139 143 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
140 144 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
141 - | let headers = response.headers();
|
145 + | // Load body and headers BEFORE BeforeParseResponse so customizations
|
146 + | // (e.g., S3's `body_is_error` check that detects errors returned with
|
147 + | // HTTP 200) can inspect them. The legacy non-streaming path also
|
148 + | // loads `body` before firing this hook.
|
142 149 | let body = response.body().bytes().expect("body loaded");
|
150 + | let headers = response.headers();
|
143 151 | #[allow(unused_mut)]
|
144 152 | let mut force_error = false;
|
145 153 |
|
146 - | let parse_result = if !success && status != 200 || force_error {
|
147 - | crate::protocol_serde::shape_json_unions::de_json_unions_http_error(status, headers, body)
|
154 + | if !success && status != 200 || force_error {
|
155 + | let protocol = _cfg
|
156 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
157 + | .expect("a SharedClientProtocol is required");
|
158 + | #[allow(unused_mut)]
|
159 + | let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
|
160 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
161 + | })?;
|
162 + |
|
163 + | let generic = generic_builder.build();
|
164 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
165 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(crate::operation::json_unions::JsonUnionsError::generic(
|
166 + | generic,
|
167 + | )),
|
168 + | ))
|
148 169 | } else {
|
149 - | crate::protocol_serde::shape_json_unions::de_json_unions_http_response(status, headers, body)
|
150 - | };
|
151 - | crate::protocol_serde::type_erase_result(parse_result)
|
170 + | let protocol = _cfg
|
171 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
172 + | .expect("a SharedClientProtocol is required");
|
173 + | let mut deser = protocol.deserialize_response(response, JsonUnions::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
174 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
175 + | })?;
|
176 + | // body and headers are already in scope from the top of the function;
|
177 + | // alias `headers` as `_response_headers` so MutateOutput
|
178 + | // customizations have a stable name to read from.
|
179 + | let _response_headers = headers;
|
180 + | #[allow(unused_mut)]
|
181 + | let mut output = crate::operation::json_unions::JsonUnionsOutput::deserialize_with_response(
|
182 + | &mut *deser,
|
183 + | _response_headers,
|
184 + | response.status().into(),
|
185 + | body,
|
186 + | )
|
187 + | .map_err(|e| {
|
188 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
189 + | })?;
|
190 + |
|
191 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
192 + | }
|
152 193 | }
|
153 194 | }
|
154 195 | #[derive(Debug)]
|
155 196 | struct JsonUnionsRequestSerializer;
|
156 197 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for JsonUnionsRequestSerializer {
|
157 198 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
158 199 | fn serialize_input(
|
159 200 | &self,
|
160 201 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
161 202 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
162 203 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
163 204 | let input = input.downcast::<crate::operation::json_unions::JsonUnionsInput>().expect("correct type");
|
164 - | let _header_serialization_settings = _cfg
|
165 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
166 - | .cloned()
|
167 - | .unwrap_or_default();
|
168 - | let mut request_builder = {
|
169 - | #[allow(clippy::uninlined_format_args)]
|
170 - | fn uri_base(
|
171 - | _input: &crate::operation::json_unions::JsonUnionsInput,
|
172 - | output: &mut ::std::string::String,
|
173 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
174 - | use ::std::fmt::Write as _;
|
175 - | ::std::write!(output, "/").expect("formatting should succeed");
|
176 - | ::std::result::Result::Ok(())
|
177 - | }
|
178 - | #[allow(clippy::unnecessary_wraps)]
|
179 - | fn update_http_builder(
|
180 - | input: &crate::operation::json_unions::JsonUnionsInput,
|
181 - | builder: ::http_1x::request::Builder,
|
182 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
183 - | let mut uri = ::std::string::String::new();
|
184 - | uri_base(input, &mut uri)?;
|
185 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
186 - | }
|
187 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
188 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
189 - | builder = _header_serialization_settings.set_default_header(
|
190 - | builder,
|
191 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
192 - | "JsonRpc10.JsonUnions",
|
193 - | );
|
194 - | builder
|
195 - | };
|
196 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_json_unions::ser_json_unions_input(&input)?);
|
197 - | if let Some(content_length) = body.content_length() {
|
198 - | let content_length = content_length.to_string();
|
199 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
200 - | }
|
201 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
205 + |
|
206 + | let protocol = _cfg
|
207 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
208 + | .expect("a SharedClientProtocol is required");
|
209 + | let mut request = protocol
|
210 + | .serialize_request(&input, JsonUnions::INPUT_SCHEMA, "/", _cfg)
|
211 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
212 + |
|
213 + | return ::std::result::Result::Ok(request);
|
202 214 | }
|
203 215 | }
|
204 216 | #[derive(Debug)]
|
205 217 | struct JsonUnionsEndpointParamsInterceptor;
|
206 218 |
|
207 219 | #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
|
208 220 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for JsonUnionsEndpointParamsInterceptor {
|
209 221 | fn name(&self) -> &'static str {
|
210 222 | "JsonUnionsEndpointParamsInterceptor"
|
211 223 | }
|
622 634 |
|
623 635 | let op = crate::operation::json_unions::JsonUnions::new();
|
624 636 | let config = op.config().expect("the operation has config");
|
625 637 | let de = config
|
626 638 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
627 639 | .expect("the config must have a deserializer");
|
628 640 |
|
629 641 | // Build a config bag with the protocol for schema-based deserialization
|
630 642 | #[allow(unused_mut)]
|
631 643 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
644 + | {
|
645 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
646 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
647 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
648 + | ));
|
649 + | test_cfg.push_shared_layer(layer.freeze());
|
650 + | }
|
632 651 |
|
633 652 | let parsed = de.deserialize_streaming(&mut http_response);
|
634 653 | let parsed = parsed.unwrap_or_else(|| {
|
635 654 | let http_response = http_response.map(|body| {
|
636 655 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
637 656 | body.bytes().unwrap(),
|
638 657 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
639 658 | )))
|
640 659 | });
|
641 660 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
642 661 | });
|
643 662 | let parsed = parsed
|
644 663 | .expect("should be successful response")
|
645 664 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
646 665 | .unwrap();
|
647 666 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
648 667 | }
|
649 668 |
|
650 669 | /// Deserializes a boolean union value
|
651 670 | /// Test ID: AwsJson10DeserializeBooleanUnionValue
|
652 671 | #[::tokio::test]
|
653 672 | #[::tracing_test::traced_test]
|
654 673 | async fn aws_json10_deserialize_boolean_union_value_response() {
|
655 674 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
656 675 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::BooleanValue(true)))
|
657 676 | .build();
|
658 677 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
659 678 | ::http_1x::response::Builder::new()
|
660 679 | .header("Content-Type", "application/x-amz-json-1.0")
|
661 680 | .status(200)
|
662 681 | .body(::aws_smithy_types::body::SdkBody::from(
|
663 682 | "{\n \"contents\": {\n \"booleanValue\": true\n }\n}",
|
664 683 | ))
|
665 684 | .unwrap(),
|
666 685 | )
|
667 686 | .unwrap();
|
668 687 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
669 688 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
670 689 |
|
671 690 | let op = crate::operation::json_unions::JsonUnions::new();
|
672 691 | let config = op.config().expect("the operation has config");
|
673 692 | let de = config
|
674 693 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
675 694 | .expect("the config must have a deserializer");
|
676 695 |
|
677 696 | // Build a config bag with the protocol for schema-based deserialization
|
678 697 | #[allow(unused_mut)]
|
679 698 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
699 + | {
|
700 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
701 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
702 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
703 + | ));
|
704 + | test_cfg.push_shared_layer(layer.freeze());
|
705 + | }
|
680 706 |
|
681 707 | let parsed = de.deserialize_streaming(&mut http_response);
|
682 708 | let parsed = parsed.unwrap_or_else(|| {
|
683 709 | let http_response = http_response.map(|body| {
|
684 710 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
685 711 | body.bytes().unwrap(),
|
686 712 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
687 713 | )))
|
688 714 | });
|
689 715 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
690 716 | });
|
691 717 | let parsed = parsed
|
692 718 | .expect("should be successful response")
|
693 719 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
694 720 | .unwrap();
|
695 721 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
696 722 | }
|
697 723 |
|
698 724 | /// Deserializes a number union value
|
699 725 | /// Test ID: AwsJson10DeserializeNumberUnionValue
|
700 726 | #[::tokio::test]
|
701 727 | #[::tracing_test::traced_test]
|
702 728 | async fn aws_json10_deserialize_number_union_value_response() {
|
703 729 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
704 730 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::NumberValue(1)))
|
705 731 | .build();
|
706 732 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
707 733 | ::http_1x::response::Builder::new()
|
708 734 | .header("Content-Type", "application/x-amz-json-1.0")
|
709 735 | .status(200)
|
710 736 | .body(::aws_smithy_types::body::SdkBody::from(
|
711 737 | "{\n \"contents\": {\n \"numberValue\": 1\n }\n}",
|
712 738 | ))
|
713 739 | .unwrap(),
|
714 740 | )
|
715 741 | .unwrap();
|
716 742 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
717 743 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
718 744 |
|
719 745 | let op = crate::operation::json_unions::JsonUnions::new();
|
720 746 | let config = op.config().expect("the operation has config");
|
721 747 | let de = config
|
722 748 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
723 749 | .expect("the config must have a deserializer");
|
724 750 |
|
725 751 | // Build a config bag with the protocol for schema-based deserialization
|
726 752 | #[allow(unused_mut)]
|
727 753 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
754 + | {
|
755 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
756 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
757 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
758 + | ));
|
759 + | test_cfg.push_shared_layer(layer.freeze());
|
760 + | }
|
728 761 |
|
729 762 | let parsed = de.deserialize_streaming(&mut http_response);
|
730 763 | let parsed = parsed.unwrap_or_else(|| {
|
731 764 | let http_response = http_response.map(|body| {
|
732 765 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
733 766 | body.bytes().unwrap(),
|
734 767 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
735 768 | )))
|
736 769 | });
|
737 770 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
738 771 | });
|
739 772 | let parsed = parsed
|
740 773 | .expect("should be successful response")
|
741 774 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
742 775 | .unwrap();
|
743 776 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
744 777 | }
|
745 778 |
|
746 779 | /// Deserializes a blob union value
|
747 780 | /// Test ID: AwsJson10DeserializeBlobUnionValue
|
748 781 | #[::tokio::test]
|
749 782 | #[::tracing_test::traced_test]
|
750 783 | async fn aws_json10_deserialize_blob_union_value_response() {
|
751 784 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
752 785 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::BlobValue(
|
753 786 | ::aws_smithy_types::Blob::new("foo"),
|
754 787 | )))
|
755 788 | .build();
|
756 789 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
757 790 | ::http_1x::response::Builder::new()
|
758 791 | .header("Content-Type", "application/x-amz-json-1.0")
|
759 792 | .status(200)
|
760 793 | .body(::aws_smithy_types::body::SdkBody::from(
|
761 794 | "{\n \"contents\": {\n \"blobValue\": \"Zm9v\"\n }\n}",
|
762 795 | ))
|
763 796 | .unwrap(),
|
764 797 | )
|
765 798 | .unwrap();
|
766 799 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
767 800 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
768 801 |
|
769 802 | let op = crate::operation::json_unions::JsonUnions::new();
|
770 803 | let config = op.config().expect("the operation has config");
|
771 804 | let de = config
|
772 805 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
773 806 | .expect("the config must have a deserializer");
|
774 807 |
|
775 808 | // Build a config bag with the protocol for schema-based deserialization
|
776 809 | #[allow(unused_mut)]
|
777 810 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
811 + | {
|
812 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
813 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
814 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
815 + | ));
|
816 + | test_cfg.push_shared_layer(layer.freeze());
|
817 + | }
|
778 818 |
|
779 819 | let parsed = de.deserialize_streaming(&mut http_response);
|
780 820 | let parsed = parsed.unwrap_or_else(|| {
|
781 821 | let http_response = http_response.map(|body| {
|
782 822 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
783 823 | body.bytes().unwrap(),
|
784 824 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
785 825 | )))
|
786 826 | });
|
787 827 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
788 828 | });
|
789 829 | let parsed = parsed
|
790 830 | .expect("should be successful response")
|
791 831 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
792 832 | .unwrap();
|
793 833 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
794 834 | }
|
795 835 |
|
796 836 | /// Deserializes a timestamp union value
|
797 837 | /// Test ID: AwsJson10DeserializeTimestampUnionValue
|
798 838 | #[::tokio::test]
|
799 839 | #[::tracing_test::traced_test]
|
800 840 | async fn aws_json10_deserialize_timestamp_union_value_response() {
|
801 841 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
802 842 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::TimestampValue(
|
803 843 | ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
|
804 844 | )))
|
805 845 | .build();
|
806 846 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
807 847 | ::http_1x::response::Builder::new()
|
808 848 | .header("Content-Type", "application/x-amz-json-1.0")
|
809 849 | .status(200)
|
810 850 | .body(::aws_smithy_types::body::SdkBody::from(
|
811 851 | "{\n \"contents\": {\n \"timestampValue\": 1398796238\n }\n}",
|
812 852 | ))
|
813 853 | .unwrap(),
|
814 854 | )
|
815 855 | .unwrap();
|
816 856 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
817 857 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
818 858 |
|
819 859 | let op = crate::operation::json_unions::JsonUnions::new();
|
820 860 | let config = op.config().expect("the operation has config");
|
821 861 | let de = config
|
822 862 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
823 863 | .expect("the config must have a deserializer");
|
824 864 |
|
825 865 | // Build a config bag with the protocol for schema-based deserialization
|
826 866 | #[allow(unused_mut)]
|
827 867 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
868 + | {
|
869 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
870 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
871 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
872 + | ));
|
873 + | test_cfg.push_shared_layer(layer.freeze());
|
874 + | }
|
828 875 |
|
829 876 | let parsed = de.deserialize_streaming(&mut http_response);
|
830 877 | let parsed = parsed.unwrap_or_else(|| {
|
831 878 | let http_response = http_response.map(|body| {
|
832 879 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
833 880 | body.bytes().unwrap(),
|
834 881 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
835 882 | )))
|
836 883 | });
|
837 884 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
838 885 | });
|
839 886 | let parsed = parsed
|
840 887 | .expect("should be successful response")
|
841 888 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
842 889 | .unwrap();
|
843 890 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
844 891 | }
|
845 892 |
|
846 893 | /// Deserializes an enum union value
|
847 894 | /// Test ID: AwsJson10DeserializeEnumUnionValue
|
848 895 | #[::tokio::test]
|
849 896 | #[::tracing_test::traced_test]
|
850 897 | async fn aws_json10_deserialize_enum_union_value_response() {
|
851 898 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
852 899 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::EnumValue(
|
853 900 | "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
854 901 | )))
|
855 902 | .build();
|
856 903 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
857 904 | ::http_1x::response::Builder::new()
|
858 905 | .header("Content-Type", "application/x-amz-json-1.0")
|
859 906 | .status(200)
|
860 907 | .body(::aws_smithy_types::body::SdkBody::from(
|
861 908 | "{\n \"contents\": {\n \"enumValue\": \"Foo\"\n }\n}",
|
862 909 | ))
|
863 910 | .unwrap(),
|
864 911 | )
|
865 912 | .unwrap();
|
866 913 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
867 914 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
868 915 |
|
869 916 | let op = crate::operation::json_unions::JsonUnions::new();
|
870 917 | let config = op.config().expect("the operation has config");
|
871 918 | let de = config
|
872 919 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
873 920 | .expect("the config must have a deserializer");
|
874 921 |
|
875 922 | // Build a config bag with the protocol for schema-based deserialization
|
876 923 | #[allow(unused_mut)]
|
877 924 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
925 + | {
|
926 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
927 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
928 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
929 + | ));
|
930 + | test_cfg.push_shared_layer(layer.freeze());
|
931 + | }
|
878 932 |
|
879 933 | let parsed = de.deserialize_streaming(&mut http_response);
|
880 934 | let parsed = parsed.unwrap_or_else(|| {
|
881 935 | let http_response = http_response.map(|body| {
|
882 936 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
883 937 | body.bytes().unwrap(),
|
884 938 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
885 939 | )))
|
886 940 | });
|
887 941 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
888 942 | });
|
889 943 | let parsed = parsed
|
890 944 | .expect("should be successful response")
|
891 945 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
892 946 | .unwrap();
|
893 947 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
894 948 | }
|
895 949 |
|
896 950 | /// Deserializes an intEnum union value
|
897 951 | /// Test ID: AwsJson10DeserializeIntEnumUnionValue
|
898 952 | #[::tokio::test]
|
899 953 | #[::tracing_test::traced_test]
|
900 954 | async fn aws_json10_deserialize_int_enum_union_value_response() {
|
901 955 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
902 956 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::IntEnumValue(1)))
|
903 957 | .build();
|
904 958 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
905 959 | ::http_1x::response::Builder::new()
|
906 960 | .header("Content-Type", "application/x-amz-json-1.0")
|
907 961 | .status(200)
|
908 962 | .body(::aws_smithy_types::body::SdkBody::from(
|
909 963 | "{\n \"contents\": {\n \"intEnumValue\": 1\n }\n}",
|
910 964 | ))
|
911 965 | .unwrap(),
|
912 966 | )
|
913 967 | .unwrap();
|
914 968 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
915 969 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
916 970 |
|
917 971 | let op = crate::operation::json_unions::JsonUnions::new();
|
918 972 | let config = op.config().expect("the operation has config");
|
919 973 | let de = config
|
920 974 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
921 975 | .expect("the config must have a deserializer");
|
922 976 |
|
923 977 | // Build a config bag with the protocol for schema-based deserialization
|
924 978 | #[allow(unused_mut)]
|
925 979 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
980 + | {
|
981 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
982 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
983 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
984 + | ));
|
985 + | test_cfg.push_shared_layer(layer.freeze());
|
986 + | }
|
926 987 |
|
927 988 | let parsed = de.deserialize_streaming(&mut http_response);
|
928 989 | let parsed = parsed.unwrap_or_else(|| {
|
929 990 | let http_response = http_response.map(|body| {
|
930 991 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
931 992 | body.bytes().unwrap(),
|
932 993 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
933 994 | )))
|
934 995 | });
|
935 996 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
936 997 | });
|
937 998 | let parsed = parsed
|
938 999 | .expect("should be successful response")
|
939 1000 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
940 1001 | .unwrap();
|
941 1002 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
942 1003 | }
|
943 1004 |
|
944 1005 | /// Deserializes a list union value
|
945 1006 | /// Test ID: AwsJson10DeserializeListUnionValue
|
946 1007 | #[::tokio::test]
|
947 1008 | #[::tracing_test::traced_test]
|
948 1009 | async fn aws_json10_deserialize_list_union_value_response() {
|
949 1010 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
950 1011 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::ListValue(vec![
|
951 1012 | "foo".to_owned(),
|
952 1013 | "bar".to_owned(),
|
953 1014 | ])))
|
954 1015 | .build();
|
955 1016 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
956 1017 | ::http_1x::response::Builder::new()
|
957 1018 | .header("Content-Type", "application/x-amz-json-1.0")
|
958 1019 | .status(200)
|
959 1020 | .body(::aws_smithy_types::body::SdkBody::from(
|
960 1021 | "{\n \"contents\": {\n \"listValue\": [\"foo\", \"bar\"]\n }\n}",
|
961 1022 | ))
|
962 1023 | .unwrap(),
|
963 1024 | )
|
964 1025 | .unwrap();
|
965 1026 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
966 1027 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
967 1028 |
|
968 1029 | let op = crate::operation::json_unions::JsonUnions::new();
|
969 1030 | let config = op.config().expect("the operation has config");
|
970 1031 | let de = config
|
971 1032 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
972 1033 | .expect("the config must have a deserializer");
|
973 1034 |
|
974 1035 | // Build a config bag with the protocol for schema-based deserialization
|
975 1036 | #[allow(unused_mut)]
|
976 1037 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
1038 + | {
|
1039 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
1040 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
1041 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
1042 + | ));
|
1043 + | test_cfg.push_shared_layer(layer.freeze());
|
1044 + | }
|
977 1045 |
|
978 1046 | let parsed = de.deserialize_streaming(&mut http_response);
|
979 1047 | let parsed = parsed.unwrap_or_else(|| {
|
980 1048 | let http_response = http_response.map(|body| {
|
981 1049 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
982 1050 | body.bytes().unwrap(),
|
983 1051 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
984 1052 | )))
|
985 1053 | });
|
986 1054 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
987 1055 | });
|
988 1056 | let parsed = parsed
|
989 1057 | .expect("should be successful response")
|
990 1058 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
991 1059 | .unwrap();
|
992 1060 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
993 1061 | }
|
994 1062 |
|
995 1063 | /// Deserializes a map union value
|
996 1064 | /// Test ID: AwsJson10DeserializeMapUnionValue
|
997 1065 | #[::tokio::test]
|
998 1066 | #[::tracing_test::traced_test]
|
999 1067 | async fn aws_json10_deserialize_map_union_value_response() {
|
1000 1068 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
1001 1069 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::MapValue({
|
1002 1070 | let mut ret = ::std::collections::HashMap::new();
|
1003 1071 | ret.insert("foo".to_owned(), "bar".to_owned());
|
1004 1072 | ret.insert("spam".to_owned(), "eggs".to_owned());
|
1005 1073 | ret
|
1006 1074 | })))
|
1007 1075 | .build();
|
1008 1076 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
|
1009 1077 | .header("Content-Type", "application/x-amz-json-1.0")
|
1010 1078 | .status(200)
|
1011 1079 | .body(::aws_smithy_types::body::SdkBody::from("{\n \"contents\": {\n \"mapValue\": {\n \"foo\": \"bar\",\n \"spam\": \"eggs\"\n }\n }\n}"))
|
1012 1080 | .unwrap()
|
1013 1081 | ).unwrap();
|
1014 1082 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
1015 1083 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
1016 1084 |
|
1017 1085 | let op = crate::operation::json_unions::JsonUnions::new();
|
1018 1086 | let config = op.config().expect("the operation has config");
|
1019 1087 | let de = config
|
1020 1088 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
1021 1089 | .expect("the config must have a deserializer");
|
1022 1090 |
|
1023 1091 | // Build a config bag with the protocol for schema-based deserialization
|
1024 1092 | #[allow(unused_mut)]
|
1025 1093 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
1094 + | {
|
1095 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
1096 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
1097 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
1098 + | ));
|
1099 + | test_cfg.push_shared_layer(layer.freeze());
|
1100 + | }
|
1026 1101 |
|
1027 1102 | let parsed = de.deserialize_streaming(&mut http_response);
|
1028 1103 | let parsed = parsed.unwrap_or_else(|| {
|
1029 1104 | let http_response = http_response.map(|body| {
|
1030 1105 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
1031 1106 | body.bytes().unwrap(),
|
1032 1107 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
1033 1108 | )))
|
1034 1109 | });
|
1035 1110 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
1036 1111 | });
|
1037 1112 | let parsed = parsed
|
1038 1113 | .expect("should be successful response")
|
1039 1114 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
1040 1115 | .unwrap();
|
1041 1116 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
1042 1117 | }
|
1043 1118 |
|
1044 1119 | /// Deserializes a structure union value
|
1045 1120 | /// Test ID: AwsJson10DeserializeStructureUnionValue
|
1046 1121 | #[::tokio::test]
|
1047 1122 | #[::tracing_test::traced_test]
|
1048 1123 | async fn aws_json10_deserialize_structure_union_value_response() {
|
1049 1124 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
1050 1125 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
|
1051 1126 | crate::types::GreetingStruct::builder()
|
1052 1127 | .set_hi(::std::option::Option::Some("hello".to_owned()))
|
1053 1128 | .build(),
|
1054 1129 | )))
|
1055 1130 | .build();
|
1056 1131 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
1057 1132 | ::http_1x::response::Builder::new()
|
1058 1133 | .header("Content-Type", "application/x-amz-json-1.0")
|
1059 1134 | .status(200)
|
1060 1135 | .body(::aws_smithy_types::body::SdkBody::from(
|
1061 1136 | "{\n \"contents\": {\n \"structureValue\": {\n \"hi\": \"hello\"\n }\n }\n}",
|
1062 1137 | ))
|
1063 1138 | .unwrap(),
|
1064 1139 | )
|
1065 1140 | .unwrap();
|
1066 1141 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
1067 1142 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
1068 1143 |
|
1069 1144 | let op = crate::operation::json_unions::JsonUnions::new();
|
1070 1145 | let config = op.config().expect("the operation has config");
|
1071 1146 | let de = config
|
1072 1147 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
1073 1148 | .expect("the config must have a deserializer");
|
1074 1149 |
|
1075 1150 | // Build a config bag with the protocol for schema-based deserialization
|
1076 1151 | #[allow(unused_mut)]
|
1077 1152 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
1153 + | {
|
1154 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
1155 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
1156 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
1157 + | ));
|
1158 + | test_cfg.push_shared_layer(layer.freeze());
|
1159 + | }
|
1078 1160 |
|
1079 1161 | let parsed = de.deserialize_streaming(&mut http_response);
|
1080 1162 | let parsed = parsed.unwrap_or_else(|| {
|
1081 1163 | let http_response = http_response.map(|body| {
|
1082 1164 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
1083 1165 | body.bytes().unwrap(),
|
1084 1166 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
1085 1167 | )))
|
1086 1168 | });
|
1087 1169 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
1088 1170 | });
|
1089 1171 | let parsed = parsed
|
1090 1172 | .expect("should be successful response")
|
1091 1173 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
1092 1174 | .unwrap();
|
1093 1175 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
1094 1176 | }
|
1095 1177 |
|
1096 1178 | /// Ignores an unrecognized __type property
|
1097 1179 | /// Test ID: AwsJson10DeserializeIgnoreType
|
1098 1180 | #[::tokio::test]
|
1099 1181 | #[::tracing_test::traced_test]
|
1100 1182 | async fn aws_json10_deserialize_ignore_type_response() {
|
1101 1183 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
1102 1184 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
|
1103 1185 | crate::types::GreetingStruct::builder()
|
1104 1186 | .set_hi(::std::option::Option::Some("hello".to_owned()))
|
1105 1187 | .build(),
|
1106 1188 | )))
|
1107 1189 | .build();
|
1108 1190 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
|
1109 1191 | .header("Content-Type", "application/x-amz-json-1.0")
|
1110 1192 | .status(200)
|
1111 1193 | .body(::aws_smithy_types::body::SdkBody::from("{\n \"contents\": {\n \"__type\": \"aws.protocoltests.json10#MyUnion\",\n \"structureValue\": {\n \"hi\": \"hello\"\n }\n }\n}"))
|
1112 1194 | .unwrap()
|
1113 1195 | ).unwrap();
|
1114 1196 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
1115 1197 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
1116 1198 |
|
1117 1199 | let op = crate::operation::json_unions::JsonUnions::new();
|
1118 1200 | let config = op.config().expect("the operation has config");
|
1119 1201 | let de = config
|
1120 1202 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
1121 1203 | .expect("the config must have a deserializer");
|
1122 1204 |
|
1123 1205 | // Build a config bag with the protocol for schema-based deserialization
|
1124 1206 | #[allow(unused_mut)]
|
1125 1207 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
1208 + | {
|
1209 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
1210 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
1211 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
1212 + | ));
|
1213 + | test_cfg.push_shared_layer(layer.freeze());
|
1214 + | }
|
1126 1215 |
|
1127 1216 | let parsed = de.deserialize_streaming(&mut http_response);
|
1128 1217 | let parsed = parsed.unwrap_or_else(|| {
|
1129 1218 | let http_response = http_response.map(|body| {
|
1130 1219 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
1131 1220 | body.bytes().unwrap(),
|
1132 1221 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
1133 1222 | )))
|
1134 1223 | });
|
1135 1224 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|
1136 1225 | });
|
1137 1226 | let parsed = parsed
|
1138 1227 | .expect("should be successful response")
|
1139 1228 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
1140 1229 | .unwrap();
|
1141 1230 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
1142 1231 | }
|
1143 1232 |
|
1144 1233 | /// Allows for `: null` to be set for all unset fields
|
1145 1234 | /// Test ID: AwsJson10DeserializeAllowNulls
|
1146 1235 | #[::tokio::test]
|
1147 1236 | #[::tracing_test::traced_test]
|
1148 1237 | async fn aws_json10_deserialize_allow_nulls_response() {
|
1149 1238 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
1150 1239 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
|
1151 1240 | crate::types::GreetingStruct::builder()
|
1152 1241 | .set_hi(::std::option::Option::Some("hello".to_owned()))
|
1153 1242 | .build(),
|
1154 1243 | )))
|
1155 1244 | .build();
|
1156 1245 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http_1x::response::Builder::new()
|
1157 1246 | .header("Content-Type", "application/x-amz-json-1.0")
|
1158 1247 | .status(200)
|
1159 1248 | .body(::aws_smithy_types::body::SdkBody::from("{\n \"contents\": {\n \"stringValue\": null,\n \"booleanValue\": null,\n \"numberValue\": null,\n \"blobValue\": null,\n \"timestampValue\": null,\n \"enumValue\": null,\n \"intEnumValue\": null,\n \"listValue\": null,\n \"mapValue\": null,\n \"structureValue\": {\n \"hi\": \"hello\"\n }\n }\n}"))
|
1160 1249 | .unwrap()
|
1161 1250 | ).unwrap();
|
1162 1251 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
1163 1252 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
1164 1253 |
|
1165 1254 | let op = crate::operation::json_unions::JsonUnions::new();
|
1166 1255 | let config = op.config().expect("the operation has config");
|
1167 1256 | let de = config
|
1168 1257 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
1169 1258 | .expect("the config must have a deserializer");
|
1170 1259 |
|
1171 1260 | // Build a config bag with the protocol for schema-based deserialization
|
1172 1261 | #[allow(unused_mut)]
|
1173 1262 | let mut test_cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
|
1263 + | {
|
1264 + | let mut layer = ::aws_smithy_types::config_bag::Layer::new("test_protocol");
|
1265 + | layer.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
|
1266 + | ::aws_smithy_json::protocol::aws_json_rpc::AwsJsonRpcProtocol::aws_json_1_0().with_target_prefix("JsonRpc10"),
|
1267 + | ));
|
1268 + | test_cfg.push_shared_layer(layer.freeze());
|
1269 + | }
|
1174 1270 |
|
1175 1271 | let parsed = de.deserialize_streaming(&mut http_response);
|
1176 1272 | let parsed = parsed.unwrap_or_else(|| {
|
1177 1273 | let http_response = http_response.map(|body| {
|
1178 1274 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
1179 1275 | body.bytes().unwrap(),
|
1180 1276 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
1181 1277 | )))
|
1182 1278 | });
|
1183 1279 | de.deserialize_nonstreaming_with_config(&http_response, &test_cfg)
|