@@ -686,21 +686,17 @@ namespace Awstest
686686 GetAllProductsResult (EventstreamResultVariantType &&result) noexcept : m_result(std::move(result)) {}
687687 GetAllProductsResponse *GetOperationResponse () const noexcept
688688 {
689- return static_cast <GetAllProductsResponse *>(
690- std::get<Aws::Crt::ScopedResource<AbstractShapeBase>>(m_result).get ());
689+ return static_cast <GetAllProductsResponse *>(m_result.GetModeledResult ());
691690 }
692691
693692 /* *
694693 * @return true if the response is associated with an expected response;
695694 * false if the response is associated with an error.
696695 */
697696 operator bool () const noexcept { return GetResultType () == OPERATION_RESPONSE; }
698- OperationError *GetOperationError () const noexcept
699- {
700- return std::get<Aws::Crt::ScopedResource<OperationError>>(m_result).get ();
701- }
702- RpcError GetRpcError () const noexcept { return std::get<RpcError>(m_result); }
703- ResultType GetResultType () const noexcept { return ResultVariantToResultType (m_result); }
697+ OperationError *GetOperationError () const noexcept { return m_result.GetModeledError (); }
698+ RpcError GetRpcError () const noexcept { return m_result.GetRpcError (); }
699+ ResultType GetResultType () const noexcept { return m_result.GetType (); }
704700
705701 private:
706702 EventstreamResultVariantType m_result;
@@ -740,21 +736,17 @@ namespace Awstest
740736 CauseServiceErrorResult (EventstreamResultVariantType &&result) noexcept : m_result(std::move(result)) {}
741737 CauseServiceErrorResponse *GetOperationResponse () const noexcept
742738 {
743- return static_cast <CauseServiceErrorResponse *>(
744- std::get<Aws::Crt::ScopedResource<AbstractShapeBase>>(m_result).get ());
739+ return static_cast <CauseServiceErrorResponse *>(m_result.GetModeledResult ());
745740 }
746741
747742 /* *
748743 * @return true if the response is associated with an expected response;
749744 * false if the response is associated with an error.
750745 */
751746 operator bool () const noexcept { return GetResultType () == OPERATION_RESPONSE; }
752- OperationError *GetOperationError () const noexcept
753- {
754- return std::get<Aws::Crt::ScopedResource<OperationError>>(m_result).get ();
755- }
756- RpcError GetRpcError () const noexcept { return std::get<RpcError>(m_result); }
757- ResultType GetResultType () const noexcept { return ResultVariantToResultType (m_result); }
747+ OperationError *GetOperationError () const noexcept { return m_result.GetModeledError (); }
748+ RpcError GetRpcError () const noexcept { return m_result.GetRpcError (); }
749+ ResultType GetResultType () const noexcept { return m_result.GetType (); }
758750
759751 private:
760752 EventstreamResultVariantType m_result;
@@ -843,21 +835,17 @@ namespace Awstest
843835 CauseStreamServiceToErrorResult (EventstreamResultVariantType &&result) noexcept : m_result(std::move(result)) {}
844836 EchoStreamingResponse *GetOperationResponse () const noexcept
845837 {
846- return static_cast <EchoStreamingResponse *>(
847- std::get<Aws::Crt::ScopedResource<AbstractShapeBase>>(m_result).get ());
838+ return static_cast <EchoStreamingResponse *>(m_result.GetModeledResult ());
848839 }
849840
850841 /* *
851842 * @return true if the response is associated with an expected response;
852843 * false if the response is associated with an error.
853844 */
854845 operator bool () const noexcept { return GetResultType () == OPERATION_RESPONSE; }
855- OperationError *GetOperationError () const noexcept
856- {
857- return std::get<Aws::Crt::ScopedResource<OperationError>>(m_result).get ();
858- }
859- RpcError GetRpcError () const noexcept { return std::get<RpcError>(m_result); }
860- ResultType GetResultType () const noexcept { return ResultVariantToResultType (m_result); }
846+ OperationError *GetOperationError () const noexcept { return m_result.GetModeledError (); }
847+ RpcError GetRpcError () const noexcept { return m_result.GetRpcError (); }
848+ ResultType GetResultType () const noexcept { return m_result.GetType (); }
861849
862850 private:
863851 EventstreamResultVariantType m_result;
@@ -949,21 +937,17 @@ namespace Awstest
949937 EchoStreamMessagesResult (EventstreamResultVariantType &&result) noexcept : m_result(std::move(result)) {}
950938 EchoStreamingResponse *GetOperationResponse () const noexcept
951939 {
952- return static_cast <EchoStreamingResponse *>(
953- std::get<Aws::Crt::ScopedResource<AbstractShapeBase>>(m_result).get ());
940+ return static_cast <EchoStreamingResponse *>(m_result.GetModeledResult ());
954941 }
955942
956943 /* *
957944 * @return true if the response is associated with an expected response;
958945 * false if the response is associated with an error.
959946 */
960947 operator bool () const noexcept { return GetResultType () == OPERATION_RESPONSE; }
961- OperationError *GetOperationError () const noexcept
962- {
963- return std::get<Aws::Crt::ScopedResource<OperationError>>(m_result).get ();
964- }
965- RpcError GetRpcError () const noexcept { return std::get<RpcError>(m_result); }
966- ResultType GetResultType () const noexcept { return ResultVariantToResultType (m_result); }
948+ OperationError *GetOperationError () const noexcept { return m_result.GetModeledError (); }
949+ RpcError GetRpcError () const noexcept { return m_result.GetRpcError (); }
950+ ResultType GetResultType () const noexcept { return m_result.GetType (); }
967951
968952 private:
969953 EventstreamResultVariantType m_result;
@@ -1016,21 +1000,17 @@ namespace Awstest
10161000 EchoMessageResult (EventstreamResultVariantType &&result) noexcept : m_result(std::move(result)) {}
10171001 EchoMessageResponse *GetOperationResponse () const noexcept
10181002 {
1019- return static_cast <EchoMessageResponse *>(
1020- std::get<Aws::Crt::ScopedResource<AbstractShapeBase>>(m_result).get ());
1003+ return static_cast <EchoMessageResponse *>(m_result.GetModeledResult ());
10211004 }
10221005
10231006 /* *
10241007 * @return true if the response is associated with an expected response;
10251008 * false if the response is associated with an error.
10261009 */
10271010 operator bool () const noexcept { return GetResultType () == OPERATION_RESPONSE; }
1028- OperationError *GetOperationError () const noexcept
1029- {
1030- return std::get<Aws::Crt::ScopedResource<OperationError>>(m_result).get ();
1031- }
1032- RpcError GetRpcError () const noexcept { return std::get<RpcError>(m_result); }
1033- ResultType GetResultType () const noexcept { return ResultVariantToResultType (m_result); }
1011+ OperationError *GetOperationError () const noexcept { return m_result.GetModeledError (); }
1012+ RpcError GetRpcError () const noexcept { return m_result.GetRpcError (); }
1013+ ResultType GetResultType () const noexcept { return m_result.GetType (); }
10341014
10351015 private:
10361016 EventstreamResultVariantType m_result;
@@ -1070,21 +1050,17 @@ namespace Awstest
10701050 GetAllCustomersResult (EventstreamResultVariantType &&result) noexcept : m_result(std::move(result)) {}
10711051 GetAllCustomersResponse *GetOperationResponse () const noexcept
10721052 {
1073- return static_cast <GetAllCustomersResponse *>(
1074- std::get<Aws::Crt::ScopedResource<AbstractShapeBase>>(m_result).get ());
1053+ return static_cast <GetAllCustomersResponse *>(m_result.GetModeledResult ());
10751054 }
10761055
10771056 /* *
10781057 * @return true if the response is associated with an expected response;
10791058 * false if the response is associated with an error.
10801059 */
10811060 operator bool () const noexcept { return GetResultType () == OPERATION_RESPONSE; }
1082- OperationError *GetOperationError () const noexcept
1083- {
1084- return std::get<Aws::Crt::ScopedResource<OperationError>>(m_result).get ();
1085- }
1086- RpcError GetRpcError () const noexcept { return std::get<RpcError>(m_result); }
1087- ResultType GetResultType () const noexcept { return ResultVariantToResultType (m_result); }
1061+ OperationError *GetOperationError () const noexcept { return m_result.GetModeledError (); }
1062+ RpcError GetRpcError () const noexcept { return m_result.GetRpcError (); }
1063+ ResultType GetResultType () const noexcept { return m_result.GetType (); }
10881064
10891065 private:
10901066 EventstreamResultVariantType m_result;
0 commit comments