Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ec9faabe1 | ||
|
|
dddd6b352c |
@@ -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
|
||||
|
||||
@@ -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<Error, Model::GetAsrConfigResult> GetAsrConfigOutcome;
|
||||
typedef std::future<GetAsrConfigOutcome> GetAsrConfigOutcomeCallable;
|
||||
typedef std::function<void(const VoiceNavigatorClient*, const Model::GetAsrConfigRequest&, const GetAsrConfigOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetAsrConfigAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetRealTimeConcurrencyResult> GetRealTimeConcurrencyOutcome;
|
||||
typedef std::future<GetRealTimeConcurrencyOutcome> GetRealTimeConcurrencyOutcomeCallable;
|
||||
typedef std::function<void(const VoiceNavigatorClient*, const Model::GetRealTimeConcurrencyRequest&, const GetRealTimeConcurrencyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetRealTimeConcurrencyAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListChatbotInstancesResult> ListChatbotInstancesOutcome;
|
||||
typedef std::future<ListChatbotInstancesOutcome> ListChatbotInstancesOutcomeCallable;
|
||||
typedef std::function<void(const VoiceNavigatorClient*, const Model::ListChatbotInstancesRequest&, const ListChatbotInstancesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListChatbotInstancesOutcomeCallable listChatbotInstancesCallable(const Model::ListChatbotInstancesRequest& request) const;
|
||||
|
||||
@@ -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 <alibabacloud/voicenavigator/VoiceNavigatorExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
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_
|
||||
@@ -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 <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/voicenavigator/VoiceNavigatorExport.h>
|
||||
|
||||
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_
|
||||
@@ -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<const AsyncCallerContext>& 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<std::packaged_task<GetRealTimeConcurrencyOutcome()>>(
|
||||
[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();
|
||||
|
||||
36
voicenavigator/src/model/GetRealTimeConcurrencyRequest.cc
Normal file
36
voicenavigator/src/model/GetRealTimeConcurrencyRequest.cc
Normal file
@@ -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 <alibabacloud/voicenavigator/model/GetRealTimeConcurrencyRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
65
voicenavigator/src/model/GetRealTimeConcurrencyResult.cc
Normal file
65
voicenavigator/src/model/GetRealTimeConcurrencyResult.cc
Normal file
@@ -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 <alibabacloud/voicenavigator/model/GetRealTimeConcurrencyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user