diff --git a/VERSION b/VERSION index 52e87cfe6..0fb465636 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1238 \ No newline at end of file +1.36.1239 \ No newline at end of file diff --git a/voicenavigator/CMakeLists.txt b/voicenavigator/CMakeLists.txt index ec6ca2c46..f67b5beff 100644 --- a/voicenavigator/CMakeLists.txt +++ b/voicenavigator/CMakeLists.txt @@ -73,6 +73,8 @@ set(voicenavigator_public_header_model include/alibabacloud/voicenavigator/model/GenerateUploadUrlResult.h include/alibabacloud/voicenavigator/model/GetAsrConfigRequest.h include/alibabacloud/voicenavigator/model/GetAsrConfigResult.h + include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyRequest.h + include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyResult.h include/alibabacloud/voicenavigator/model/ListChatbotInstancesRequest.h include/alibabacloud/voicenavigator/model/ListChatbotInstancesResult.h include/alibabacloud/voicenavigator/model/ListConversationDetailsRequest.h @@ -156,6 +158,8 @@ set(voicenavigator_src src/model/GenerateUploadUrlResult.cc src/model/GetAsrConfigRequest.cc src/model/GetAsrConfigResult.cc + src/model/GetRealTimeConcurrencyRequest.cc + src/model/GetRealTimeConcurrencyResult.cc src/model/ListChatbotInstancesRequest.cc src/model/ListChatbotInstancesResult.cc src/model/ListConversationDetailsRequest.cc diff --git a/voicenavigator/include/alibabacloud/voicenavigator/VoiceNavigatorClient.h b/voicenavigator/include/alibabacloud/voicenavigator/VoiceNavigatorClient.h index 68945a33f..f66c92f64 100644 --- a/voicenavigator/include/alibabacloud/voicenavigator/VoiceNavigatorClient.h +++ b/voicenavigator/include/alibabacloud/voicenavigator/VoiceNavigatorClient.h @@ -74,6 +74,8 @@ #include "model/GenerateUploadUrlResult.h" #include "model/GetAsrConfigRequest.h" #include "model/GetAsrConfigResult.h" +#include "model/GetRealTimeConcurrencyRequest.h" +#include "model/GetRealTimeConcurrencyResult.h" #include "model/ListChatbotInstancesRequest.h" #include "model/ListChatbotInstancesResult.h" #include "model/ListConversationDetailsRequest.h" @@ -189,6 +191,9 @@ namespace AlibabaCloud typedef Outcome GetAsrConfigOutcome; typedef std::future GetAsrConfigOutcomeCallable; typedef std::function&)> GetAsrConfigAsyncHandler; + typedef Outcome GetRealTimeConcurrencyOutcome; + typedef std::future GetRealTimeConcurrencyOutcomeCallable; + typedef std::function&)> GetRealTimeConcurrencyAsyncHandler; typedef Outcome ListChatbotInstancesOutcome; typedef std::future ListChatbotInstancesOutcomeCallable; typedef std::function&)> ListChatbotInstancesAsyncHandler; @@ -314,6 +319,9 @@ namespace AlibabaCloud GetAsrConfigOutcome getAsrConfig(const Model::GetAsrConfigRequest &request)const; void getAsrConfigAsync(const Model::GetAsrConfigRequest& request, const GetAsrConfigAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetAsrConfigOutcomeCallable getAsrConfigCallable(const Model::GetAsrConfigRequest& request) const; + GetRealTimeConcurrencyOutcome getRealTimeConcurrency(const Model::GetRealTimeConcurrencyRequest &request)const; + void getRealTimeConcurrencyAsync(const Model::GetRealTimeConcurrencyRequest& request, const GetRealTimeConcurrencyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetRealTimeConcurrencyOutcomeCallable getRealTimeConcurrencyCallable(const Model::GetRealTimeConcurrencyRequest& request) const; ListChatbotInstancesOutcome listChatbotInstances(const Model::ListChatbotInstancesRequest &request)const; void listChatbotInstancesAsync(const Model::ListChatbotInstancesRequest& request, const ListChatbotInstancesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListChatbotInstancesOutcomeCallable listChatbotInstancesCallable(const Model::ListChatbotInstancesRequest& request) const; diff --git a/voicenavigator/include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyRequest.h b/voicenavigator/include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyRequest.h new file mode 100644 index 000000000..35f5071fe --- /dev/null +++ b/voicenavigator/include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyRequest.h @@ -0,0 +1,42 @@ +/* + * Copyright 2009-2017 Alibaba Cloud 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. + */ + +#ifndef ALIBABACLOUD_VOICENAVIGATOR_MODEL_GETREALTIMECONCURRENCYREQUEST_H_ +#define ALIBABACLOUD_VOICENAVIGATOR_MODEL_GETREALTIMECONCURRENCYREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace VoiceNavigator { +namespace Model { +class ALIBABACLOUD_VOICENAVIGATOR_EXPORT GetRealTimeConcurrencyRequest : public RpcServiceRequest { +public: + GetRealTimeConcurrencyRequest(); + ~GetRealTimeConcurrencyRequest(); + std::string getInstanceId() const; + void setInstanceId(const std::string &instanceId); + +private: + std::string instanceId_; +}; +} // namespace Model +} // namespace VoiceNavigator +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_VOICENAVIGATOR_MODEL_GETREALTIMECONCURRENCYREQUEST_H_ diff --git a/voicenavigator/include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyResult.h b/voicenavigator/include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyResult.h new file mode 100644 index 000000000..944019315 --- /dev/null +++ b/voicenavigator/include/alibabacloud/voicenavigator/model/GetRealTimeConcurrencyResult.h @@ -0,0 +1,55 @@ +/* + * Copyright 2009-2017 Alibaba Cloud 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. + */ + +#ifndef ALIBABACLOUD_VOICENAVIGATOR_MODEL_GETREALTIMECONCURRENCYRESULT_H_ +#define ALIBABACLOUD_VOICENAVIGATOR_MODEL_GETREALTIMECONCURRENCYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace VoiceNavigator + { + namespace Model + { + class ALIBABACLOUD_VOICENAVIGATOR_EXPORT GetRealTimeConcurrencyResult : public ServiceResult + { + public: + + + GetRealTimeConcurrencyResult(); + explicit GetRealTimeConcurrencyResult(const std::string &payload); + ~GetRealTimeConcurrencyResult(); + long getMaxConcurrency()const; + long getTimestamp()const; + long getRealTimeConcurrency()const; + + protected: + void parse(const std::string &payload); + private: + long maxConcurrency_; + long timestamp_; + long realTimeConcurrency_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VOICENAVIGATOR_MODEL_GETREALTIMECONCURRENCYRESULT_H_ \ No newline at end of file diff --git a/voicenavigator/src/VoiceNavigatorClient.cc b/voicenavigator/src/VoiceNavigatorClient.cc index aa94742c0..a7c301ce3 100644 --- a/voicenavigator/src/VoiceNavigatorClient.cc +++ b/voicenavigator/src/VoiceNavigatorClient.cc @@ -987,6 +987,42 @@ VoiceNavigatorClient::GetAsrConfigOutcomeCallable VoiceNavigatorClient::getAsrCo return task->get_future(); } +VoiceNavigatorClient::GetRealTimeConcurrencyOutcome VoiceNavigatorClient::getRealTimeConcurrency(const GetRealTimeConcurrencyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetRealTimeConcurrencyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetRealTimeConcurrencyOutcome(GetRealTimeConcurrencyResult(outcome.result())); + else + return GetRealTimeConcurrencyOutcome(outcome.error()); +} + +void VoiceNavigatorClient::getRealTimeConcurrencyAsync(const GetRealTimeConcurrencyRequest& request, const GetRealTimeConcurrencyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getRealTimeConcurrency(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +VoiceNavigatorClient::GetRealTimeConcurrencyOutcomeCallable VoiceNavigatorClient::getRealTimeConcurrencyCallable(const GetRealTimeConcurrencyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getRealTimeConcurrency(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + VoiceNavigatorClient::ListChatbotInstancesOutcome VoiceNavigatorClient::listChatbotInstances(const ListChatbotInstancesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/voicenavigator/src/model/GetRealTimeConcurrencyRequest.cc b/voicenavigator/src/model/GetRealTimeConcurrencyRequest.cc new file mode 100644 index 000000000..e3fddc52a --- /dev/null +++ b/voicenavigator/src/model/GetRealTimeConcurrencyRequest.cc @@ -0,0 +1,36 @@ +/* + * Copyright 2009-2017 Alibaba Cloud 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 + +using AlibabaCloud::VoiceNavigator::Model::GetRealTimeConcurrencyRequest; + +GetRealTimeConcurrencyRequest::GetRealTimeConcurrencyRequest() + : RpcServiceRequest("voicenavigator", "2018-06-12", "GetRealTimeConcurrency") { + setMethod(HttpRequest::Method::Get); +} + +GetRealTimeConcurrencyRequest::~GetRealTimeConcurrencyRequest() {} + +std::string GetRealTimeConcurrencyRequest::getInstanceId() const { + return instanceId_; +} + +void GetRealTimeConcurrencyRequest::setInstanceId(const std::string &instanceId) { + instanceId_ = instanceId; + setParameter(std::string("InstanceId"), instanceId); +} + diff --git a/voicenavigator/src/model/GetRealTimeConcurrencyResult.cc b/voicenavigator/src/model/GetRealTimeConcurrencyResult.cc new file mode 100644 index 000000000..d28dfcf83 --- /dev/null +++ b/voicenavigator/src/model/GetRealTimeConcurrencyResult.cc @@ -0,0 +1,65 @@ +/* + * Copyright 2009-2017 Alibaba Cloud 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 +#include + +using namespace AlibabaCloud::VoiceNavigator; +using namespace AlibabaCloud::VoiceNavigator::Model; + +GetRealTimeConcurrencyResult::GetRealTimeConcurrencyResult() : + ServiceResult() +{} + +GetRealTimeConcurrencyResult::GetRealTimeConcurrencyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetRealTimeConcurrencyResult::~GetRealTimeConcurrencyResult() +{} + +void GetRealTimeConcurrencyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Timestamp"].isNull()) + timestamp_ = std::stol(value["Timestamp"].asString()); + if(!value["RealTimeConcurrency"].isNull()) + realTimeConcurrency_ = std::stol(value["RealTimeConcurrency"].asString()); + if(!value["MaxConcurrency"].isNull()) + maxConcurrency_ = std::stol(value["MaxConcurrency"].asString()); + +} + +long GetRealTimeConcurrencyResult::getMaxConcurrency()const +{ + return maxConcurrency_; +} + +long GetRealTimeConcurrencyResult::getTimestamp()const +{ + return timestamp_; +} + +long GetRealTimeConcurrencyResult::getRealTimeConcurrency()const +{ + return realTimeConcurrency_; +} +