619 615 | Error = ::std::convert::Infallible,
|
620 616 | > + Clone
|
621 617 | + Send
|
622 618 | + 'static,
|
623 619 | S::Future: Send + 'static,
|
624 620 | {
|
625 621 | self.escaped_string_values = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
626 622 | self
|
627 623 | }
|
628 624 |
|
629 - | /// Sets the [`HttpEnumPayload2`](crate::operation_shape::HttpEnumPayload2) operation.
|
630 - | ///
|
631 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
632 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
633 - | ///
|
634 - | /// # Example
|
635 - | ///
|
636 - | /// ```no_run
|
637 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
638 - | ///
|
639 - | /// use rest_json_extras::{input, output, error};
|
640 - | ///
|
641 - | /// async fn handler(input: input::HttpEnumPayload2Input) -> Result<output::HttpEnumPayload2Output, error::HttpEnumPayload2Error> {
|
642 - | /// todo!()
|
643 - | /// }
|
644 - | ///
|
645 - | /// let config = RestJsonExtrasConfig::builder().build();
|
646 - | /// let app = RestJsonExtras::builder(config)
|
647 - | /// .http_enum_payload2(handler)
|
648 - | /// /* Set other handlers */
|
649 - | /// .build()
|
650 - | /// .unwrap();
|
651 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
652 - | /// ```
|
653 - | ///
|
654 - | pub fn http_enum_payload2<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
655 - | where
|
656 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::HttpEnumPayload2, HandlerExtractors>,
|
657 - |
|
658 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
659 - | RestJsonExtras<L>,
|
660 - | crate::operation_shape::HttpEnumPayload2,
|
661 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::HttpEnumPayload2, HandlerType>
|
662 - | >,
|
663 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
664 - | RestJsonExtras<L>,
|
665 - | crate::operation_shape::HttpEnumPayload2,
|
666 - | ModelPl::Output
|
667 - | >,
|
668 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
669 - | RestJsonExtras<L>,
|
670 - | crate::operation_shape::HttpEnumPayload2,
|
671 - | <
|
672 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
673 - | as ::aws_smithy_http_server::plugin::Plugin<
|
674 - | RestJsonExtras<L>,
|
675 - | crate::operation_shape::HttpEnumPayload2,
|
676 - | ModelPl::Output
|
677 - | >
|
678 - | >::Output
|
679 - | >,
|
680 - |
|
681 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
682 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
683 - |
|
684 - | {
|
685 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
686 - | use ::aws_smithy_http_server::plugin::Plugin;
|
687 - | let svc = crate::operation_shape::HttpEnumPayload2::from_handler(handler);
|
688 - | let svc = self.model_plugin.apply(svc);
|
689 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
690 - | .apply(svc);
|
691 - | let svc = self.http_plugin.apply(svc);
|
692 - | self.http_enum_payload2_custom(svc)
|
693 - | }
|
694 - |
|
695 - | /// Sets the [`HttpEnumPayload2`](crate::operation_shape::HttpEnumPayload2) operation.
|
696 - | ///
|
697 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
698 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
699 - | ///
|
700 - | /// # Example
|
701 - | ///
|
702 - | /// ```no_run
|
703 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
704 - | ///
|
705 - | /// use rest_json_extras::{input, output, error};
|
706 - | ///
|
707 - | /// async fn handler(input: input::HttpEnumPayload2Input) -> Result<output::HttpEnumPayload2Output, error::HttpEnumPayload2Error> {
|
708 - | /// todo!()
|
709 - | /// }
|
710 - | ///
|
711 - | /// let config = RestJsonExtrasConfig::builder().build();
|
712 - | /// let svc = ::tower::util::service_fn(handler);
|
713 - | /// let app = RestJsonExtras::builder(config)
|
714 - | /// .http_enum_payload2_service(svc)
|
715 - | /// /* Set other handlers */
|
716 - | /// .build()
|
717 - | /// .unwrap();
|
718 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
719 - | /// ```
|
720 - | ///
|
721 - | pub fn http_enum_payload2_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
722 - | where
|
723 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::HttpEnumPayload2, ServiceExtractors>,
|
724 - |
|
725 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
726 - | RestJsonExtras<L>,
|
727 - | crate::operation_shape::HttpEnumPayload2,
|
728 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::HttpEnumPayload2, S>
|
729 - | >,
|
730 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
731 - | RestJsonExtras<L>,
|
732 - | crate::operation_shape::HttpEnumPayload2,
|
733 - | ModelPl::Output
|
734 - | >,
|
735 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
736 - | RestJsonExtras<L>,
|
737 - | crate::operation_shape::HttpEnumPayload2,
|
738 - | <
|
739 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
740 - | as ::aws_smithy_http_server::plugin::Plugin<
|
741 - | RestJsonExtras<L>,
|
742 - | crate::operation_shape::HttpEnumPayload2,
|
743 - | ModelPl::Output
|
744 - | >
|
745 - | >::Output
|
746 - | >,
|
747 - |
|
748 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
749 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
750 - |
|
751 - | {
|
752 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
753 - | use ::aws_smithy_http_server::plugin::Plugin;
|
754 - | let svc = crate::operation_shape::HttpEnumPayload2::from_service(service);
|
755 - | let svc = self.model_plugin.apply(svc);
|
756 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
757 - | .apply(svc);
|
758 - | let svc = self.http_plugin.apply(svc);
|
759 - | self.http_enum_payload2_custom(svc)
|
760 - | }
|
761 - |
|
762 - | /// Sets the [`HttpEnumPayload2`](crate::operation_shape::HttpEnumPayload2) to a custom [`Service`](tower::Service).
|
763 - | /// not constrained by the Smithy contract.
|
764 - | fn http_enum_payload2_custom<S>(mut self, svc: S) -> Self
|
765 - | where
|
766 - | S: ::tower::Service<
|
767 - | ::http::Request<Body>,
|
768 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
769 - | Error = ::std::convert::Infallible,
|
770 - | > + Clone
|
771 - | + Send
|
772 - | + 'static,
|
773 - | S::Future: Send + 'static,
|
774 - | {
|
775 - | self.http_enum_payload2 = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
776 - | self
|
777 - | }
|
778 - |
|
779 - | /// Sets the [`HttpPayloadTraits2`](crate::operation_shape::HttpPayloadTraits2) operation.
|
780 - | ///
|
781 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
782 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
783 - | ///
|
784 - | /// # Example
|
785 - | ///
|
786 - | /// ```no_run
|
787 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
788 - | ///
|
789 - | /// use rest_json_extras::{input, output, error};
|
790 - | ///
|
791 - | /// async fn handler(input: input::HttpPayloadTraits2Input) -> Result<output::HttpPayloadTraits2Output, error::HttpPayloadTraits2Error> {
|
792 - | /// todo!()
|
793 - | /// }
|
794 - | ///
|
795 - | /// let config = RestJsonExtrasConfig::builder().build();
|
796 - | /// let app = RestJsonExtras::builder(config)
|
797 - | /// .http_payload_traits2(handler)
|
798 - | /// /* Set other handlers */
|
799 - | /// .build()
|
800 - | /// .unwrap();
|
801 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
802 - | /// ```
|
803 - | ///
|
804 - | pub fn http_payload_traits2<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
805 - | where
|
806 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::HttpPayloadTraits2, HandlerExtractors>,
|
807 - |
|
808 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
809 - | RestJsonExtras<L>,
|
810 - | crate::operation_shape::HttpPayloadTraits2,
|
811 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::HttpPayloadTraits2, HandlerType>
|
812 - | >,
|
813 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
814 - | RestJsonExtras<L>,
|
815 - | crate::operation_shape::HttpPayloadTraits2,
|
816 - | ModelPl::Output
|
817 - | >,
|
818 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
819 - | RestJsonExtras<L>,
|
820 - | crate::operation_shape::HttpPayloadTraits2,
|
821 - | <
|
822 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
823 - | as ::aws_smithy_http_server::plugin::Plugin<
|
824 - | RestJsonExtras<L>,
|
825 - | crate::operation_shape::HttpPayloadTraits2,
|
826 - | ModelPl::Output
|
827 - | >
|
828 - | >::Output
|
829 - | >,
|
830 - |
|
831 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
832 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
833 - |
|
834 - | {
|
835 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
836 - | use ::aws_smithy_http_server::plugin::Plugin;
|
837 - | let svc = crate::operation_shape::HttpPayloadTraits2::from_handler(handler);
|
838 - | let svc = self.model_plugin.apply(svc);
|
839 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
840 - | .apply(svc);
|
841 - | let svc = self.http_plugin.apply(svc);
|
842 - | self.http_payload_traits2_custom(svc)
|
843 - | }
|
844 - |
|
845 - | /// Sets the [`HttpPayloadTraits2`](crate::operation_shape::HttpPayloadTraits2) operation.
|
846 - | ///
|
847 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
848 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
849 - | ///
|
850 - | /// # Example
|
851 - | ///
|
852 - | /// ```no_run
|
853 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
854 - | ///
|
855 - | /// use rest_json_extras::{input, output, error};
|
856 - | ///
|
857 - | /// async fn handler(input: input::HttpPayloadTraits2Input) -> Result<output::HttpPayloadTraits2Output, error::HttpPayloadTraits2Error> {
|
858 - | /// todo!()
|
859 - | /// }
|
860 - | ///
|
861 - | /// let config = RestJsonExtrasConfig::builder().build();
|
862 - | /// let svc = ::tower::util::service_fn(handler);
|
863 - | /// let app = RestJsonExtras::builder(config)
|
864 - | /// .http_payload_traits2_service(svc)
|
865 - | /// /* Set other handlers */
|
866 - | /// .build()
|
867 - | /// .unwrap();
|
868 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
869 - | /// ```
|
870 - | ///
|
871 - | pub fn http_payload_traits2_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
872 - | where
|
873 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::HttpPayloadTraits2, ServiceExtractors>,
|
874 - |
|
875 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
876 - | RestJsonExtras<L>,
|
877 - | crate::operation_shape::HttpPayloadTraits2,
|
878 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::HttpPayloadTraits2, S>
|
879 - | >,
|
880 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
881 - | RestJsonExtras<L>,
|
882 - | crate::operation_shape::HttpPayloadTraits2,
|
883 - | ModelPl::Output
|
884 - | >,
|
885 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
886 - | RestJsonExtras<L>,
|
887 - | crate::operation_shape::HttpPayloadTraits2,
|
888 - | <
|
889 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
890 - | as ::aws_smithy_http_server::plugin::Plugin<
|
891 - | RestJsonExtras<L>,
|
892 - | crate::operation_shape::HttpPayloadTraits2,
|
893 - | ModelPl::Output
|
894 - | >
|
895 - | >::Output
|
896 - | >,
|
897 - |
|
898 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
899 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
900 - |
|
901 - | {
|
902 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
903 - | use ::aws_smithy_http_server::plugin::Plugin;
|
904 - | let svc = crate::operation_shape::HttpPayloadTraits2::from_service(service);
|
905 - | let svc = self.model_plugin.apply(svc);
|
906 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
907 - | .apply(svc);
|
908 - | let svc = self.http_plugin.apply(svc);
|
909 - | self.http_payload_traits2_custom(svc)
|
910 - | }
|
911 - |
|
912 - | /// Sets the [`HttpPayloadTraits2`](crate::operation_shape::HttpPayloadTraits2) to a custom [`Service`](tower::Service).
|
913 - | /// not constrained by the Smithy contract.
|
914 - | fn http_payload_traits2_custom<S>(mut self, svc: S) -> Self
|
915 - | where
|
916 - | S: ::tower::Service<
|
917 - | ::http::Request<Body>,
|
918 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
919 - | Error = ::std::convert::Infallible,
|
920 - | > + Clone
|
921 - | + Send
|
922 - | + 'static,
|
923 - | S::Future: Send + 'static,
|
924 - | {
|
925 - | self.http_payload_traits2 = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
926 - | self
|
927 - | }
|
928 - |
|
929 - | /// Sets the [`HttpStringPayload2`](crate::operation_shape::HttpStringPayload2) operation.
|
930 - | ///
|
931 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
932 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
933 - | ///
|
934 - | /// # Example
|
935 - | ///
|
936 - | /// ```no_run
|
937 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
938 - | ///
|
939 - | /// use rest_json_extras::{input, output, error};
|
940 - | ///
|
941 - | /// async fn handler(input: input::HttpStringPayload2Input) -> Result<output::HttpStringPayload2Output, error::HttpStringPayload2Error> {
|
942 - | /// todo!()
|
943 - | /// }
|
944 - | ///
|
945 - | /// let config = RestJsonExtrasConfig::builder().build();
|
946 - | /// let app = RestJsonExtras::builder(config)
|
947 - | /// .http_string_payload2(handler)
|
948 - | /// /* Set other handlers */
|
949 - | /// .build()
|
950 - | /// .unwrap();
|
951 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
952 - | /// ```
|
953 - | ///
|
954 - | pub fn http_string_payload2<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
955 - | where
|
956 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::HttpStringPayload2, HandlerExtractors>,
|
957 - |
|
958 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
959 - | RestJsonExtras<L>,
|
960 - | crate::operation_shape::HttpStringPayload2,
|
961 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::HttpStringPayload2, HandlerType>
|
962 - | >,
|
963 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
964 - | RestJsonExtras<L>,
|
965 - | crate::operation_shape::HttpStringPayload2,
|
966 - | ModelPl::Output
|
967 - | >,
|
968 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
969 - | RestJsonExtras<L>,
|
970 - | crate::operation_shape::HttpStringPayload2,
|
971 - | <
|
972 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
973 - | as ::aws_smithy_http_server::plugin::Plugin<
|
974 - | RestJsonExtras<L>,
|
975 - | crate::operation_shape::HttpStringPayload2,
|
976 - | ModelPl::Output
|
977 - | >
|
978 - | >::Output
|
979 - | >,
|
980 - |
|
981 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
982 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
983 - |
|
984 - | {
|
985 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
986 - | use ::aws_smithy_http_server::plugin::Plugin;
|
987 - | let svc = crate::operation_shape::HttpStringPayload2::from_handler(handler);
|
988 - | let svc = self.model_plugin.apply(svc);
|
989 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
990 - | .apply(svc);
|
991 - | let svc = self.http_plugin.apply(svc);
|
992 - | self.http_string_payload2_custom(svc)
|
993 - | }
|
994 - |
|
995 - | /// Sets the [`HttpStringPayload2`](crate::operation_shape::HttpStringPayload2) operation.
|
996 - | ///
|
997 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
998 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
999 - | ///
|
1000 - | /// # Example
|
1001 - | ///
|
1002 - | /// ```no_run
|
1003 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
1004 - | ///
|
1005 - | /// use rest_json_extras::{input, output, error};
|
1006 - | ///
|
1007 - | /// async fn handler(input: input::HttpStringPayload2Input) -> Result<output::HttpStringPayload2Output, error::HttpStringPayload2Error> {
|
1008 - | /// todo!()
|
1009 - | /// }
|
1010 - | ///
|
1011 - | /// let config = RestJsonExtrasConfig::builder().build();
|
1012 - | /// let svc = ::tower::util::service_fn(handler);
|
1013 - | /// let app = RestJsonExtras::builder(config)
|
1014 - | /// .http_string_payload2_service(svc)
|
1015 - | /// /* Set other handlers */
|
1016 - | /// .build()
|
1017 - | /// .unwrap();
|
1018 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
1019 - | /// ```
|
1020 - | ///
|
1021 - | pub fn http_string_payload2_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1022 - | where
|
1023 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::HttpStringPayload2, ServiceExtractors>,
|
1024 - |
|
1025 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1026 - | RestJsonExtras<L>,
|
1027 - | crate::operation_shape::HttpStringPayload2,
|
1028 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::HttpStringPayload2, S>
|
1029 - | >,
|
1030 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1031 - | RestJsonExtras<L>,
|
1032 - | crate::operation_shape::HttpStringPayload2,
|
1033 - | ModelPl::Output
|
1034 - | >,
|
1035 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1036 - | RestJsonExtras<L>,
|
1037 - | crate::operation_shape::HttpStringPayload2,
|
1038 - | <
|
1039 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1040 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1041 - | RestJsonExtras<L>,
|
1042 - | crate::operation_shape::HttpStringPayload2,
|
1043 - | ModelPl::Output
|
1044 - | >
|
1045 - | >::Output
|
1046 - | >,
|
1047 - |
|
1048 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1049 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1050 - |
|
1051 - | {
|
1052 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1053 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1054 - | let svc = crate::operation_shape::HttpStringPayload2::from_service(service);
|
1055 - | let svc = self.model_plugin.apply(svc);
|
1056 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1057 - | .apply(svc);
|
1058 - | let svc = self.http_plugin.apply(svc);
|
1059 - | self.http_string_payload2_custom(svc)
|
1060 - | }
|
1061 - |
|
1062 - | /// Sets the [`HttpStringPayload2`](crate::operation_shape::HttpStringPayload2) to a custom [`Service`](tower::Service).
|
1063 - | /// not constrained by the Smithy contract.
|
1064 - | fn http_string_payload2_custom<S>(mut self, svc: S) -> Self
|
1065 - | where
|
1066 - | S: ::tower::Service<
|
1067 - | ::http::Request<Body>,
|
1068 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1069 - | Error = ::std::convert::Infallible,
|
1070 - | > + Clone
|
1071 - | + Send
|
1072 - | + 'static,
|
1073 - | S::Future: Send + 'static,
|
1074 - | {
|
1075 - | self.http_string_payload2 = Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1076 - | self
|
1077 - | }
|
1078 - |
|
1079 - | /// Sets the [`MalformedContentTypeWithBody2`](crate::operation_shape::MalformedContentTypeWithBody2) operation.
|
1080 - | ///
|
1081 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1082 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1083 - | ///
|
1084 - | /// # Example
|
1085 - | ///
|
1086 - | /// ```no_run
|
1087 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
1088 - | ///
|
1089 - | /// use rest_json_extras::{input, output, error};
|
1090 - | ///
|
1091 - | /// async fn handler(input: input::MalformedContentTypeWithBody2Input) -> Result<output::MalformedContentTypeWithBody2Output, error::MalformedContentTypeWithBody2Error> {
|
1092 - | /// todo!()
|
1093 - | /// }
|
1094 - | ///
|
1095 - | /// let config = RestJsonExtrasConfig::builder().build();
|
1096 - | /// let app = RestJsonExtras::builder(config)
|
1097 - | /// .malformed_content_type_with_body2(handler)
|
1098 - | /// /* Set other handlers */
|
1099 - | /// .build()
|
1100 - | /// .unwrap();
|
1101 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
1102 - | /// ```
|
1103 - | ///
|
1104 - | pub fn malformed_content_type_with_body2<HandlerType, HandlerExtractors, UpgradeExtractors>(self, handler: HandlerType) -> Self
|
1105 - | where
|
1106 - | HandlerType: ::aws_smithy_http_server::operation::Handler<crate::operation_shape::MalformedContentTypeWithBody2, HandlerExtractors>,
|
1107 - |
|
1108 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1109 - | RestJsonExtras<L>,
|
1110 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1111 - | ::aws_smithy_http_server::operation::IntoService<crate::operation_shape::MalformedContentTypeWithBody2, HandlerType>
|
1112 - | >,
|
1113 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1114 - | RestJsonExtras<L>,
|
1115 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1116 - | ModelPl::Output
|
1117 - | >,
|
1118 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1119 - | RestJsonExtras<L>,
|
1120 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1121 - | <
|
1122 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1123 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1124 - | RestJsonExtras<L>,
|
1125 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1126 - | ModelPl::Output
|
1127 - | >
|
1128 - | >::Output
|
1129 - | >,
|
1130 - |
|
1131 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1132 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1133 - |
|
1134 - | {
|
1135 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1136 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1137 - | let svc = crate::operation_shape::MalformedContentTypeWithBody2::from_handler(handler);
|
1138 - | let svc = self.model_plugin.apply(svc);
|
1139 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1140 - | .apply(svc);
|
1141 - | let svc = self.http_plugin.apply(svc);
|
1142 - | self.malformed_content_type_with_body2_custom(svc)
|
1143 - | }
|
1144 - |
|
1145 - | /// Sets the [`MalformedContentTypeWithBody2`](crate::operation_shape::MalformedContentTypeWithBody2) operation.
|
1146 - | ///
|
1147 - | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1148 - | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1149 - | ///
|
1150 - | /// # Example
|
1151 - | ///
|
1152 - | /// ```no_run
|
1153 - | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
1154 - | ///
|
1155 - | /// use rest_json_extras::{input, output, error};
|
1156 - | ///
|
1157 - | /// async fn handler(input: input::MalformedContentTypeWithBody2Input) -> Result<output::MalformedContentTypeWithBody2Output, error::MalformedContentTypeWithBody2Error> {
|
1158 - | /// todo!()
|
1159 - | /// }
|
1160 - | ///
|
1161 - | /// let config = RestJsonExtrasConfig::builder().build();
|
1162 - | /// let svc = ::tower::util::service_fn(handler);
|
1163 - | /// let app = RestJsonExtras::builder(config)
|
1164 - | /// .malformed_content_type_with_body2_service(svc)
|
1165 - | /// /* Set other handlers */
|
1166 - | /// .build()
|
1167 - | /// .unwrap();
|
1168 - | /// # let app: RestJsonExtras<::aws_smithy_http_server::routing::RoutingService<::aws_smithy_http_server::protocol::rest::router::RestRouter<::aws_smithy_http_server::routing::Route>, ::aws_smithy_http_server::protocol::rest_json_1::RestJson1>> = app;
|
1169 - | /// ```
|
1170 - | ///
|
1171 - | pub fn malformed_content_type_with_body2_service<S, ServiceExtractors, UpgradeExtractors>(self, service: S) -> Self
|
1172 - | where
|
1173 - | S: ::aws_smithy_http_server::operation::OperationService<crate::operation_shape::MalformedContentTypeWithBody2, ServiceExtractors>,
|
1174 - |
|
1175 - | ModelPl: ::aws_smithy_http_server::plugin::Plugin<
|
1176 - | RestJsonExtras<L>,
|
1177 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1178 - | ::aws_smithy_http_server::operation::Normalize<crate::operation_shape::MalformedContentTypeWithBody2, S>
|
1179 - | >,
|
1180 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>: ::aws_smithy_http_server::plugin::Plugin<
|
1181 - | RestJsonExtras<L>,
|
1182 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1183 - | ModelPl::Output
|
1184 - | >,
|
1185 - | HttpPl: ::aws_smithy_http_server::plugin::Plugin<
|
1186 - | RestJsonExtras<L>,
|
1187 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1188 - | <
|
1189 - | ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
|
1190 - | as ::aws_smithy_http_server::plugin::Plugin<
|
1191 - | RestJsonExtras<L>,
|
1192 - | crate::operation_shape::MalformedContentTypeWithBody2,
|
1193 - | ModelPl::Output
|
1194 - | >
|
1195 - | >::Output
|
1196 - | >,
|
1197 - |
|
1198 - | HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
|
1199 - | <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
|
1200 - |
|
1201 - | {
|
1202 - | use ::aws_smithy_http_server::operation::OperationShapeExt;
|
1203 - | use ::aws_smithy_http_server::plugin::Plugin;
|
1204 - | let svc = crate::operation_shape::MalformedContentTypeWithBody2::from_service(service);
|
1205 - | let svc = self.model_plugin.apply(svc);
|
1206 - | let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
|
1207 - | .apply(svc);
|
1208 - | let svc = self.http_plugin.apply(svc);
|
1209 - | self.malformed_content_type_with_body2_custom(svc)
|
1210 - | }
|
1211 - |
|
1212 - | /// Sets the [`MalformedContentTypeWithBody2`](crate::operation_shape::MalformedContentTypeWithBody2) to a custom [`Service`](tower::Service).
|
1213 - | /// not constrained by the Smithy contract.
|
1214 - | fn malformed_content_type_with_body2_custom<S>(mut self, svc: S) -> Self
|
1215 - | where
|
1216 - | S: ::tower::Service<
|
1217 - | ::http::Request<Body>,
|
1218 - | Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
|
1219 - | Error = ::std::convert::Infallible,
|
1220 - | > + Clone
|
1221 - | + Send
|
1222 - | + 'static,
|
1223 - | S::Future: Send + 'static,
|
1224 - | {
|
1225 - | self.malformed_content_type_with_body2 =
|
1226 - | Some(::aws_smithy_http_server::routing::Route::new(svc));
|
1227 - | self
|
1228 - | }
|
1229 - |
|
1230 625 | /// Sets the [`MapWithEnumKeyOp`](crate::operation_shape::MapWithEnumKeyOp) operation.
|
1231 626 | ///
|
1232 627 | /// This should be an async function satisfying the [`Handler`](::aws_smithy_http_server::operation::Handler) trait.
|
1233 628 | /// See the [operation module documentation](::aws_smithy_http_server::operation) for more information.
|
1234 629 | ///
|
1235 630 | /// # Example
|
1236 631 | ///
|
1237 632 | /// ```no_run
|
1238 633 | /// use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
|
1239 634 | ///
|