@@ -30,54 +30,60 @@ namespace client
3030 typename EndpointProviderT,
3131 typename SerializerT,
3232 typename ResponseT,
33- typename MarshallerT >
33+ typename ErrorMarshallerT >
3434 class AwsSmithyClientT : public AwsSmithyClientBase
3535 {
36- private:
37-
3836 public:
39- static_assert (std::is_base_of<Aws::Client::AWSErrorMarshaller, MarshallerT >::value, " MarshallerT must be derived from class Aws::Client::AWSErrorMarshaller" );
37+ static_assert (std::is_base_of<Aws::Client::AWSErrorMarshaller, ErrorMarshallerT >::value, " MarshallerT must be derived from class Aws::Client::AWSErrorMarshaller" );
4038
4139 explicit AwsSmithyClientT (const ServiceClientConfigurationT& clientConfig, const Aws::String& serviceName,
4240 const std::shared_ptr<Aws::Http::HttpClient>& httpClient,
4341 const std::shared_ptr<Aws::Client::AWSErrorMarshaller>& errorMarshaller,
4442 const std::shared_ptr<EndpointProviderT> endpointProvider,
4543 const std::shared_ptr<ServiceAuthSchemeResolverT>& authSchemeResolver,
4644 const Aws::UnorderedMap<Aws::String, AuthSchemesVariantT>& authSchemes)
47- : AwsSmithyClientBase(Aws::MakeShared <ServiceClientConfigurationT>(ServiceNameT, clientConfig), serviceName, httpClient, errorMarshaller),
45+ : AwsSmithyClientBase(Aws::MakeUnique <ServiceClientConfigurationT>(ServiceNameT, clientConfig), serviceName, httpClient, errorMarshaller),
4846 m_clientConfiguration(*static_cast <ServiceClientConfigurationT*>(AwsSmithyClientBase::m_clientConfig.get())),
4947 m_endpointProvider(endpointProvider),
5048 m_authSchemeResolver(authSchemeResolver),
5149 m_authSchemes(authSchemes),
5250 m_serializer(Aws::MakeShared<SerializerT>(ServiceNameT, m_clientConfiguration.telemetryProvider))
5351 {
54- m_serviceName = ServiceNameT;
52+ m_serviceName = ServiceNameT;
53+ initClient ();
5554 }
5655
5756 AwsSmithyClientT (const AwsSmithyClientT& other):
58- AwsSmithyClientBase (Aws::MakeShared<ServiceClientConfigurationT>(ServiceNameT, other.m_clientConfig), other.m_serviceName, Aws::Http::CreateHttpClient(*other.m_clientConfig), Aws::MakeShared<MarshallerT>(other.m_serviceName.c_str())),
59- m_clientConfiguration{*static_cast <ServiceClientConfigurationT*>(AwsSmithyClientBase::m_clientConfig.get ())},
60- m_endpointProvider{other.m_endpointProvider },
61- m_authSchemeResolver{other.m_authSchemeResolver },
57+ AwsSmithyClientBase (other,
58+ Aws::MakeUnique<ServiceClientConfigurationT>(ServiceNameT, other.m_clientConfiguration),
59+ ServiceNameT,
60+ Aws::Http::CreateHttpClient (other.m_clientConfiguration),
61+ Aws::MakeShared<ErrorMarshallerT>(ServiceNameT)),
62+ m_clientConfiguration{*static_cast <ServiceClientConfigurationT*>(m_clientConfig.get ())},
63+ m_endpointProvider{Aws::MakeShared<EndpointProviderT>(ServiceNameT)},
64+ m_authSchemeResolver{Aws::MakeShared<ServiceAuthSchemeResolverT>(ServiceNameT)},
6265 m_authSchemes{other.m_authSchemes },
6366 m_serializer{Aws::MakeShared<SerializerT>(ServiceNameT, m_clientConfiguration.telemetryProvider )}
6467 {
68+ initClient ();
6569 }
6670
67-
6871 AwsSmithyClientT& operator =(const AwsSmithyClientT& other)
6972 {
7073 if (this != &other)
7174 {
72- AwsSmithyClientBase::operator =(other);
73- m_clientConfiguration = *static_cast <ServiceClientConfigurationT*>(AwsSmithyClientBase::m_clientConfig.get ());
74- m_endpointProvider = other.m_endpointProvider ;
75- m_authSchemeResolver = other.m_authSchemeResolver ;
75+ AwsSmithyClientBase::deepCopy (Aws::MakeUnique<ServiceClientConfigurationT>(ServiceNameT, other.m_clientConfiguration ),
76+ ServiceNameT,
77+ Aws::Http::CreateHttpClient (other.m_clientConfiguration ),
78+ Aws::MakeShared<ErrorMarshallerT>(ServiceNameT));
79+ m_clientConfiguration = *static_cast <ServiceClientConfigurationT*>(m_clientConfig.get ());
80+ m_endpointProvider = Aws::MakeShared<EndpointProviderT>(ServiceNameT);
81+ m_authSchemeResolver = Aws::MakeShared<ServiceAuthSchemeResolverT>(ServiceNameT);
7682 m_authSchemes = other.m_authSchemes ;
77- m_serializer = Aws::MakeShared<SerializerT>(other.m_serviceName .c_str (), m_clientConfiguration.telemetryProvider );
78- m_errorMarshaller = Aws::MakeShared<MarshallerT>(other.m_serviceName .c_str ());
83+ m_serializer = Aws::MakeShared<SerializerT>(ServiceNameT, m_clientConfiguration.telemetryProvider );
84+ m_errorMarshaller = Aws::MakeShared<ErrorMarshallerT>(ServiceNameT);
85+ initClient ();
7986 }
80-
8187 return *this ;
8288 }
8389
@@ -88,6 +94,10 @@ namespace client
8894 virtual ~AwsSmithyClientT () = default ;
8995
9096 protected:
97+ void initClient () {
98+ m_endpointProvider->InitBuiltInParameters (m_clientConfiguration);
99+ }
100+
91101 inline const char * GetServiceClientName () const override { return m_serviceName.c_str (); }
92102
93103 ResolveEndpointOutcome ResolveEndpoint (const Aws::Endpoint::EndpointParameters& endpointParameters, EndpointUpdateCallback&& epCallback) const override
@@ -166,7 +176,6 @@ namespace client
166176 return m_serializer->Deserialize (std::move (httpResponseOutcome), GetServiceClientName (), requestName);
167177 }
168178
169- protected:
170179 ServiceClientConfigurationT& m_clientConfiguration;
171180 std::shared_ptr<EndpointProviderT> m_endpointProvider{};
172181 std::shared_ptr<ServiceAuthSchemeResolverT> m_authSchemeResolver{};
0 commit comments