From feab9dcc06a08ffff3814d3534397d3d0e40d702 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Sun, 26 Apr 2020 16:18:38 +0800 Subject: [PATCH] New api publish. --- CHANGELOG | 3 + VERSION | 2 +- workorder/CMakeLists.txt | 110 +++++++ .../alibabacloud/workorder/WorkorderClient.h | 102 ++++++ .../alibabacloud/workorder/WorkorderExport.h | 32 ++ .../workorder/model/CloseTicketRequest.h | 51 +++ .../workorder/model/CloseTicketResult.h | 55 ++++ .../workorder/model/CreateTicketRequest.h | 72 +++++ .../workorder/model/CreateTicketResult.h | 57 ++++ .../workorder/model/ListCategoriesRequest.h | 51 +++ .../workorder/model/ListCategoriesResult.h | 66 ++++ .../workorder/model/ListProductsRequest.h | 48 +++ .../workorder/model/ListProductsResult.h | 93 ++++++ .../workorder/model/ListTicketNotesRequest.h | 51 +++ .../workorder/model/ListTicketNotesResult.h | 68 ++++ .../workorder/model/ListTicketsRequest.h | 72 +++++ .../workorder/model/ListTicketsResult.h | 72 +++++ .../workorder/model/ReplyTicketRequest.h | 57 ++++ .../workorder/model/ReplyTicketResult.h | 55 ++++ workorder/src/WorkorderClient.cc | 305 ++++++++++++++++++ workorder/src/model/CloseTicketRequest.cc | 51 +++ workorder/src/model/CloseTicketResult.cc | 65 ++++ workorder/src/model/CreateTicketRequest.cc | 128 ++++++++ workorder/src/model/CreateTicketResult.cc | 72 +++++ workorder/src/model/ListCategoriesRequest.cc | 51 +++ workorder/src/model/ListCategoriesResult.cc | 81 +++++ workorder/src/model/ListProductsRequest.cc | 40 +++ workorder/src/model/ListProductsResult.cc | 127 ++++++++ workorder/src/model/ListTicketNotesRequest.cc | 51 +++ workorder/src/model/ListTicketNotesResult.cc | 85 +++++ workorder/src/model/ListTicketsRequest.cc | 128 ++++++++ workorder/src/model/ListTicketsResult.cc | 93 ++++++ workorder/src/model/ReplyTicketRequest.cc | 73 +++++ workorder/src/model/ReplyTicketResult.cc | 65 ++++ 34 files changed, 2531 insertions(+), 1 deletion(-) create mode 100644 workorder/CMakeLists.txt create mode 100644 workorder/include/alibabacloud/workorder/WorkorderClient.h create mode 100644 workorder/include/alibabacloud/workorder/WorkorderExport.h create mode 100644 workorder/include/alibabacloud/workorder/model/CloseTicketRequest.h create mode 100644 workorder/include/alibabacloud/workorder/model/CloseTicketResult.h create mode 100644 workorder/include/alibabacloud/workorder/model/CreateTicketRequest.h create mode 100644 workorder/include/alibabacloud/workorder/model/CreateTicketResult.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListCategoriesRequest.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListCategoriesResult.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListProductsRequest.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListProductsResult.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListTicketNotesRequest.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListTicketNotesResult.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListTicketsRequest.h create mode 100644 workorder/include/alibabacloud/workorder/model/ListTicketsResult.h create mode 100644 workorder/include/alibabacloud/workorder/model/ReplyTicketRequest.h create mode 100644 workorder/include/alibabacloud/workorder/model/ReplyTicketResult.h create mode 100644 workorder/src/WorkorderClient.cc create mode 100644 workorder/src/model/CloseTicketRequest.cc create mode 100644 workorder/src/model/CloseTicketResult.cc create mode 100644 workorder/src/model/CreateTicketRequest.cc create mode 100644 workorder/src/model/CreateTicketResult.cc create mode 100644 workorder/src/model/ListCategoriesRequest.cc create mode 100644 workorder/src/model/ListCategoriesResult.cc create mode 100644 workorder/src/model/ListProductsRequest.cc create mode 100644 workorder/src/model/ListProductsResult.cc create mode 100644 workorder/src/model/ListTicketNotesRequest.cc create mode 100644 workorder/src/model/ListTicketNotesResult.cc create mode 100644 workorder/src/model/ListTicketsRequest.cc create mode 100644 workorder/src/model/ListTicketsResult.cc create mode 100644 workorder/src/model/ReplyTicketRequest.cc create mode 100644 workorder/src/model/ReplyTicketResult.cc diff --git a/CHANGELOG b/CHANGELOG index 988af9ac8..59736dd51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-04-26 Version: 1.36.379 +- New api publish. + 2020-04-25 Version: 1.36.378 - Generated 2015-01-01 for `R-kvstore`. - Add RestoreTime for CreateInstance API. diff --git a/VERSION b/VERSION index df8677299..ff5e50eab 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.378 \ No newline at end of file +1.36.379 \ No newline at end of file diff --git a/workorder/CMakeLists.txt b/workorder/CMakeLists.txt new file mode 100644 index 000000000..d88cfbed7 --- /dev/null +++ b/workorder/CMakeLists.txt @@ -0,0 +1,110 @@ +# +# 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. +# + +set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +set(workorder_public_header + include/alibabacloud/workorder/WorkorderClient.h + include/alibabacloud/workorder/WorkorderExport.h ) + +set(workorder_public_header_model + include/alibabacloud/workorder/model/CloseTicketRequest.h + include/alibabacloud/workorder/model/CloseTicketResult.h + include/alibabacloud/workorder/model/CreateTicketRequest.h + include/alibabacloud/workorder/model/CreateTicketResult.h + include/alibabacloud/workorder/model/ListCategoriesRequest.h + include/alibabacloud/workorder/model/ListCategoriesResult.h + include/alibabacloud/workorder/model/ListProductsRequest.h + include/alibabacloud/workorder/model/ListProductsResult.h + include/alibabacloud/workorder/model/ListTicketNotesRequest.h + include/alibabacloud/workorder/model/ListTicketNotesResult.h + include/alibabacloud/workorder/model/ListTicketsRequest.h + include/alibabacloud/workorder/model/ListTicketsResult.h + include/alibabacloud/workorder/model/ReplyTicketRequest.h + include/alibabacloud/workorder/model/ReplyTicketResult.h ) + +set(workorder_src + src/WorkorderClient.cc + src/model/CloseTicketRequest.cc + src/model/CloseTicketResult.cc + src/model/CreateTicketRequest.cc + src/model/CreateTicketResult.cc + src/model/ListCategoriesRequest.cc + src/model/ListCategoriesResult.cc + src/model/ListProductsRequest.cc + src/model/ListProductsResult.cc + src/model/ListTicketNotesRequest.cc + src/model/ListTicketNotesResult.cc + src/model/ListTicketsRequest.cc + src/model/ListTicketsResult.cc + src/model/ReplyTicketRequest.cc + src/model/ReplyTicketResult.cc ) + +add_library(workorder ${LIB_TYPE} + ${workorder_public_header} + ${workorder_public_header_model} + ${workorder_src}) + +set_target_properties(workorder + PROPERTIES + LINKER_LANGUAGE CXX + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}workorder + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(workorder + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_WORKORDER_LIBRARY) +endif() + +target_include_directories(workorder + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(workorder + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(workorder + jsoncpp) + target_include_directories(workorder + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(workorder + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(workorder + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(workorder + PRIVATE /usr/include/jsoncpp) + target_link_libraries(workorder + jsoncpp) +endif() + +install(FILES ${workorder_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/workorder) +install(FILES ${workorder_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/workorder/model) +install(TARGETS workorder + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/WorkorderClient.h b/workorder/include/alibabacloud/workorder/WorkorderClient.h new file mode 100644 index 000000000..3faf63072 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/WorkorderClient.h @@ -0,0 +1,102 @@ +/* + * 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_WORKORDER_WORKORDERCLIENT_H_ +#define ALIBABACLOUD_WORKORDER_WORKORDERCLIENT_H_ + +#include +#include +#include +#include +#include "WorkorderExport.h" +#include "model/CloseTicketRequest.h" +#include "model/CloseTicketResult.h" +#include "model/CreateTicketRequest.h" +#include "model/CreateTicketResult.h" +#include "model/ListCategoriesRequest.h" +#include "model/ListCategoriesResult.h" +#include "model/ListProductsRequest.h" +#include "model/ListProductsResult.h" +#include "model/ListTicketNotesRequest.h" +#include "model/ListTicketNotesResult.h" +#include "model/ListTicketsRequest.h" +#include "model/ListTicketsResult.h" +#include "model/ReplyTicketRequest.h" +#include "model/ReplyTicketResult.h" + + +namespace AlibabaCloud +{ + namespace Workorder + { + class ALIBABACLOUD_WORKORDER_EXPORT WorkorderClient : public RpcServiceClient + { + public: + typedef Outcome CloseTicketOutcome; + typedef std::future CloseTicketOutcomeCallable; + typedef std::function&)> CloseTicketAsyncHandler; + typedef Outcome CreateTicketOutcome; + typedef std::future CreateTicketOutcomeCallable; + typedef std::function&)> CreateTicketAsyncHandler; + typedef Outcome ListCategoriesOutcome; + typedef std::future ListCategoriesOutcomeCallable; + typedef std::function&)> ListCategoriesAsyncHandler; + typedef Outcome ListProductsOutcome; + typedef std::future ListProductsOutcomeCallable; + typedef std::function&)> ListProductsAsyncHandler; + typedef Outcome ListTicketNotesOutcome; + typedef std::future ListTicketNotesOutcomeCallable; + typedef std::function&)> ListTicketNotesAsyncHandler; + typedef Outcome ListTicketsOutcome; + typedef std::future ListTicketsOutcomeCallable; + typedef std::function&)> ListTicketsAsyncHandler; + typedef Outcome ReplyTicketOutcome; + typedef std::future ReplyTicketOutcomeCallable; + typedef std::function&)> ReplyTicketAsyncHandler; + + WorkorderClient(const Credentials &credentials, const ClientConfiguration &configuration); + WorkorderClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + WorkorderClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~WorkorderClient(); + CloseTicketOutcome closeTicket(const Model::CloseTicketRequest &request)const; + void closeTicketAsync(const Model::CloseTicketRequest& request, const CloseTicketAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CloseTicketOutcomeCallable closeTicketCallable(const Model::CloseTicketRequest& request) const; + CreateTicketOutcome createTicket(const Model::CreateTicketRequest &request)const; + void createTicketAsync(const Model::CreateTicketRequest& request, const CreateTicketAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateTicketOutcomeCallable createTicketCallable(const Model::CreateTicketRequest& request) const; + ListCategoriesOutcome listCategories(const Model::ListCategoriesRequest &request)const; + void listCategoriesAsync(const Model::ListCategoriesRequest& request, const ListCategoriesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListCategoriesOutcomeCallable listCategoriesCallable(const Model::ListCategoriesRequest& request) const; + ListProductsOutcome listProducts(const Model::ListProductsRequest &request)const; + void listProductsAsync(const Model::ListProductsRequest& request, const ListProductsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListProductsOutcomeCallable listProductsCallable(const Model::ListProductsRequest& request) const; + ListTicketNotesOutcome listTicketNotes(const Model::ListTicketNotesRequest &request)const; + void listTicketNotesAsync(const Model::ListTicketNotesRequest& request, const ListTicketNotesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListTicketNotesOutcomeCallable listTicketNotesCallable(const Model::ListTicketNotesRequest& request) const; + ListTicketsOutcome listTickets(const Model::ListTicketsRequest &request)const; + void listTicketsAsync(const Model::ListTicketsRequest& request, const ListTicketsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListTicketsOutcomeCallable listTicketsCallable(const Model::ListTicketsRequest& request) const; + ReplyTicketOutcome replyTicket(const Model::ReplyTicketRequest &request)const; + void replyTicketAsync(const Model::ReplyTicketRequest& request, const ReplyTicketAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ReplyTicketOutcomeCallable replyTicketCallable(const Model::ReplyTicketRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_WORKORDER_WORKORDERCLIENT_H_ diff --git a/workorder/include/alibabacloud/workorder/WorkorderExport.h b/workorder/include/alibabacloud/workorder/WorkorderExport.h new file mode 100644 index 000000000..09116d072 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/WorkorderExport.h @@ -0,0 +1,32 @@ +/* + * 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_WORKORDER_WORKORDEREXPORT_H_ +#define ALIBABACLOUD_WORKORDER_WORKORDEREXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_WORKORDER_LIBRARY) +# define ALIBABACLOUD_WORKORDER_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_WORKORDER_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_WORKORDER_EXPORT +#endif + +#endif // !ALIBABACLOUD_WORKORDER_WORKORDEREXPORT_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/CloseTicketRequest.h b/workorder/include/alibabacloud/workorder/model/CloseTicketRequest.h new file mode 100644 index 000000000..d8fdf765c --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/CloseTicketRequest.h @@ -0,0 +1,51 @@ +/* + * 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_WORKORDER_MODEL_CLOSETICKETREQUEST_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_CLOSETICKETREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT CloseTicketRequest : public RpcServiceRequest + { + + public: + CloseTicketRequest(); + ~CloseTicketRequest(); + + std::string getLanguage()const; + void setLanguage(const std::string& language); + std::string getTicketId()const; + void setTicketId(const std::string& ticketId); + + private: + std::string language_; + std::string ticketId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_CLOSETICKETREQUEST_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/CloseTicketResult.h b/workorder/include/alibabacloud/workorder/model/CloseTicketResult.h new file mode 100644 index 000000000..82d3b8d28 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/CloseTicketResult.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_WORKORDER_MODEL_CLOSETICKETRESULT_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_CLOSETICKETRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT CloseTicketResult : public ServiceResult + { + public: + + + CloseTicketResult(); + explicit CloseTicketResult(const std::string &payload); + ~CloseTicketResult(); + std::string getMessage()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_CLOSETICKETRESULT_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/CreateTicketRequest.h b/workorder/include/alibabacloud/workorder/model/CreateTicketRequest.h new file mode 100644 index 000000000..ca7ac7e8b --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/CreateTicketRequest.h @@ -0,0 +1,72 @@ +/* + * 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_WORKORDER_MODEL_CREATETICKETREQUEST_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_CREATETICKETREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT CreateTicketRequest : public RpcServiceRequest + { + + public: + CreateTicketRequest(); + ~CreateTicketRequest(); + + std::string getProductCode()const; + void setProductCode(const std::string& productCode); + std::string getLanguage()const; + void setLanguage(const std::string& language); + std::string getTitle()const; + void setTitle(const std::string& title); + std::string getContent()const; + void setContent(const std::string& content); + std::string getNotifyTimeRange()const; + void setNotifyTimeRange(const std::string& notifyTimeRange); + std::string getPhone()const; + void setPhone(const std::string& phone); + std::string getCategory()const; + void setCategory(const std::string& category); + std::string getEmail()const; + void setEmail(const std::string& email); + std::string getSecretContent()const; + void setSecretContent(const std::string& secretContent); + + private: + std::string productCode_; + std::string language_; + std::string title_; + std::string content_; + std::string notifyTimeRange_; + std::string phone_; + std::string category_; + std::string email_; + std::string secretContent_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_CREATETICKETREQUEST_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/CreateTicketResult.h b/workorder/include/alibabacloud/workorder/model/CreateTicketResult.h new file mode 100644 index 000000000..502ddd8f4 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/CreateTicketResult.h @@ -0,0 +1,57 @@ +/* + * 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_WORKORDER_MODEL_CREATETICKETRESULT_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_CREATETICKETRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT CreateTicketResult : public ServiceResult + { + public: + + + CreateTicketResult(); + explicit CreateTicketResult(const std::string &payload); + ~CreateTicketResult(); + std::string getMessage()const; + std::string getData()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::string data_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_CREATETICKETRESULT_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListCategoriesRequest.h b/workorder/include/alibabacloud/workorder/model/ListCategoriesRequest.h new file mode 100644 index 000000000..6f66b6925 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListCategoriesRequest.h @@ -0,0 +1,51 @@ +/* + * 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_WORKORDER_MODEL_LISTCATEGORIESREQUEST_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTCATEGORIESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListCategoriesRequest : public RpcServiceRequest + { + + public: + ListCategoriesRequest(); + ~ListCategoriesRequest(); + + std::string getProductCode()const; + void setProductCode(const std::string& productCode); + std::string getLanguage()const; + void setLanguage(const std::string& language); + + private: + std::string productCode_; + std::string language_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTCATEGORIESREQUEST_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListCategoriesResult.h b/workorder/include/alibabacloud/workorder/model/ListCategoriesResult.h new file mode 100644 index 000000000..03cf06072 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListCategoriesResult.h @@ -0,0 +1,66 @@ +/* + * 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_WORKORDER_MODEL_LISTCATEGORIESRESULT_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTCATEGORIESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListCategoriesResult : public ServiceResult + { + public: + struct Data + { + struct ListItem + { + int id; + std::string name; + }; + std::vector list; + }; + + + ListCategoriesResult(); + explicit ListCategoriesResult(const std::string &payload); + ~ListCategoriesResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTCATEGORIESRESULT_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListProductsRequest.h b/workorder/include/alibabacloud/workorder/model/ListProductsRequest.h new file mode 100644 index 000000000..5c99988a2 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListProductsRequest.h @@ -0,0 +1,48 @@ +/* + * 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_WORKORDER_MODEL_LISTPRODUCTSREQUEST_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTPRODUCTSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListProductsRequest : public RpcServiceRequest + { + + public: + ListProductsRequest(); + ~ListProductsRequest(); + + std::string getLanguage()const; + void setLanguage(const std::string& language); + + private: + std::string language_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTPRODUCTSREQUEST_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListProductsResult.h b/workorder/include/alibabacloud/workorder/model/ListProductsResult.h new file mode 100644 index 000000000..f81213531 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListProductsResult.h @@ -0,0 +1,93 @@ +/* + * 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_WORKORDER_MODEL_LISTPRODUCTSRESULT_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTPRODUCTSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListProductsResult : public ServiceResult + { + public: + struct Data + { + struct TechMoreItem + { + struct ProductListItem + { + std::string description; + std::string productCode; + std::string name; + }; + std::vector productList; + std::string groupName; + }; + struct HotConsultationItem + { + std::string description; + std::string productCode; + std::string name; + }; + struct ConsultationMoreItem + { + std::string description; + std::string productCode; + std::string name; + }; + struct HotTechItem + { + std::string description; + std::string productCode; + std::string name; + }; + std::vector consultationMore; + std::vector hotTech; + std::vector hotConsultation; + std::vector techMore; + }; + + + ListProductsResult(); + explicit ListProductsResult(const std::string &payload); + ~ListProductsResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTPRODUCTSRESULT_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListTicketNotesRequest.h b/workorder/include/alibabacloud/workorder/model/ListTicketNotesRequest.h new file mode 100644 index 000000000..0a300bf69 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListTicketNotesRequest.h @@ -0,0 +1,51 @@ +/* + * 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_WORKORDER_MODEL_LISTTICKETNOTESREQUEST_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETNOTESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListTicketNotesRequest : public RpcServiceRequest + { + + public: + ListTicketNotesRequest(); + ~ListTicketNotesRequest(); + + std::string getLanguage()const; + void setLanguage(const std::string& language); + std::string getTicketId()const; + void setTicketId(const std::string& ticketId); + + private: + std::string language_; + std::string ticketId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETNOTESREQUEST_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListTicketNotesResult.h b/workorder/include/alibabacloud/workorder/model/ListTicketNotesResult.h new file mode 100644 index 000000000..3726201f2 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListTicketNotesResult.h @@ -0,0 +1,68 @@ +/* + * 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_WORKORDER_MODEL_LISTTICKETNOTESRESULT_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETNOTESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListTicketNotesResult : public ServiceResult + { + public: + struct Data + { + struct ListItem + { + std::string noteId; + bool fromOfficial; + std::string content; + int gmtCreated; + }; + std::vector list; + }; + + + ListTicketNotesResult(); + explicit ListTicketNotesResult(const std::string &payload); + ~ListTicketNotesResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETNOTESRESULT_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListTicketsRequest.h b/workorder/include/alibabacloud/workorder/model/ListTicketsRequest.h new file mode 100644 index 000000000..acdc18eb1 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListTicketsRequest.h @@ -0,0 +1,72 @@ +/* + * 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_WORKORDER_MODEL_LISTTICKETSREQUEST_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListTicketsRequest : public RpcServiceRequest + { + + public: + ListTicketsRequest(); + ~ListTicketsRequest(); + + std::string getProductCode()const; + void setProductCode(const std::string& productCode); + std::string getLanguage()const; + void setLanguage(const std::string& language); + std::string getSubUserId()const; + void setSubUserId(const std::string& subUserId); + long getCreatedBeforeTime()const; + void setCreatedBeforeTime(long createdBeforeTime); + int getPageSize()const; + void setPageSize(int pageSize); + std::string getIds()const; + void setIds(const std::string& ids); + std::string getTicketStatus()const; + void setTicketStatus(const std::string& ticketStatus); + int getPageStart()const; + void setPageStart(int pageStart); + long getCreatedAfterTime()const; + void setCreatedAfterTime(long createdAfterTime); + + private: + std::string productCode_; + std::string language_; + std::string subUserId_; + long createdBeforeTime_; + int pageSize_; + std::string ids_; + std::string ticketStatus_; + int pageStart_; + long createdAfterTime_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETSREQUEST_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ListTicketsResult.h b/workorder/include/alibabacloud/workorder/model/ListTicketsResult.h new file mode 100644 index 000000000..ad684fb7b --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ListTicketsResult.h @@ -0,0 +1,72 @@ +/* + * 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_WORKORDER_MODEL_LISTTICKETSRESULT_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ListTicketsResult : public ServiceResult + { + public: + struct Data + { + struct ListItem + { + std::string creatorId; + std::string title; + std::string ticketStatus; + std::string id; + int addTime; + }; + int pageSize; + int currentPage; + int total; + std::vector list; + }; + + + ListTicketsResult(); + explicit ListTicketsResult(const std::string &payload); + ~ListTicketsResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_LISTTICKETSRESULT_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ReplyTicketRequest.h b/workorder/include/alibabacloud/workorder/model/ReplyTicketRequest.h new file mode 100644 index 000000000..d2cc2c735 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ReplyTicketRequest.h @@ -0,0 +1,57 @@ +/* + * 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_WORKORDER_MODEL_REPLYTICKETREQUEST_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_REPLYTICKETREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ReplyTicketRequest : public RpcServiceRequest + { + + public: + ReplyTicketRequest(); + ~ReplyTicketRequest(); + + std::string getLanguage()const; + void setLanguage(const std::string& language); + std::string getTicketId()const; + void setTicketId(const std::string& ticketId); + std::string getContent()const; + void setContent(const std::string& content); + std::string getSecretContent()const; + void setSecretContent(const std::string& secretContent); + + private: + std::string language_; + std::string ticketId_; + std::string content_; + std::string secretContent_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_REPLYTICKETREQUEST_H_ \ No newline at end of file diff --git a/workorder/include/alibabacloud/workorder/model/ReplyTicketResult.h b/workorder/include/alibabacloud/workorder/model/ReplyTicketResult.h new file mode 100644 index 000000000..087b4e702 --- /dev/null +++ b/workorder/include/alibabacloud/workorder/model/ReplyTicketResult.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_WORKORDER_MODEL_REPLYTICKETRESULT_H_ +#define ALIBABACLOUD_WORKORDER_MODEL_REPLYTICKETRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Workorder + { + namespace Model + { + class ALIBABACLOUD_WORKORDER_EXPORT ReplyTicketResult : public ServiceResult + { + public: + + + ReplyTicketResult(); + explicit ReplyTicketResult(const std::string &payload); + ~ReplyTicketResult(); + std::string getMessage()const; + int getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + int code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_WORKORDER_MODEL_REPLYTICKETRESULT_H_ \ No newline at end of file diff --git a/workorder/src/WorkorderClient.cc b/workorder/src/WorkorderClient.cc new file mode 100644 index 000000000..279813c59 --- /dev/null +++ b/workorder/src/WorkorderClient.cc @@ -0,0 +1,305 @@ +/* + * 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; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +namespace +{ + const std::string SERVICE_NAME = "Workorder"; +} + +WorkorderClient::WorkorderClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "workorder"); +} + +WorkorderClient::WorkorderClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "workorder"); +} + +WorkorderClient::WorkorderClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "workorder"); +} + +WorkorderClient::~WorkorderClient() +{} + +WorkorderClient::CloseTicketOutcome WorkorderClient::closeTicket(const CloseTicketRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CloseTicketOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CloseTicketOutcome(CloseTicketResult(outcome.result())); + else + return CloseTicketOutcome(outcome.error()); +} + +void WorkorderClient::closeTicketAsync(const CloseTicketRequest& request, const CloseTicketAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, closeTicket(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +WorkorderClient::CloseTicketOutcomeCallable WorkorderClient::closeTicketCallable(const CloseTicketRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->closeTicket(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +WorkorderClient::CreateTicketOutcome WorkorderClient::createTicket(const CreateTicketRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateTicketOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateTicketOutcome(CreateTicketResult(outcome.result())); + else + return CreateTicketOutcome(outcome.error()); +} + +void WorkorderClient::createTicketAsync(const CreateTicketRequest& request, const CreateTicketAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createTicket(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +WorkorderClient::CreateTicketOutcomeCallable WorkorderClient::createTicketCallable(const CreateTicketRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createTicket(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +WorkorderClient::ListCategoriesOutcome WorkorderClient::listCategories(const ListCategoriesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListCategoriesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListCategoriesOutcome(ListCategoriesResult(outcome.result())); + else + return ListCategoriesOutcome(outcome.error()); +} + +void WorkorderClient::listCategoriesAsync(const ListCategoriesRequest& request, const ListCategoriesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listCategories(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +WorkorderClient::ListCategoriesOutcomeCallable WorkorderClient::listCategoriesCallable(const ListCategoriesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listCategories(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +WorkorderClient::ListProductsOutcome WorkorderClient::listProducts(const ListProductsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListProductsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListProductsOutcome(ListProductsResult(outcome.result())); + else + return ListProductsOutcome(outcome.error()); +} + +void WorkorderClient::listProductsAsync(const ListProductsRequest& request, const ListProductsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listProducts(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +WorkorderClient::ListProductsOutcomeCallable WorkorderClient::listProductsCallable(const ListProductsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listProducts(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +WorkorderClient::ListTicketNotesOutcome WorkorderClient::listTicketNotes(const ListTicketNotesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListTicketNotesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListTicketNotesOutcome(ListTicketNotesResult(outcome.result())); + else + return ListTicketNotesOutcome(outcome.error()); +} + +void WorkorderClient::listTicketNotesAsync(const ListTicketNotesRequest& request, const ListTicketNotesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listTicketNotes(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +WorkorderClient::ListTicketNotesOutcomeCallable WorkorderClient::listTicketNotesCallable(const ListTicketNotesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listTicketNotes(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +WorkorderClient::ListTicketsOutcome WorkorderClient::listTickets(const ListTicketsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListTicketsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListTicketsOutcome(ListTicketsResult(outcome.result())); + else + return ListTicketsOutcome(outcome.error()); +} + +void WorkorderClient::listTicketsAsync(const ListTicketsRequest& request, const ListTicketsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listTickets(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +WorkorderClient::ListTicketsOutcomeCallable WorkorderClient::listTicketsCallable(const ListTicketsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listTickets(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +WorkorderClient::ReplyTicketOutcome WorkorderClient::replyTicket(const ReplyTicketRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ReplyTicketOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ReplyTicketOutcome(ReplyTicketResult(outcome.result())); + else + return ReplyTicketOutcome(outcome.error()); +} + +void WorkorderClient::replyTicketAsync(const ReplyTicketRequest& request, const ReplyTicketAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, replyTicket(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +WorkorderClient::ReplyTicketOutcomeCallable WorkorderClient::replyTicketCallable(const ReplyTicketRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->replyTicket(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/workorder/src/model/CloseTicketRequest.cc b/workorder/src/model/CloseTicketRequest.cc new file mode 100644 index 000000000..b40bd8985 --- /dev/null +++ b/workorder/src/model/CloseTicketRequest.cc @@ -0,0 +1,51 @@ +/* + * 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::Workorder::Model::CloseTicketRequest; + +CloseTicketRequest::CloseTicketRequest() : + RpcServiceRequest("workorder", "2020-03-26", "CloseTicket") +{ + setMethod(HttpRequest::Method::Post); +} + +CloseTicketRequest::~CloseTicketRequest() +{} + +std::string CloseTicketRequest::getLanguage()const +{ + return language_; +} + +void CloseTicketRequest::setLanguage(const std::string& language) +{ + language_ = language; + setParameter("Language", language); +} + +std::string CloseTicketRequest::getTicketId()const +{ + return ticketId_; +} + +void CloseTicketRequest::setTicketId(const std::string& ticketId) +{ + ticketId_ = ticketId; + setParameter("TicketId", ticketId); +} + diff --git a/workorder/src/model/CloseTicketResult.cc b/workorder/src/model/CloseTicketResult.cc new file mode 100644 index 000000000..439be7327 --- /dev/null +++ b/workorder/src/model/CloseTicketResult.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::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +CloseTicketResult::CloseTicketResult() : + ServiceResult() +{} + +CloseTicketResult::CloseTicketResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CloseTicketResult::~CloseTicketResult() +{} + +void CloseTicketResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string CloseTicketResult::getMessage()const +{ + return message_; +} + +int CloseTicketResult::getCode()const +{ + return code_; +} + +bool CloseTicketResult::getSuccess()const +{ + return success_; +} + diff --git a/workorder/src/model/CreateTicketRequest.cc b/workorder/src/model/CreateTicketRequest.cc new file mode 100644 index 000000000..5d01b7cf9 --- /dev/null +++ b/workorder/src/model/CreateTicketRequest.cc @@ -0,0 +1,128 @@ +/* + * 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::Workorder::Model::CreateTicketRequest; + +CreateTicketRequest::CreateTicketRequest() : + RpcServiceRequest("workorder", "2020-03-26", "CreateTicket") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateTicketRequest::~CreateTicketRequest() +{} + +std::string CreateTicketRequest::getProductCode()const +{ + return productCode_; +} + +void CreateTicketRequest::setProductCode(const std::string& productCode) +{ + productCode_ = productCode; + setParameter("ProductCode", productCode); +} + +std::string CreateTicketRequest::getLanguage()const +{ + return language_; +} + +void CreateTicketRequest::setLanguage(const std::string& language) +{ + language_ = language; + setParameter("Language", language); +} + +std::string CreateTicketRequest::getTitle()const +{ + return title_; +} + +void CreateTicketRequest::setTitle(const std::string& title) +{ + title_ = title; + setParameter("Title", title); +} + +std::string CreateTicketRequest::getContent()const +{ + return content_; +} + +void CreateTicketRequest::setContent(const std::string& content) +{ + content_ = content; + setParameter("Content", content); +} + +std::string CreateTicketRequest::getNotifyTimeRange()const +{ + return notifyTimeRange_; +} + +void CreateTicketRequest::setNotifyTimeRange(const std::string& notifyTimeRange) +{ + notifyTimeRange_ = notifyTimeRange; + setParameter("NotifyTimeRange", notifyTimeRange); +} + +std::string CreateTicketRequest::getPhone()const +{ + return phone_; +} + +void CreateTicketRequest::setPhone(const std::string& phone) +{ + phone_ = phone; + setParameter("Phone", phone); +} + +std::string CreateTicketRequest::getCategory()const +{ + return category_; +} + +void CreateTicketRequest::setCategory(const std::string& category) +{ + category_ = category; + setParameter("Category", category); +} + +std::string CreateTicketRequest::getEmail()const +{ + return email_; +} + +void CreateTicketRequest::setEmail(const std::string& email) +{ + email_ = email; + setParameter("Email", email); +} + +std::string CreateTicketRequest::getSecretContent()const +{ + return secretContent_; +} + +void CreateTicketRequest::setSecretContent(const std::string& secretContent) +{ + secretContent_ = secretContent; + setParameter("SecretContent", secretContent); +} + diff --git a/workorder/src/model/CreateTicketResult.cc b/workorder/src/model/CreateTicketResult.cc new file mode 100644 index 000000000..089865b87 --- /dev/null +++ b/workorder/src/model/CreateTicketResult.cc @@ -0,0 +1,72 @@ +/* + * 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::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +CreateTicketResult::CreateTicketResult() : + ServiceResult() +{} + +CreateTicketResult::CreateTicketResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateTicketResult::~CreateTicketResult() +{} + +void CreateTicketResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Data"].isNull()) + data_ = value["Data"].asString(); + +} + +std::string CreateTicketResult::getMessage()const +{ + return message_; +} + +std::string CreateTicketResult::getData()const +{ + return data_; +} + +std::string CreateTicketResult::getCode()const +{ + return code_; +} + +bool CreateTicketResult::getSuccess()const +{ + return success_; +} + diff --git a/workorder/src/model/ListCategoriesRequest.cc b/workorder/src/model/ListCategoriesRequest.cc new file mode 100644 index 000000000..4edbf3615 --- /dev/null +++ b/workorder/src/model/ListCategoriesRequest.cc @@ -0,0 +1,51 @@ +/* + * 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::Workorder::Model::ListCategoriesRequest; + +ListCategoriesRequest::ListCategoriesRequest() : + RpcServiceRequest("workorder", "2020-03-26", "ListCategories") +{ + setMethod(HttpRequest::Method::Post); +} + +ListCategoriesRequest::~ListCategoriesRequest() +{} + +std::string ListCategoriesRequest::getProductCode()const +{ + return productCode_; +} + +void ListCategoriesRequest::setProductCode(const std::string& productCode) +{ + productCode_ = productCode; + setParameter("ProductCode", productCode); +} + +std::string ListCategoriesRequest::getLanguage()const +{ + return language_; +} + +void ListCategoriesRequest::setLanguage(const std::string& language) +{ + language_ = language; + setParameter("Language", language); +} + diff --git a/workorder/src/model/ListCategoriesResult.cc b/workorder/src/model/ListCategoriesResult.cc new file mode 100644 index 000000000..6f8bbfe96 --- /dev/null +++ b/workorder/src/model/ListCategoriesResult.cc @@ -0,0 +1,81 @@ +/* + * 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::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +ListCategoriesResult::ListCategoriesResult() : + ServiceResult() +{} + +ListCategoriesResult::ListCategoriesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListCategoriesResult::~ListCategoriesResult() +{} + +void ListCategoriesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allListNode = dataNode["List"]["ListItem"]; + for (auto dataNodeListListItem : allListNode) + { + Data::ListItem listItemObject; + if(!dataNodeListListItem["Id"].isNull()) + listItemObject.id = std::stoi(dataNodeListListItem["Id"].asString()); + if(!dataNodeListListItem["Name"].isNull()) + listItemObject.name = dataNodeListListItem["Name"].asString(); + data_.list.push_back(listItemObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +std::string ListCategoriesResult::getMessage()const +{ + return message_; +} + +ListCategoriesResult::Data ListCategoriesResult::getData()const +{ + return data_; +} + +int ListCategoriesResult::getCode()const +{ + return code_; +} + +bool ListCategoriesResult::getSuccess()const +{ + return success_; +} + diff --git a/workorder/src/model/ListProductsRequest.cc b/workorder/src/model/ListProductsRequest.cc new file mode 100644 index 000000000..832309957 --- /dev/null +++ b/workorder/src/model/ListProductsRequest.cc @@ -0,0 +1,40 @@ +/* + * 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::Workorder::Model::ListProductsRequest; + +ListProductsRequest::ListProductsRequest() : + RpcServiceRequest("workorder", "2020-03-26", "ListProducts") +{ + setMethod(HttpRequest::Method::Post); +} + +ListProductsRequest::~ListProductsRequest() +{} + +std::string ListProductsRequest::getLanguage()const +{ + return language_; +} + +void ListProductsRequest::setLanguage(const std::string& language) +{ + language_ = language; + setParameter("Language", language); +} + diff --git a/workorder/src/model/ListProductsResult.cc b/workorder/src/model/ListProductsResult.cc new file mode 100644 index 000000000..9fa958879 --- /dev/null +++ b/workorder/src/model/ListProductsResult.cc @@ -0,0 +1,127 @@ +/* + * 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::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +ListProductsResult::ListProductsResult() : + ServiceResult() +{} + +ListProductsResult::ListProductsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListProductsResult::~ListProductsResult() +{} + +void ListProductsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allTechMoreNode = dataNode["TechMore"]["TechMoreItem"]; + for (auto dataNodeTechMoreTechMoreItem : allTechMoreNode) + { + Data::TechMoreItem techMoreItemObject; + if(!dataNodeTechMoreTechMoreItem["GroupName"].isNull()) + techMoreItemObject.groupName = dataNodeTechMoreTechMoreItem["GroupName"].asString(); + auto allProductListNode = allTechMoreNode["ProductList"]["ProductListItem"]; + for (auto allTechMoreNodeProductListProductListItem : allProductListNode) + { + Data::TechMoreItem::ProductListItem productListObject; + if(!allTechMoreNodeProductListProductListItem["Name"].isNull()) + productListObject.name = allTechMoreNodeProductListProductListItem["Name"].asString(); + if(!allTechMoreNodeProductListProductListItem["ProductCode"].isNull()) + productListObject.productCode = allTechMoreNodeProductListProductListItem["ProductCode"].asString(); + if(!allTechMoreNodeProductListProductListItem["Description"].isNull()) + productListObject.description = allTechMoreNodeProductListProductListItem["Description"].asString(); + techMoreItemObject.productList.push_back(productListObject); + } + data_.techMore.push_back(techMoreItemObject); + } + auto allHotConsultationNode = dataNode["HotConsultation"]["HotConsultationItem"]; + for (auto dataNodeHotConsultationHotConsultationItem : allHotConsultationNode) + { + Data::HotConsultationItem hotConsultationItemObject; + if(!dataNodeHotConsultationHotConsultationItem["Name"].isNull()) + hotConsultationItemObject.name = dataNodeHotConsultationHotConsultationItem["Name"].asString(); + if(!dataNodeHotConsultationHotConsultationItem["ProductCode"].isNull()) + hotConsultationItemObject.productCode = dataNodeHotConsultationHotConsultationItem["ProductCode"].asString(); + if(!dataNodeHotConsultationHotConsultationItem["Description"].isNull()) + hotConsultationItemObject.description = dataNodeHotConsultationHotConsultationItem["Description"].asString(); + data_.hotConsultation.push_back(hotConsultationItemObject); + } + auto allConsultationMoreNode = dataNode["ConsultationMore"]["ConsultationMoreItem"]; + for (auto dataNodeConsultationMoreConsultationMoreItem : allConsultationMoreNode) + { + Data::ConsultationMoreItem consultationMoreItemObject; + if(!dataNodeConsultationMoreConsultationMoreItem["Name"].isNull()) + consultationMoreItemObject.name = dataNodeConsultationMoreConsultationMoreItem["Name"].asString(); + if(!dataNodeConsultationMoreConsultationMoreItem["ProductCode"].isNull()) + consultationMoreItemObject.productCode = dataNodeConsultationMoreConsultationMoreItem["ProductCode"].asString(); + if(!dataNodeConsultationMoreConsultationMoreItem["Description"].isNull()) + consultationMoreItemObject.description = dataNodeConsultationMoreConsultationMoreItem["Description"].asString(); + data_.consultationMore.push_back(consultationMoreItemObject); + } + auto allHotTechNode = dataNode["HotTech"]["HotTechItem"]; + for (auto dataNodeHotTechHotTechItem : allHotTechNode) + { + Data::HotTechItem hotTechItemObject; + if(!dataNodeHotTechHotTechItem["Name"].isNull()) + hotTechItemObject.name = dataNodeHotTechHotTechItem["Name"].asString(); + if(!dataNodeHotTechHotTechItem["ProductCode"].isNull()) + hotTechItemObject.productCode = dataNodeHotTechHotTechItem["ProductCode"].asString(); + if(!dataNodeHotTechHotTechItem["Description"].isNull()) + hotTechItemObject.description = dataNodeHotTechHotTechItem["Description"].asString(); + data_.hotTech.push_back(hotTechItemObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string ListProductsResult::getMessage()const +{ + return message_; +} + +ListProductsResult::Data ListProductsResult::getData()const +{ + return data_; +} + +int ListProductsResult::getCode()const +{ + return code_; +} + +bool ListProductsResult::getSuccess()const +{ + return success_; +} + diff --git a/workorder/src/model/ListTicketNotesRequest.cc b/workorder/src/model/ListTicketNotesRequest.cc new file mode 100644 index 000000000..62a6d36b6 --- /dev/null +++ b/workorder/src/model/ListTicketNotesRequest.cc @@ -0,0 +1,51 @@ +/* + * 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::Workorder::Model::ListTicketNotesRequest; + +ListTicketNotesRequest::ListTicketNotesRequest() : + RpcServiceRequest("workorder", "2020-03-26", "ListTicketNotes") +{ + setMethod(HttpRequest::Method::Post); +} + +ListTicketNotesRequest::~ListTicketNotesRequest() +{} + +std::string ListTicketNotesRequest::getLanguage()const +{ + return language_; +} + +void ListTicketNotesRequest::setLanguage(const std::string& language) +{ + language_ = language; + setParameter("Language", language); +} + +std::string ListTicketNotesRequest::getTicketId()const +{ + return ticketId_; +} + +void ListTicketNotesRequest::setTicketId(const std::string& ticketId) +{ + ticketId_ = ticketId; + setParameter("TicketId", ticketId); +} + diff --git a/workorder/src/model/ListTicketNotesResult.cc b/workorder/src/model/ListTicketNotesResult.cc new file mode 100644 index 000000000..79dfa066e --- /dev/null +++ b/workorder/src/model/ListTicketNotesResult.cc @@ -0,0 +1,85 @@ +/* + * 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::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +ListTicketNotesResult::ListTicketNotesResult() : + ServiceResult() +{} + +ListTicketNotesResult::ListTicketNotesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListTicketNotesResult::~ListTicketNotesResult() +{} + +void ListTicketNotesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + auto allListNode = dataNode["List"]["ListItem"]; + for (auto dataNodeListListItem : allListNode) + { + Data::ListItem listItemObject; + if(!dataNodeListListItem["FromOfficial"].isNull()) + listItemObject.fromOfficial = dataNodeListListItem["FromOfficial"].asString() == "true"; + if(!dataNodeListListItem["GmtCreated"].isNull()) + listItemObject.gmtCreated = std::stoi(dataNodeListListItem["GmtCreated"].asString()); + if(!dataNodeListListItem["NoteId"].isNull()) + listItemObject.noteId = dataNodeListListItem["NoteId"].asString(); + if(!dataNodeListListItem["Content"].isNull()) + listItemObject.content = dataNodeListListItem["Content"].asString(); + data_.list.push_back(listItemObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string ListTicketNotesResult::getMessage()const +{ + return message_; +} + +ListTicketNotesResult::Data ListTicketNotesResult::getData()const +{ + return data_; +} + +int ListTicketNotesResult::getCode()const +{ + return code_; +} + +bool ListTicketNotesResult::getSuccess()const +{ + return success_; +} + diff --git a/workorder/src/model/ListTicketsRequest.cc b/workorder/src/model/ListTicketsRequest.cc new file mode 100644 index 000000000..999c40c53 --- /dev/null +++ b/workorder/src/model/ListTicketsRequest.cc @@ -0,0 +1,128 @@ +/* + * 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::Workorder::Model::ListTicketsRequest; + +ListTicketsRequest::ListTicketsRequest() : + RpcServiceRequest("workorder", "2020-03-26", "ListTickets") +{ + setMethod(HttpRequest::Method::Post); +} + +ListTicketsRequest::~ListTicketsRequest() +{} + +std::string ListTicketsRequest::getProductCode()const +{ + return productCode_; +} + +void ListTicketsRequest::setProductCode(const std::string& productCode) +{ + productCode_ = productCode; + setParameter("ProductCode", productCode); +} + +std::string ListTicketsRequest::getLanguage()const +{ + return language_; +} + +void ListTicketsRequest::setLanguage(const std::string& language) +{ + language_ = language; + setParameter("Language", language); +} + +std::string ListTicketsRequest::getSubUserId()const +{ + return subUserId_; +} + +void ListTicketsRequest::setSubUserId(const std::string& subUserId) +{ + subUserId_ = subUserId; + setParameter("SubUserId", subUserId); +} + +long ListTicketsRequest::getCreatedBeforeTime()const +{ + return createdBeforeTime_; +} + +void ListTicketsRequest::setCreatedBeforeTime(long createdBeforeTime) +{ + createdBeforeTime_ = createdBeforeTime; + setParameter("CreatedBeforeTime", std::to_string(createdBeforeTime)); +} + +int ListTicketsRequest::getPageSize()const +{ + return pageSize_; +} + +void ListTicketsRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListTicketsRequest::getIds()const +{ + return ids_; +} + +void ListTicketsRequest::setIds(const std::string& ids) +{ + ids_ = ids; + setParameter("Ids", ids); +} + +std::string ListTicketsRequest::getTicketStatus()const +{ + return ticketStatus_; +} + +void ListTicketsRequest::setTicketStatus(const std::string& ticketStatus) +{ + ticketStatus_ = ticketStatus; + setParameter("TicketStatus", ticketStatus); +} + +int ListTicketsRequest::getPageStart()const +{ + return pageStart_; +} + +void ListTicketsRequest::setPageStart(int pageStart) +{ + pageStart_ = pageStart; + setParameter("PageStart", std::to_string(pageStart)); +} + +long ListTicketsRequest::getCreatedAfterTime()const +{ + return createdAfterTime_; +} + +void ListTicketsRequest::setCreatedAfterTime(long createdAfterTime) +{ + createdAfterTime_ = createdAfterTime; + setParameter("CreatedAfterTime", std::to_string(createdAfterTime)); +} + diff --git a/workorder/src/model/ListTicketsResult.cc b/workorder/src/model/ListTicketsResult.cc new file mode 100644 index 000000000..47f2258cd --- /dev/null +++ b/workorder/src/model/ListTicketsResult.cc @@ -0,0 +1,93 @@ +/* + * 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::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +ListTicketsResult::ListTicketsResult() : + ServiceResult() +{} + +ListTicketsResult::ListTicketsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListTicketsResult::~ListTicketsResult() +{} + +void ListTicketsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Total"].isNull()) + data_.total = std::stoi(dataNode["Total"].asString()); + if(!dataNode["PageSize"].isNull()) + data_.pageSize = std::stoi(dataNode["PageSize"].asString()); + if(!dataNode["CurrentPage"].isNull()) + data_.currentPage = std::stoi(dataNode["CurrentPage"].asString()); + auto allListNode = dataNode["List"]["ListItem"]; + for (auto dataNodeListListItem : allListNode) + { + Data::ListItem listItemObject; + if(!dataNodeListListItem["AddTime"].isNull()) + listItemObject.addTime = std::stoi(dataNodeListListItem["AddTime"].asString()); + if(!dataNodeListListItem["TicketStatus"].isNull()) + listItemObject.ticketStatus = dataNodeListListItem["TicketStatus"].asString(); + if(!dataNodeListListItem["CreatorId"].isNull()) + listItemObject.creatorId = dataNodeListListItem["CreatorId"].asString(); + if(!dataNodeListListItem["Id"].isNull()) + listItemObject.id = dataNodeListListItem["Id"].asString(); + if(!dataNodeListListItem["Title"].isNull()) + listItemObject.title = dataNodeListListItem["Title"].asString(); + data_.list.push_back(listItemObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string ListTicketsResult::getMessage()const +{ + return message_; +} + +ListTicketsResult::Data ListTicketsResult::getData()const +{ + return data_; +} + +int ListTicketsResult::getCode()const +{ + return code_; +} + +bool ListTicketsResult::getSuccess()const +{ + return success_; +} + diff --git a/workorder/src/model/ReplyTicketRequest.cc b/workorder/src/model/ReplyTicketRequest.cc new file mode 100644 index 000000000..4a752ed95 --- /dev/null +++ b/workorder/src/model/ReplyTicketRequest.cc @@ -0,0 +1,73 @@ +/* + * 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::Workorder::Model::ReplyTicketRequest; + +ReplyTicketRequest::ReplyTicketRequest() : + RpcServiceRequest("workorder", "2020-03-26", "ReplyTicket") +{ + setMethod(HttpRequest::Method::Post); +} + +ReplyTicketRequest::~ReplyTicketRequest() +{} + +std::string ReplyTicketRequest::getLanguage()const +{ + return language_; +} + +void ReplyTicketRequest::setLanguage(const std::string& language) +{ + language_ = language; + setParameter("Language", language); +} + +std::string ReplyTicketRequest::getTicketId()const +{ + return ticketId_; +} + +void ReplyTicketRequest::setTicketId(const std::string& ticketId) +{ + ticketId_ = ticketId; + setParameter("TicketId", ticketId); +} + +std::string ReplyTicketRequest::getContent()const +{ + return content_; +} + +void ReplyTicketRequest::setContent(const std::string& content) +{ + content_ = content; + setParameter("Content", content); +} + +std::string ReplyTicketRequest::getSecretContent()const +{ + return secretContent_; +} + +void ReplyTicketRequest::setSecretContent(const std::string& secretContent) +{ + secretContent_ = secretContent; + setParameter("SecretContent", secretContent); +} + diff --git a/workorder/src/model/ReplyTicketResult.cc b/workorder/src/model/ReplyTicketResult.cc new file mode 100644 index 000000000..f7399baf7 --- /dev/null +++ b/workorder/src/model/ReplyTicketResult.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::Workorder; +using namespace AlibabaCloud::Workorder::Model; + +ReplyTicketResult::ReplyTicketResult() : + ServiceResult() +{} + +ReplyTicketResult::ReplyTicketResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ReplyTicketResult::~ReplyTicketResult() +{} + +void ReplyTicketResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string ReplyTicketResult::getMessage()const +{ + return message_; +} + +int ReplyTicketResult::getCode()const +{ + return code_; +} + +bool ReplyTicketResult::getSuccess()const +{ + return success_; +} +