|
|
@@ -31,21 +31,21 @@ IotClient::IotClient(const Credentials &credentials, const ClientConfiguration &
|
|
|
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
|
|
{
|
|
|
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
|
|
- endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "iot");
|
|
|
+ endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
|
|
}
|
|
|
|
|
|
IotClient::IotClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
|
|
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
|
|
{
|
|
|
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
|
|
- endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "iot");
|
|
|
+ endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
|
|
}
|
|
|
|
|
|
IotClient::IotClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
|
|
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
|
|
{
|
|
|
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
|
|
- endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "iot");
|
|
|
+ endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
|
|
}
|
|
|
|
|
|
IotClient::~IotClient()
|
|
|
@@ -4767,42 +4767,6 @@ IotClient::GetLoraNodesTaskOutcomeCallable IotClient::getLoraNodesTaskCallable(c
|
|
|
return task->get_future();
|
|
|
}
|
|
|
|
|
|
-IotClient::GetNodesAddingTaskOutcome IotClient::getNodesAddingTask(const GetNodesAddingTaskRequest &request) const
|
|
|
-{
|
|
|
- auto endpointOutcome = endpointProvider_->getEndpoint();
|
|
|
- if (!endpointOutcome.isSuccess())
|
|
|
- return GetNodesAddingTaskOutcome(endpointOutcome.error());
|
|
|
-
|
|
|
- auto outcome = makeRequest(endpointOutcome.result(), request);
|
|
|
-
|
|
|
- if (outcome.isSuccess())
|
|
|
- return GetNodesAddingTaskOutcome(GetNodesAddingTaskResult(outcome.result()));
|
|
|
- else
|
|
|
- return GetNodesAddingTaskOutcome(outcome.error());
|
|
|
-}
|
|
|
-
|
|
|
-void IotClient::getNodesAddingTaskAsync(const GetNodesAddingTaskRequest& request, const GetNodesAddingTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
|
|
-{
|
|
|
- auto fn = [this, request, handler, context]()
|
|
|
- {
|
|
|
- handler(this, request, getNodesAddingTask(request), context);
|
|
|
- };
|
|
|
-
|
|
|
- asyncExecute(new Runnable(fn));
|
|
|
-}
|
|
|
-
|
|
|
-IotClient::GetNodesAddingTaskOutcomeCallable IotClient::getNodesAddingTaskCallable(const GetNodesAddingTaskRequest &request) const
|
|
|
-{
|
|
|
- auto task = std::make_shared<std::packaged_task<GetNodesAddingTaskOutcome()>>(
|
|
|
- [this, request]()
|
|
|
- {
|
|
|
- return this->getNodesAddingTask(request);
|
|
|
- });
|
|
|
-
|
|
|
- asyncExecute(new Runnable([task]() { (*task)(); }));
|
|
|
- return task->get_future();
|
|
|
-}
|
|
|
-
|
|
|
IotClient::GetRuleOutcome IotClient::getRule(const GetRuleRequest &request) const
|
|
|
{
|
|
|
auto endpointOutcome = endpointProvider_->getEndpoint();
|