bailianchatbot-20241105/include/alibabacloud/bailian_chat_bot_20241105.hpp (192 lines of code) (raw):

// This file is auto-generated, don't edit it. Thanks. #ifndef ALIBABACLOUD_BAILIANCHATBOT20241105_H_ #define ALIBABACLOUD_BAILIANCHATBOT20241105_H_ #include <alibabacloud/open_api.hpp> #include <boost/any.hpp> #include <darabonba/core.hpp> #include <darabonba/util.hpp> #include <iostream> #include <map> using namespace std; namespace Alibabacloud_BailianChatBot20241105 { class SseChatRequest : public Darabonba::Model { public: shared_ptr<string> appId{}; shared_ptr<string> command{}; shared_ptr<string> senderId{}; shared_ptr<string> senderNick{}; shared_ptr<string> sessionId{}; shared_ptr<string> utterance{}; shared_ptr<string> vendorParam{}; shared_ptr<string> workspaceId{}; SseChatRequest() {} explicit SseChatRequest(const std::map<string, boost::any> &config) : Darabonba::Model(config) { fromMap(config); }; void validate() override {} map<string, boost::any> toMap() override { map<string, boost::any> res; if (appId) { res["AppId"] = boost::any(*appId); } if (command) { res["Command"] = boost::any(*command); } if (senderId) { res["SenderId"] = boost::any(*senderId); } if (senderNick) { res["SenderNick"] = boost::any(*senderNick); } if (sessionId) { res["SessionId"] = boost::any(*sessionId); } if (utterance) { res["Utterance"] = boost::any(*utterance); } if (vendorParam) { res["VendorParam"] = boost::any(*vendorParam); } if (workspaceId) { res["WorkspaceId"] = boost::any(*workspaceId); } return res; } void fromMap(map<string, boost::any> m) override { if (m.find("AppId") != m.end() && !m["AppId"].empty()) { appId = make_shared<string>(boost::any_cast<string>(m["AppId"])); } if (m.find("Command") != m.end() && !m["Command"].empty()) { command = make_shared<string>(boost::any_cast<string>(m["Command"])); } if (m.find("SenderId") != m.end() && !m["SenderId"].empty()) { senderId = make_shared<string>(boost::any_cast<string>(m["SenderId"])); } if (m.find("SenderNick") != m.end() && !m["SenderNick"].empty()) { senderNick = make_shared<string>(boost::any_cast<string>(m["SenderNick"])); } if (m.find("SessionId") != m.end() && !m["SessionId"].empty()) { sessionId = make_shared<string>(boost::any_cast<string>(m["SessionId"])); } if (m.find("Utterance") != m.end() && !m["Utterance"].empty()) { utterance = make_shared<string>(boost::any_cast<string>(m["Utterance"])); } if (m.find("VendorParam") != m.end() && !m["VendorParam"].empty()) { vendorParam = make_shared<string>(boost::any_cast<string>(m["VendorParam"])); } if (m.find("WorkspaceId") != m.end() && !m["WorkspaceId"].empty()) { workspaceId = make_shared<string>(boost::any_cast<string>(m["WorkspaceId"])); } } virtual ~SseChatRequest() = default; }; class SseChatResponseBody : public Darabonba::Model { public: shared_ptr<string> code{}; shared_ptr<boost::any> data{}; shared_ptr<string> message{}; shared_ptr<string> requestId{}; shared_ptr<bool> success{}; SseChatResponseBody() {} explicit SseChatResponseBody(const std::map<string, boost::any> &config) : Darabonba::Model(config) { fromMap(config); }; void validate() override {} map<string, boost::any> toMap() override { map<string, boost::any> res; if (code) { res["Code"] = boost::any(*code); } if (data) { res["Data"] = boost::any(*data); } if (message) { res["Message"] = boost::any(*message); } if (requestId) { res["RequestId"] = boost::any(*requestId); } if (success) { res["Success"] = boost::any(*success); } return res; } void fromMap(map<string, boost::any> m) override { if (m.find("Code") != m.end() && !m["Code"].empty()) { code = make_shared<string>(boost::any_cast<string>(m["Code"])); } if (m.find("Data") != m.end() && !m["Data"].empty()) { data = make_shared<boost::any>(boost::any_cast<boost::any>(m["Data"])); } if (m.find("Message") != m.end() && !m["Message"].empty()) { message = make_shared<string>(boost::any_cast<string>(m["Message"])); } if (m.find("RequestId") != m.end() && !m["RequestId"].empty()) { requestId = make_shared<string>(boost::any_cast<string>(m["RequestId"])); } if (m.find("Success") != m.end() && !m["Success"].empty()) { success = make_shared<bool>(boost::any_cast<bool>(m["Success"])); } } virtual ~SseChatResponseBody() = default; }; class SseChatResponse : public Darabonba::Model { public: shared_ptr<map<string, string>> headers{}; shared_ptr<long> statusCode{}; shared_ptr<SseChatResponseBody> body{}; SseChatResponse() {} explicit SseChatResponse(const std::map<string, boost::any> &config) : Darabonba::Model(config) { fromMap(config); }; void validate() override {} map<string, boost::any> toMap() override { map<string, boost::any> res; if (headers) { res["headers"] = boost::any(*headers); } if (statusCode) { res["statusCode"] = boost::any(*statusCode); } if (body) { res["body"] = body ? boost::any(body->toMap()) : boost::any(map<string,boost::any>({})); } return res; } void fromMap(map<string, boost::any> m) override { if (m.find("headers") != m.end() && !m["headers"].empty()) { map<string, string> map1 = boost::any_cast<map<string, string>>(m["headers"]); map<string, string> toMap1; for (auto item:map1) { toMap1[item.first] = item.second; } headers = make_shared<map<string, string>>(toMap1); } if (m.find("statusCode") != m.end() && !m["statusCode"].empty()) { statusCode = make_shared<long>(boost::any_cast<long>(m["statusCode"])); } if (m.find("body") != m.end() && !m["body"].empty()) { if (typeid(map<string, boost::any>) == m["body"].type()) { SseChatResponseBody model1; model1.fromMap(boost::any_cast<map<string, boost::any>>(m["body"])); body = make_shared<SseChatResponseBody>(model1); } } } virtual ~SseChatResponse() = default; }; class Client : Alibabacloud_OpenApi::Client { public: explicit Client(const shared_ptr<Alibabacloud_OpenApi::Config>& config); string getEndpoint(shared_ptr<string> productId, shared_ptr<string> regionId, shared_ptr<string> endpointRule, shared_ptr<string> network, shared_ptr<string> suffix, shared_ptr<map<string, string>> endpointMap, shared_ptr<string> endpoint); SseChatResponse sseChatWithOptions(shared_ptr<SseChatRequest> request, shared_ptr<Darabonba_Util::RuntimeOptions> runtime); SseChatResponse sseChat(shared_ptr<SseChatRequest> request); virtual ~Client() = default; }; } // namespace Alibabacloud_BailianChatBot20241105 #endif