Add Chat Session Query Support.
This commit is contained in:
@@ -21,13 +21,21 @@ set(lingmou_public_header
|
||||
include/alibabacloud/lingmou/LingMouExport.h )
|
||||
|
||||
set(lingmou_public_header_model
|
||||
include/alibabacloud/lingmou/model/CloseChatInstanceSessionsRequest.h
|
||||
include/alibabacloud/lingmou/model/CloseChatInstanceSessionsResult.h
|
||||
include/alibabacloud/lingmou/model/CreateChatSessionRequest.h
|
||||
include/alibabacloud/lingmou/model/CreateChatSessionResult.h )
|
||||
include/alibabacloud/lingmou/model/CreateChatSessionResult.h
|
||||
include/alibabacloud/lingmou/model/QueryChatInstanceSessionsRequest.h
|
||||
include/alibabacloud/lingmou/model/QueryChatInstanceSessionsResult.h )
|
||||
|
||||
set(lingmou_src
|
||||
src/LingMouClient.cc
|
||||
src/model/CloseChatInstanceSessionsRequest.cc
|
||||
src/model/CloseChatInstanceSessionsResult.cc
|
||||
src/model/CreateChatSessionRequest.cc
|
||||
src/model/CreateChatSessionResult.cc )
|
||||
src/model/CreateChatSessionResult.cc
|
||||
src/model/QueryChatInstanceSessionsRequest.cc
|
||||
src/model/QueryChatInstanceSessionsResult.cc )
|
||||
|
||||
add_library(lingmou ${LIB_TYPE}
|
||||
${lingmou_public_header}
|
||||
|
||||
@@ -22,8 +22,12 @@
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RoaServiceClient.h>
|
||||
#include "LingMouExport.h"
|
||||
#include "model/CloseChatInstanceSessionsRequest.h"
|
||||
#include "model/CloseChatInstanceSessionsResult.h"
|
||||
#include "model/CreateChatSessionRequest.h"
|
||||
#include "model/CreateChatSessionResult.h"
|
||||
#include "model/QueryChatInstanceSessionsRequest.h"
|
||||
#include "model/QueryChatInstanceSessionsResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
@@ -33,17 +37,29 @@ namespace AlibabaCloud
|
||||
class ALIBABACLOUD_LINGMOU_EXPORT LingMouClient : public RoaServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::CloseChatInstanceSessionsResult> CloseChatInstanceSessionsOutcome;
|
||||
typedef std::future<CloseChatInstanceSessionsOutcome> CloseChatInstanceSessionsOutcomeCallable;
|
||||
typedef std::function<void(const LingMouClient*, const Model::CloseChatInstanceSessionsRequest&, const CloseChatInstanceSessionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CloseChatInstanceSessionsAsyncHandler;
|
||||
typedef Outcome<Error, Model::CreateChatSessionResult> CreateChatSessionOutcome;
|
||||
typedef std::future<CreateChatSessionOutcome> CreateChatSessionOutcomeCallable;
|
||||
typedef std::function<void(const LingMouClient*, const Model::CreateChatSessionRequest&, const CreateChatSessionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateChatSessionAsyncHandler;
|
||||
typedef Outcome<Error, Model::QueryChatInstanceSessionsResult> QueryChatInstanceSessionsOutcome;
|
||||
typedef std::future<QueryChatInstanceSessionsOutcome> QueryChatInstanceSessionsOutcomeCallable;
|
||||
typedef std::function<void(const LingMouClient*, const Model::QueryChatInstanceSessionsRequest&, const QueryChatInstanceSessionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryChatInstanceSessionsAsyncHandler;
|
||||
|
||||
LingMouClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
LingMouClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
LingMouClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~LingMouClient();
|
||||
CloseChatInstanceSessionsOutcome closeChatInstanceSessions(const Model::CloseChatInstanceSessionsRequest &request)const;
|
||||
void closeChatInstanceSessionsAsync(const Model::CloseChatInstanceSessionsRequest& request, const CloseChatInstanceSessionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CloseChatInstanceSessionsOutcomeCallable closeChatInstanceSessionsCallable(const Model::CloseChatInstanceSessionsRequest& request) const;
|
||||
CreateChatSessionOutcome createChatSession(const Model::CreateChatSessionRequest &request)const;
|
||||
void createChatSessionAsync(const Model::CreateChatSessionRequest& request, const CreateChatSessionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CreateChatSessionOutcomeCallable createChatSessionCallable(const Model::CreateChatSessionRequest& request) const;
|
||||
QueryChatInstanceSessionsOutcome queryChatInstanceSessions(const Model::QueryChatInstanceSessionsRequest &request)const;
|
||||
void queryChatInstanceSessionsAsync(const Model::QueryChatInstanceSessionsRequest& request, const QueryChatInstanceSessionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryChatInstanceSessionsOutcomeCallable queryChatInstanceSessionsCallable(const Model::QueryChatInstanceSessionsRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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_LINGMOU_MODEL_CLOSECHATINSTANCESESSIONSREQUEST_H_
|
||||
#define ALIBABACLOUD_LINGMOU_MODEL_CLOSECHATINSTANCESESSIONSREQUEST_H_
|
||||
|
||||
#include <alibabacloud/lingmou/LingMouExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace LingMou {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_LINGMOU_EXPORT CloseChatInstanceSessionsRequest : public RoaServiceRequest {
|
||||
public:
|
||||
CloseChatInstanceSessionsRequest();
|
||||
~CloseChatInstanceSessionsRequest();
|
||||
std::string getInstanceId() const;
|
||||
void setInstanceId(const std::string &instanceId);
|
||||
std::string getSessionIds() const;
|
||||
void setSessionIds(const std::string &sessionIds);
|
||||
|
||||
private:
|
||||
std::string instanceId_;
|
||||
std::string sessionIds_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace LingMou
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_LINGMOU_MODEL_CLOSECHATINSTANCESESSIONSREQUEST_H_
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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_LINGMOU_MODEL_CLOSECHATINSTANCESESSIONSRESULT_H_
|
||||
#define ALIBABACLOUD_LINGMOU_MODEL_CLOSECHATINSTANCESESSIONSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/lingmou/LingMouExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace LingMou
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_LINGMOU_EXPORT CloseChatInstanceSessionsResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataItem
|
||||
{
|
||||
long createdAt;
|
||||
std::string sessionId;
|
||||
long mainAccountId;
|
||||
};
|
||||
|
||||
|
||||
CloseChatInstanceSessionsResult();
|
||||
explicit CloseChatInstanceSessionsResult(const std::string &payload);
|
||||
~CloseChatInstanceSessionsResult();
|
||||
std::vector<DataItem> getdata()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getMessage()const;
|
||||
int getHttpStatusCode()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<DataItem> data_;
|
||||
std::string requestId_;
|
||||
std::string message_;
|
||||
int httpStatusCode_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_LINGMOU_MODEL_CLOSECHATINSTANCESESSIONSRESULT_H_
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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_LINGMOU_MODEL_QUERYCHATINSTANCESESSIONSREQUEST_H_
|
||||
#define ALIBABACLOUD_LINGMOU_MODEL_QUERYCHATINSTANCESESSIONSREQUEST_H_
|
||||
|
||||
#include <alibabacloud/lingmou/LingMouExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace LingMou {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_LINGMOU_EXPORT QueryChatInstanceSessionsRequest : public RoaServiceRequest {
|
||||
public:
|
||||
QueryChatInstanceSessionsRequest();
|
||||
~QueryChatInstanceSessionsRequest();
|
||||
std::string getInstanceId() const;
|
||||
void setInstanceId(const std::string &instanceId);
|
||||
std::string getSessionIds() const;
|
||||
void setSessionIds(const std::string &sessionIds);
|
||||
|
||||
private:
|
||||
std::string instanceId_;
|
||||
std::string sessionIds_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace LingMou
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_LINGMOU_MODEL_QUERYCHATINSTANCESESSIONSREQUEST_H_
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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_LINGMOU_MODEL_QUERYCHATINSTANCESESSIONSRESULT_H_
|
||||
#define ALIBABACLOUD_LINGMOU_MODEL_QUERYCHATINSTANCESESSIONSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/lingmou/LingMouExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace LingMou
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_LINGMOU_EXPORT QueryChatInstanceSessionsResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataItem
|
||||
{
|
||||
long createdAt;
|
||||
std::string sessionId;
|
||||
long mainAccountId;
|
||||
};
|
||||
|
||||
|
||||
QueryChatInstanceSessionsResult();
|
||||
explicit QueryChatInstanceSessionsResult(const std::string &payload);
|
||||
~QueryChatInstanceSessionsResult();
|
||||
std::vector<DataItem> getdata()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getMessage()const;
|
||||
int getHttpStatusCode()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<DataItem> data_;
|
||||
std::string requestId_;
|
||||
std::string message_;
|
||||
int httpStatusCode_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_LINGMOU_MODEL_QUERYCHATINSTANCESESSIONSRESULT_H_
|
||||
@@ -51,6 +51,42 @@ LingMouClient::LingMouClient(const std::string & accessKeyId, const std::string
|
||||
LingMouClient::~LingMouClient()
|
||||
{}
|
||||
|
||||
LingMouClient::CloseChatInstanceSessionsOutcome LingMouClient::closeChatInstanceSessions(const CloseChatInstanceSessionsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CloseChatInstanceSessionsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CloseChatInstanceSessionsOutcome(CloseChatInstanceSessionsResult(outcome.result()));
|
||||
else
|
||||
return CloseChatInstanceSessionsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void LingMouClient::closeChatInstanceSessionsAsync(const CloseChatInstanceSessionsRequest& request, const CloseChatInstanceSessionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, closeChatInstanceSessions(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
LingMouClient::CloseChatInstanceSessionsOutcomeCallable LingMouClient::closeChatInstanceSessionsCallable(const CloseChatInstanceSessionsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CloseChatInstanceSessionsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->closeChatInstanceSessions(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
LingMouClient::CreateChatSessionOutcome LingMouClient::createChatSession(const CreateChatSessionRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -87,3 +123,39 @@ LingMouClient::CreateChatSessionOutcomeCallable LingMouClient::createChatSession
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
LingMouClient::QueryChatInstanceSessionsOutcome LingMouClient::queryChatInstanceSessions(const QueryChatInstanceSessionsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryChatInstanceSessionsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryChatInstanceSessionsOutcome(QueryChatInstanceSessionsResult(outcome.result()));
|
||||
else
|
||||
return QueryChatInstanceSessionsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void LingMouClient::queryChatInstanceSessionsAsync(const QueryChatInstanceSessionsRequest& request, const QueryChatInstanceSessionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryChatInstanceSessions(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
LingMouClient::QueryChatInstanceSessionsOutcomeCallable LingMouClient::queryChatInstanceSessionsCallable(const QueryChatInstanceSessionsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryChatInstanceSessionsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryChatInstanceSessions(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
|
||||
46
lingmou/src/model/CloseChatInstanceSessionsRequest.cc
Normal file
46
lingmou/src/model/CloseChatInstanceSessionsRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/lingmou/model/CloseChatInstanceSessionsRequest.h>
|
||||
|
||||
using AlibabaCloud::LingMou::Model::CloseChatInstanceSessionsRequest;
|
||||
|
||||
CloseChatInstanceSessionsRequest::CloseChatInstanceSessionsRequest()
|
||||
: RoaServiceRequest("lingmou", "2025-05-27") {
|
||||
setResourcePath("/openapi/chat/instances/[instanceId]/sessions/close"};
|
||||
setMethod(HttpRequest::Method::Put);
|
||||
}
|
||||
|
||||
CloseChatInstanceSessionsRequest::~CloseChatInstanceSessionsRequest() {}
|
||||
|
||||
std::string CloseChatInstanceSessionsRequest::getInstanceId() const {
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void CloseChatInstanceSessionsRequest::setInstanceId(const std::string &instanceId) {
|
||||
instanceId_ = instanceId;
|
||||
setParameter(std::string("instanceId"), instanceId);
|
||||
}
|
||||
|
||||
std::string CloseChatInstanceSessionsRequest::getSessionIds() const {
|
||||
return sessionIds_;
|
||||
}
|
||||
|
||||
void CloseChatInstanceSessionsRequest::setSessionIds(const std::string &sessionIds) {
|
||||
sessionIds_ = sessionIds;
|
||||
setBodyParameter(std::string("sessionIds"), sessionIds);
|
||||
}
|
||||
|
||||
96
lingmou/src/model/CloseChatInstanceSessionsResult.cc
Normal file
96
lingmou/src/model/CloseChatInstanceSessionsResult.cc
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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/lingmou/model/CloseChatInstanceSessionsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::LingMou;
|
||||
using namespace AlibabaCloud::LingMou::Model;
|
||||
|
||||
CloseChatInstanceSessionsResult::CloseChatInstanceSessionsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CloseChatInstanceSessionsResult::CloseChatInstanceSessionsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CloseChatInstanceSessionsResult::~CloseChatInstanceSessionsResult()
|
||||
{}
|
||||
|
||||
void CloseChatInstanceSessionsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto alldataNode = value["data"]["dataItem"];
|
||||
for (auto valuedatadataItem : alldataNode)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!valuedatadataItem["sessionId"].isNull())
|
||||
dataObject.sessionId = valuedatadataItem["sessionId"].asString();
|
||||
if(!valuedatadataItem["mainAccountId"].isNull())
|
||||
dataObject.mainAccountId = std::stol(valuedatadataItem["mainAccountId"].asString());
|
||||
if(!valuedatadataItem["createdAt"].isNull())
|
||||
dataObject.createdAt = std::stol(valuedatadataItem["createdAt"].asString());
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = std::stoi(value["httpStatusCode"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<CloseChatInstanceSessionsResult::DataItem> CloseChatInstanceSessionsResult::getdata()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string CloseChatInstanceSessionsResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string CloseChatInstanceSessionsResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int CloseChatInstanceSessionsResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
std::string CloseChatInstanceSessionsResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool CloseChatInstanceSessionsResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
46
lingmou/src/model/QueryChatInstanceSessionsRequest.cc
Normal file
46
lingmou/src/model/QueryChatInstanceSessionsRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/lingmou/model/QueryChatInstanceSessionsRequest.h>
|
||||
|
||||
using AlibabaCloud::LingMou::Model::QueryChatInstanceSessionsRequest;
|
||||
|
||||
QueryChatInstanceSessionsRequest::QueryChatInstanceSessionsRequest()
|
||||
: RoaServiceRequest("lingmou", "2025-05-27") {
|
||||
setResourcePath("/openapi/chat/instances/[instanceId]/sessions"};
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
QueryChatInstanceSessionsRequest::~QueryChatInstanceSessionsRequest() {}
|
||||
|
||||
std::string QueryChatInstanceSessionsRequest::getInstanceId() const {
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void QueryChatInstanceSessionsRequest::setInstanceId(const std::string &instanceId) {
|
||||
instanceId_ = instanceId;
|
||||
setParameter(std::string("instanceId"), instanceId);
|
||||
}
|
||||
|
||||
std::string QueryChatInstanceSessionsRequest::getSessionIds() const {
|
||||
return sessionIds_;
|
||||
}
|
||||
|
||||
void QueryChatInstanceSessionsRequest::setSessionIds(const std::string &sessionIds) {
|
||||
sessionIds_ = sessionIds;
|
||||
setParameter(std::string("sessionIds"), sessionIds);
|
||||
}
|
||||
|
||||
96
lingmou/src/model/QueryChatInstanceSessionsResult.cc
Normal file
96
lingmou/src/model/QueryChatInstanceSessionsResult.cc
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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/lingmou/model/QueryChatInstanceSessionsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::LingMou;
|
||||
using namespace AlibabaCloud::LingMou::Model;
|
||||
|
||||
QueryChatInstanceSessionsResult::QueryChatInstanceSessionsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryChatInstanceSessionsResult::QueryChatInstanceSessionsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryChatInstanceSessionsResult::~QueryChatInstanceSessionsResult()
|
||||
{}
|
||||
|
||||
void QueryChatInstanceSessionsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto alldataNode = value["data"]["dataItem"];
|
||||
for (auto valuedatadataItem : alldataNode)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!valuedatadataItem["sessionId"].isNull())
|
||||
dataObject.sessionId = valuedatadataItem["sessionId"].asString();
|
||||
if(!valuedatadataItem["mainAccountId"].isNull())
|
||||
dataObject.mainAccountId = std::stol(valuedatadataItem["mainAccountId"].asString());
|
||||
if(!valuedatadataItem["createdAt"].isNull())
|
||||
dataObject.createdAt = std::stol(valuedatadataItem["createdAt"].asString());
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = std::stoi(value["httpStatusCode"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<QueryChatInstanceSessionsResult::DataItem> QueryChatInstanceSessionsResult::getdata()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string QueryChatInstanceSessionsResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string QueryChatInstanceSessionsResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int QueryChatInstanceSessionsResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
std::string QueryChatInstanceSessionsResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool QueryChatInstanceSessionsResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user