text: /*
   * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *    http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  #include <tencentcloud/cls/v20201016/ClsClient.h>
  #include <tencentcloud/core/Executor.h>
  #include <tencentcloud/core/Runnable.h>
  
  using namespace TencentCloud;
  using namespace TencentCloud::Cls::V20201016;
  using namespace TencentCloud::Cls::V20201016::Model;
  using namespace std;
  
  namespace
  {
      const string VERSION = "2020-10-16";
      const string ENDPOINT = "cls.tencentcloudapi.com";
  }
  
  ClsClient::ClsClient(const Credential &credential, const string &region) :
      ClsClient(credential, region, ClientProfile())
  {
  }
  
  ClsClient::ClsClient(const Credential &credential, const string &region, const ClientProfile &profile) :
      AbstractClient(ENDPOINT, VERSION, credential, region, profile)
  {
  }
  
  
  ClsClient::CreateAlarmOutcome ClsClient::CreateAlarm(const CreateAlarmRequest &request)
  {
      auto outcome = MakeRequest(request, "CreateAlarm");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          CreateAlarmResponse rsp = CreateAlarmResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return CreateAlarmOutcome(rsp);
          else
              return CreateAlarmOutcome(o.GetError());
      }
      else
      {
          return CreateAlarmOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::CreateAlarmAsync(const CreateAlarmRequest& request, const CreateAlarmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->CreateAlarm(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::CreateAlarmOutcomeCallable ClsClient::CreateAlarmCallable(const CreateAlarmRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<CreateAlarmOutcome()>>(
          [this, request]()
          {
              return this->CreateAlarm(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::CreateAlarmNoticeOutcome ClsClient::CreateAlarmNotice(const CreateAlarmNoticeRequest &request)
  {
      auto outcome = MakeRequest(request, "CreateAlarmNotice");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          CreateAlarmNoticeResponse rsp = CreateAlarmNoticeResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return CreateAlarmNoticeOutcome(rsp);
          else
              return CreateAlarmNoticeOutcome(o.GetError());
      }
      else
      {
          return CreateAlarmNoticeOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::CreateAlarmNoticeAsync(const CreateAlarmNoticeRequest& request, const CreateAlarmNoticeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->CreateAlarmNotice(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::CreateAlarmNoticeOutcomeCallable ClsClient::CreateAlarmNoticeCallable(const CreateAlarmNoticeRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<CreateAlarmNoticeOutcome()>>(
          [this, request]()
          {
              return this->CreateAlarmNotice(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::CreateExportOutcome ClsClient::CreateExport(const CreateExportRequest &request)
  {
      auto outcome = MakeRequest(request, "CreateExport");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          CreateExportResponse rsp = CreateExportResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return CreateExportOutcome(rsp);
          else
              return CreateExportOutcome(o.GetError());
      }
      else
      {
          return CreateExportOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::CreateExportAsync(const CreateExportRequest& request, const CreateExportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->CreateExport(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::CreateExportOutcomeCallable ClsClient::CreateExportCallable(const CreateExportRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<CreateExportOutcome()>>(
          [this, request]()
          {
              return this->CreateExport(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::CreateIndexOutcome ClsClient::CreateIndex(const CreateIndexRequest &request)
  {
      auto outcome = MakeRequest(request, "CreateIndex");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          CreateIndexResponse rsp = CreateIndexResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return CreateIndexOutcome(rsp);
          else
              return CreateIndexOutcome(o.GetError());
      }
      else
      {
          return CreateIndexOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::CreateIndexAsync(const CreateIndexRequest& request, const CreateIndexAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->CreateIndex(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::CreateIndexOutcomeCallable ClsClient::CreateIndexCallable(const CreateIndexRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<CreateIndexOutcome()>>(
          [this, request]()
          {
              return this->CreateIndex(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::CreateMachineGroupOutcome ClsClient::CreateMachineGroup(const CreateMachineGroupRequest &request)
  {
      auto outcome = MakeRequest(request, "CreateMachineGroup");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          CreateMachineGroupResponse rsp = CreateMachineGroupResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return CreateMachineGroupOutcome(rsp);
          else
              return CreateMachineGroupOutcome(o.GetError());
      }
      else
      {
          return CreateMachineGroupOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::CreateMachineGroupAsync(const CreateMachineGroupRequest& request, const CreateMachineGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->CreateMachineGroup(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::CreateMachineGroupOutcomeCallable ClsClient::CreateMachineGroupCallable(const CreateMachineGroupRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<CreateMachineGroupOutcome()>>(
          [this, request]()
          {
              return this->CreateMachineGroup(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::CreateTopicOutcome ClsClient::CreateTopic(const CreateTopicRequest &request)
  {
      auto outcome = MakeRequest(request, "CreateTopic");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          CreateTopicResponse rsp = CreateTopicResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return CreateTopicOutcome(rsp);
          else
              return CreateTopicOutcome(o.GetError());
      }
      else
      {
          return CreateTopicOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::CreateTopicAsync(const CreateTopicRequest& request, const CreateTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->CreateTopic(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::CreateTopicOutcomeCallable ClsClient::CreateTopicCallable(const CreateTopicRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<CreateTopicOutcome()>>(
          [this, request]()
          {
              return this->CreateTopic(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DeleteAlarmOutcome ClsClient::DeleteAlarm(const DeleteAlarmRequest &request)
  {
      auto outcome = MakeRequest(request, "DeleteAlarm");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DeleteAlarmResponse rsp = DeleteAlarmResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DeleteAlarmOutcome(rsp);
          else
              return DeleteAlarmOutcome(o.GetError());
      }
      else
      {
          return DeleteAlarmOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DeleteAlarmAsync(const DeleteAlarmRequest& request, const DeleteAlarmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DeleteAlarm(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DeleteAlarmOutcomeCallable ClsClient::DeleteAlarmCallable(const DeleteAlarmRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DeleteAlarmOutcome()>>(
          [this, request]()
          {
              return this->DeleteAlarm(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DeleteAlarmNoticeOutcome ClsClient::DeleteAlarmNotice(const DeleteAlarmNoticeRequest &request)
  {
      auto outcome = MakeRequest(request, "DeleteAlarmNotice");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DeleteAlarmNoticeResponse rsp = DeleteAlarmNoticeResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DeleteAlarmNoticeOutcome(rsp);
          else
              return DeleteAlarmNoticeOutcome(o.GetError());
      }
      else
      {
          return DeleteAlarmNoticeOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DeleteAlarmNoticeAsync(const DeleteAlarmNoticeRequest& request, const DeleteAlarmNoticeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DeleteAlarmNotice(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DeleteAlarmNoticeOutcomeCallable ClsClient::DeleteAlarmNoticeCallable(const DeleteAlarmNoticeRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DeleteAlarmNoticeOutcome()>>(
          [this, request]()
          {
              return this->DeleteAlarmNotice(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DeleteExportOutcome ClsClient::DeleteExport(const DeleteExportRequest &request)
  {
      auto outcome = MakeRequest(request, "DeleteExport");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DeleteExportResponse rsp = DeleteExportResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DeleteExportOutcome(rsp);
          else
              return DeleteExportOutcome(o.GetError());
      }
      else
      {
          return DeleteExportOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DeleteExportAsync(const DeleteExportRequest& request, const DeleteExportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DeleteExport(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DeleteExportOutcomeCallable ClsClient::DeleteExportCallable(const DeleteExportRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DeleteExportOutcome()>>(
          [this, request]()
          {
              return this->DeleteExport(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DeleteIndexOutcome ClsClient::DeleteIndex(const DeleteIndexRequest &request)
  {
      auto outcome = MakeRequest(request, "DeleteIndex");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DeleteIndexResponse rsp = DeleteIndexResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DeleteIndexOutcome(rsp);
          else
              return DeleteIndexOutcome(o.GetError());
      }
      else
      {
          return DeleteIndexOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DeleteIndexAsync(const DeleteIndexRequest& request, const DeleteIndexAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DeleteIndex(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DeleteIndexOutcomeCallable ClsClient::DeleteIndexCallable(const DeleteIndexRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DeleteIndexOutcome()>>(
          [this, request]()
          {
              return this->DeleteIndex(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DeleteMachineGroupOutcome ClsClient::DeleteMachineGroup(const DeleteMachineGroupRequest &request)
  {
      auto outcome = MakeRequest(request, "DeleteMachineGroup");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DeleteMachineGroupResponse rsp = DeleteMachineGroupResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DeleteMachineGroupOutcome(rsp);
          else
              return DeleteMachineGroupOutcome(o.GetError());
      }
      else
      {
          return DeleteMachineGroupOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DeleteMachineGroupAsync(const DeleteMachineGroupRequest& request, const DeleteMachineGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DeleteMachineGroup(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DeleteMachineGroupOutcomeCallable ClsClient::DeleteMachineGroupCallable(const DeleteMachineGroupRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DeleteMachineGroupOutcome()>>(
          [this, request]()
          {
              return this->DeleteMachineGroup(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DeleteTopicOutcome ClsClient::DeleteTopic(const DeleteTopicRequest &request)
  {
      auto outcome = MakeRequest(request, "DeleteTopic");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DeleteTopicResponse rsp = DeleteTopicResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DeleteTopicOutcome(rsp);
          else
              return DeleteTopicOutcome(o.GetError());
      }
      else
      {
          return DeleteTopicOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DeleteTopicAsync(const DeleteTopicRequest& request, const DeleteTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DeleteTopic(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DeleteTopicOutcomeCallable ClsClient::DeleteTopicCallable(const DeleteTopicRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DeleteTopicOutcome()>>(
          [this, request]()
          {
              return this->DeleteTopic(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeAlarmNoticesOutcome ClsClient::DescribeAlarmNotices(const DescribeAlarmNoticesRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeAlarmNotices");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeAlarmNoticesResponse rsp = DescribeAlarmNoticesResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeAlarmNoticesOutcome(rsp);
          else
              return DescribeAlarmNoticesOutcome(o.GetError());
      }
      else
      {
          return DescribeAlarmNoticesOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeAlarmNoticesAsync(const DescribeAlarmNoticesRequest& request, const DescribeAlarmNoticesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeAlarmNotices(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeAlarmNoticesOutcomeCallable ClsClient::DescribeAlarmNoticesCallable(const DescribeAlarmNoticesRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeAlarmNoticesOutcome()>>(
          [this, request]()
          {
              return this->DescribeAlarmNotices(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeAlarmsOutcome ClsClient::DescribeAlarms(const DescribeAlarmsRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeAlarms");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeAlarmsResponse rsp = DescribeAlarmsResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeAlarmsOutcome(rsp);
          else
              return DescribeAlarmsOutcome(o.GetError());
      }
      else
      {
          return DescribeAlarmsOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeAlarmsAsync(const DescribeAlarmsRequest& request, const DescribeAlarmsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeAlarms(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeAlarmsOutcomeCallable ClsClient::DescribeAlarmsCallable(const DescribeAlarmsRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeAlarmsOutcome()>>(
          [this, request]()
          {
              return this->DescribeAlarms(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeExportsOutcome ClsClient::DescribeExports(const DescribeExportsRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeExports");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeExportsResponse rsp = DescribeExportsResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeExportsOutcome(rsp);
          else
              return DescribeExportsOutcome(o.GetError());
      }
      else
      {
          return DescribeExportsOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeExportsAsync(const DescribeExportsRequest& request, const DescribeExportsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeExports(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeExportsOutcomeCallable ClsClient::DescribeExportsCallable(const DescribeExportsRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeExportsOutcome()>>(
          [this, request]()
          {
              return this->DescribeExports(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeIndexOutcome ClsClient::DescribeIndex(const DescribeIndexRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeIndex");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeIndexResponse rsp = DescribeIndexResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeIndexOutcome(rsp);
          else
              return DescribeIndexOutcome(o.GetError());
      }
      else
      {
          return DescribeIndexOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeIndexAsync(const DescribeIndexRequest& request, const DescribeIndexAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeIndex(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeIndexOutcomeCallable ClsClient::DescribeIndexCallable(const DescribeIndexRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeIndexOutcome()>>(
          [this, request]()
          {
              return this->DescribeIndex(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeLogContextOutcome ClsClient::DescribeLogContext(const DescribeLogContextRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeLogContext");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeLogContextResponse rsp = DescribeLogContextResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeLogContextOutcome(rsp);
          else
              return DescribeLogContextOutcome(o.GetError());
      }
      else
      {
          return DescribeLogContextOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeLogContextAsync(const DescribeLogContextRequest& request, const DescribeLogContextAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeLogContext(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeLogContextOutcomeCallable ClsClient::DescribeLogContextCallable(const DescribeLogContextRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeLogContextOutcome()>>(
          [this, request]()
          {
              return this->DescribeLogContext(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeMachineGroupsOutcome ClsClient::DescribeMachineGroups(const DescribeMachineGroupsRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeMachineGroups");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeMachineGroupsResponse rsp = DescribeMachineGroupsResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeMachineGroupsOutcome(rsp);
          else
              return DescribeMachineGroupsOutcome(o.GetError());
      }
      else
      {
          return DescribeMachineGroupsOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeMachineGroupsAsync(const DescribeMachineGroupsRequest& request, const DescribeMachineGroupsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeMachineGroups(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeMachineGroupsOutcomeCallable ClsClient::DescribeMachineGroupsCallable(const DescribeMachineGroupsRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeMachineGroupsOutcome()>>(
          [this, request]()
          {
              return this->DescribeMachineGroups(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeMachinesOutcome ClsClient::DescribeMachines(const DescribeMachinesRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeMachines");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeMachinesResponse rsp = DescribeMachinesResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeMachinesOutcome(rsp);
          else
              return DescribeMachinesOutcome(o.GetError());
      }
      else
      {
          return DescribeMachinesOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeMachinesAsync(const DescribeMachinesRequest& request, const DescribeMachinesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeMachines(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeMachinesOutcomeCallable ClsClient::DescribeMachinesCallable(const DescribeMachinesRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeMachinesOutcome()>>(
          [this, request]()
          {
              return this->DescribeMachines(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribePartitionsOutcome ClsClient::DescribePartitions(const DescribePartitionsRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribePartitions");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribePartitionsResponse rsp = DescribePartitionsResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribePartitionsOutcome(rsp);
          else
              return DescribePartitionsOutcome(o.GetError());
      }
      else
      {
          return DescribePartitionsOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribePartitionsAsync(const DescribePartitionsRequest& request, const DescribePartitionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribePartitions(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribePartitionsOutcomeCallable ClsClient::DescribePartitionsCallable(const DescribePartitionsRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribePartitionsOutcome()>>(
          [this, request]()
          {
              return this->DescribePartitions(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::DescribeTopicsOutcome ClsClient::DescribeTopics(const DescribeTopicsRequest &request)
  {
      auto outcome = MakeRequest(request, "DescribeTopics");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          DescribeTopicsResponse rsp = DescribeTopicsResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return DescribeTopicsOutcome(rsp);
          else
              return DescribeTopicsOutcome(o.GetError());
      }
      else
      {
          return DescribeTopicsOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::DescribeTopicsAsync(const DescribeTopicsRequest& request, const DescribeTopicsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->DescribeTopics(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::DescribeTopicsOutcomeCallable ClsClient::DescribeTopicsCallable(const DescribeTopicsRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<DescribeTopicsOutcome()>>(
          [this, request]()
          {
              return this->DescribeTopics(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::GetAlarmLogOutcome ClsClient::GetAlarmLog(const GetAlarmLogRequest &request)
  {
      auto outcome = MakeRequest(request, "GetAlarmLog");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          GetAlarmLogResponse rsp = GetAlarmLogResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return GetAlarmLogOutcome(rsp);
          else
              return GetAlarmLogOutcome(o.GetError());
      }
      else
      {
          return GetAlarmLogOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::GetAlarmLogAsync(const GetAlarmLogRequest& request, const GetAlarmLogAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->GetAlarmLog(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::GetAlarmLogOutcomeCallable ClsClient::GetAlarmLogCallable(const GetAlarmLogRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<GetAlarmLogOutcome()>>(
          [this, request]()
          {
              return this->GetAlarmLog(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::MergePartitionOutcome ClsClient::MergePartition(const MergePartitionRequest &request)
  {
      auto outcome = MakeRequest(request, "MergePartition");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          MergePartitionResponse rsp = MergePartitionResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return MergePartitionOutcome(rsp);
          else
              return MergePartitionOutcome(o.GetError());
      }
      else
      {
          return MergePartitionOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::MergePartitionAsync(const MergePartitionRequest& request, const MergePartitionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->MergePartition(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::MergePartitionOutcomeCallable ClsClient::MergePartitionCallable(const MergePartitionRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<MergePartitionOutcome()>>(
          [this, request]()
          {
              return this->MergePartition(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::ModifyAlarmOutcome ClsClient::ModifyAlarm(const ModifyAlarmRequest &request)
  {
      auto outcome = MakeRequest(request, "ModifyAlarm");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          ModifyAlarmResponse rsp = ModifyAlarmResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return ModifyAlarmOutcome(rsp);
          else
              return ModifyAlarmOutcome(o.GetError());
      }
      else
      {
          return ModifyAlarmOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::ModifyAlarmAsync(const ModifyAlarmRequest& request, const ModifyAlarmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->ModifyAlarm(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::ModifyAlarmOutcomeCallable ClsClient::ModifyAlarmCallable(const ModifyAlarmRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<ModifyAlarmOutcome()>>(
          [this, request]()
          {
              return this->ModifyAlarm(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::ModifyAlarmNoticeOutcome ClsClient::ModifyAlarmNotice(const ModifyAlarmNoticeRequest &request)
  {
      auto outcome = MakeRequest(request, "ModifyAlarmNotice");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          ModifyAlarmNoticeResponse rsp = ModifyAlarmNoticeResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return ModifyAlarmNoticeOutcome(rsp);
          else
              return ModifyAlarmNoticeOutcome(o.GetError());
      }
      else
      {
          return ModifyAlarmNoticeOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::ModifyAlarmNoticeAsync(const ModifyAlarmNoticeRequest& request, const ModifyAlarmNoticeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->ModifyAlarmNotice(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::ModifyAlarmNoticeOutcomeCallable ClsClient::ModifyAlarmNoticeCallable(const ModifyAlarmNoticeRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<ModifyAlarmNoticeOutcome()>>(
          [this, request]()
          {
              return this->ModifyAlarmNotice(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::ModifyIndexOutcome ClsClient::ModifyIndex(const ModifyIndexRequest &request)
  {
      auto outcome = MakeRequest(request, "ModifyIndex");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          ModifyIndexResponse rsp = ModifyIndexResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return ModifyIndexOutcome(rsp);
          else
              return ModifyIndexOutcome(o.GetError());
      }
      else
      {
          return ModifyIndexOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::ModifyIndexAsync(const ModifyIndexRequest& request, const ModifyIndexAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->ModifyIndex(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::ModifyIndexOutcomeCallable ClsClient::ModifyIndexCallable(const ModifyIndexRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<ModifyIndexOutcome()>>(
          [this, request]()
          {
              return this->ModifyIndex(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::ModifyMachineGroupOutcome ClsClient::ModifyMachineGroup(const ModifyMachineGroupRequest &request)
  {
      auto outcome = MakeRequest(request, "ModifyMachineGroup");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          ModifyMachineGroupResponse rsp = ModifyMachineGroupResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return ModifyMachineGroupOutcome(rsp);
          else
              return ModifyMachineGroupOutcome(o.GetError());
      }
      else
      {
          return ModifyMachineGroupOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::ModifyMachineGroupAsync(const ModifyMachineGroupRequest& request, const ModifyMachineGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->ModifyMachineGroup(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::ModifyMachineGroupOutcomeCallable ClsClient::ModifyMachineGroupCallable(const ModifyMachineGroupRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<ModifyMachineGroupOutcome()>>(
          [this, request]()
          {
              return this->ModifyMachineGroup(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::ModifyTopicOutcome ClsClient::ModifyTopic(const ModifyTopicRequest &request)
  {
      auto outcome = MakeRequest(request, "ModifyTopic");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          ModifyTopicResponse rsp = ModifyTopicResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return ModifyTopicOutcome(rsp);
          else
              return ModifyTopicOutcome(o.GetError());
      }
      else
      {
          return ModifyTopicOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::ModifyTopicAsync(const ModifyTopicRequest& request, const ModifyTopicAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->ModifyTopic(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::ModifyTopicOutcomeCallable ClsClient::ModifyTopicCallable(const ModifyTopicRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<ModifyTopicOutcome()>>(
          [this, request]()
          {
              return this->ModifyTopic(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::SearchLogOutcome ClsClient::SearchLog(const SearchLogRequest &request)
  {
      auto outcome = MakeRequest(request, "SearchLog");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          SearchLogResponse rsp = SearchLogResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return SearchLogOutcome(rsp);
          else
              return SearchLogOutcome(o.GetError());
      }
      else
      {
          return SearchLogOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::SearchLogAsync(const SearchLogRequest& request, const SearchLogAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->SearchLog(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::SearchLogOutcomeCallable ClsClient::SearchLogCallable(const SearchLogRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<SearchLogOutcome()>>(
          [this, request]()
          {
              return this->SearchLog(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  ClsClient::SplitPartitionOutcome ClsClient::SplitPartition(const SplitPartitionRequest &request)
  {
      auto outcome = MakeRequest(request, "SplitPartition");
      if (outcome.IsSuccess())
      {
          auto r = outcome.GetResult();
          string payload = string(r.Body(), r.BodySize());
          SplitPartitionResponse rsp = SplitPartitionResponse();
          auto o = rsp.Deserialize(payload);
          if (o.IsSuccess())
              return SplitPartitionOutcome(rsp);
          else
              return SplitPartitionOutcome(o.GetError());
      }
      else
      {
          return SplitPartitionOutcome(outcome.GetError());
      }
  }
  
  void ClsClient::SplitPartitionAsync(const SplitPartitionRequest& request, const SplitPartitionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
  {
      auto fn = [this, request, handler, context]()
      {
          handler(this, request, this->SplitPartition(request), context);
      };
  
      Executor::GetInstance()->Submit(new Runnable(fn));
  }
  
  ClsClient::SplitPartitionOutcomeCallable ClsClient::SplitPartitionCallable(const SplitPartitionRequest &request)
  {
      auto task = std::make_shared<std::packaged_task<SplitPartitionOutcome()>>(
          [this, request]()
          {
              return this->SplitPartition(request);
          }
      );
  
      Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
      return task->get_future();
  }
  
  