diff --git a/CHANGELOG b/CHANGELOG index 13f1f8fb2..4d8c60ca1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-12-12 Version 1.36.211 +- Generated 2019-06-10 for `et-industry-openapi`. + 2019-12-11 Version 1.36.210 - Supported Sync predict for Image. - Supported Set Frame Frequency for Stream Predict. diff --git a/VERSION b/VERSION index 6b26cdc31..48a48428a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.210 \ No newline at end of file +1.36.211 \ No newline at end of file diff --git a/et-industry-openapi/CMakeLists.txt b/et-industry-openapi/CMakeLists.txt new file mode 100644 index 000000000..3280d7cc0 --- /dev/null +++ b/et-industry-openapi/CMakeLists.txt @@ -0,0 +1,86 @@ +# +# 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(et-industry-openapi_public_header + include/alibabacloud/et-industry-openapi/Et_industry_openapiClient.h + include/alibabacloud/et-industry-openapi/Et_industry_openapiExport.h ) + +set(et-industry-openapi_public_header_model + include/alibabacloud/et-industry-openapi/model/UploadDeviceDataRequest.h + include/alibabacloud/et-industry-openapi/model/UploadDeviceDataResult.h ) + +set(et-industry-openapi_src + src/Et-industry-openapiClient.cc + src/model/UploadDeviceDataRequest.cc + src/model/UploadDeviceDataResult.cc ) + +add_library(et-industry-openapi ${LIB_TYPE} + ${et-industry-openapi_public_header} + ${et-industry-openapi_public_header_model} + ${et-industry-openapi_src}) + +set_target_properties(et-industry-openapi + 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}et-industry-openapi + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(et-industry-openapi + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_ET_INDUSTRY_OPENAPI_LIBRARY) +endif() + +target_include_directories(et-industry-openapi + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(et-industry-openapi + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(et-industry-openapi + jsoncpp) + target_include_directories(et-industry-openapi + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(et-industry-openapi + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(et-industry-openapi + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(et-industry-openapi + PRIVATE /usr/include/jsoncpp) + target_link_libraries(et-industry-openapi + jsoncpp) +endif() + +install(FILES ${et-industry-openapi_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/et-industry-openapi) +install(FILES ${et-industry-openapi_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/et-industry-openapi/model) +install(TARGETS et-industry-openapi + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/et-industry-openapi/include/alibabacloud/et-industry-openapi/Et_industry_openapiClient.h b/et-industry-openapi/include/alibabacloud/et-industry-openapi/Et_industry_openapiClient.h new file mode 100644 index 000000000..84bd3fc2d --- /dev/null +++ b/et-industry-openapi/include/alibabacloud/et-industry-openapi/Et_industry_openapiClient.h @@ -0,0 +1,54 @@ +/* + * 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_ET_INDUSTRY_OPENAPI_ET_INDUSTRY_OPENAPICLIENT_H_ +#define ALIBABACLOUD_ET_INDUSTRY_OPENAPI_ET_INDUSTRY_OPENAPICLIENT_H_ + +#include +#include +#include +#include +#include "Et_industry_openapiExport.h" +#include "model/UploadDeviceDataRequest.h" +#include "model/UploadDeviceDataResult.h" + + +namespace AlibabaCloud +{ + namespace Et_industry_openapi + { + class ALIBABACLOUD_ET_INDUSTRY_OPENAPI_EXPORT Et_industry_openapiClient : public RoaServiceClient + { + public: + typedef Outcome UploadDeviceDataOutcome; + typedef std::future UploadDeviceDataOutcomeCallable; + typedef std::function&)> UploadDeviceDataAsyncHandler; + + Et_industry_openapiClient(const Credentials &credentials, const ClientConfiguration &configuration); + Et_industry_openapiClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + Et_industry_openapiClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~Et_industry_openapiClient(); + UploadDeviceDataOutcome uploadDeviceData(const Model::UploadDeviceDataRequest &request)const; + void uploadDeviceDataAsync(const Model::UploadDeviceDataRequest& request, const UploadDeviceDataAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UploadDeviceDataOutcomeCallable uploadDeviceDataCallable(const Model::UploadDeviceDataRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_ET_INDUSTRY_OPENAPI_ET_INDUSTRY_OPENAPICLIENT_H_ diff --git a/et-industry-openapi/include/alibabacloud/et-industry-openapi/Et_industry_openapiExport.h b/et-industry-openapi/include/alibabacloud/et-industry-openapi/Et_industry_openapiExport.h new file mode 100644 index 000000000..c2306311a --- /dev/null +++ b/et-industry-openapi/include/alibabacloud/et-industry-openapi/Et_industry_openapiExport.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_ET_INDUSTRY_OPENAPI_ET_INDUSTRY_OPENAPIEXPORT_H_ +#define ALIBABACLOUD_ET_INDUSTRY_OPENAPI_ET_INDUSTRY_OPENAPIEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_ET_INDUSTRY_OPENAPI_LIBRARY) +# define ALIBABACLOUD_ET_INDUSTRY_OPENAPI_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_ET_INDUSTRY_OPENAPI_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_ET_INDUSTRY_OPENAPI_EXPORT +#endif + +#endif // !ALIBABACLOUD_ET_INDUSTRY_OPENAPI_ET_INDUSTRY_OPENAPIEXPORT_H_ \ No newline at end of file diff --git a/et-industry-openapi/include/alibabacloud/et-industry-openapi/model/UploadDeviceDataRequest.h b/et-industry-openapi/include/alibabacloud/et-industry-openapi/model/UploadDeviceDataRequest.h new file mode 100644 index 000000000..cd11aa15e --- /dev/null +++ b/et-industry-openapi/include/alibabacloud/et-industry-openapi/model/UploadDeviceDataRequest.h @@ -0,0 +1,45 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ET_INDUSTRY_OPENAPI_MODEL_UPLOADDEVICEDATAREQUEST_H_ +#define ALIBABACLOUD_ET_INDUSTRY_OPENAPI_MODEL_UPLOADDEVICEDATAREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Et_industry_openapi + { + namespace Model + { + class ALIBABACLOUD_ET_INDUSTRY_OPENAPI_EXPORT UploadDeviceDataRequest : public RoaServiceRequest + { + + public: + UploadDeviceDataRequest(); + ~UploadDeviceDataRequest(); + + + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_ET_INDUSTRY_OPENAPI_MODEL_UPLOADDEVICEDATAREQUEST_H_ \ No newline at end of file diff --git a/et-industry-openapi/include/alibabacloud/et-industry-openapi/model/UploadDeviceDataResult.h b/et-industry-openapi/include/alibabacloud/et-industry-openapi/model/UploadDeviceDataResult.h new file mode 100644 index 000000000..b192bc691 --- /dev/null +++ b/et-industry-openapi/include/alibabacloud/et-industry-openapi/model/UploadDeviceDataResult.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_ET_INDUSTRY_OPENAPI_MODEL_UPLOADDEVICEDATARESULT_H_ +#define ALIBABACLOUD_ET_INDUSTRY_OPENAPI_MODEL_UPLOADDEVICEDATARESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Et_industry_openapi + { + namespace Model + { + class ALIBABACLOUD_ET_INDUSTRY_OPENAPI_EXPORT UploadDeviceDataResult : public ServiceResult + { + public: + + + UploadDeviceDataResult(); + explicit UploadDeviceDataResult(const std::string &payload); + ~UploadDeviceDataResult(); + std::string getMessage()const; + std::string getData()const; + std::string getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::string data_; + std::string code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ET_INDUSTRY_OPENAPI_MODEL_UPLOADDEVICEDATARESULT_H_ \ No newline at end of file diff --git a/et-industry-openapi/src/Et-industry-openapiClient.cc b/et-industry-openapi/src/Et-industry-openapiClient.cc new file mode 100644 index 000000000..54f846566 --- /dev/null +++ b/et-industry-openapi/src/Et-industry-openapiClient.cc @@ -0,0 +1,89 @@ +/* + * 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::Et_industry_openapi; +using namespace AlibabaCloud::Et_industry_openapi::Model; + +namespace +{ + const std::string SERVICE_NAME = "et-industry-openapi"; +} + +Et_industry_openapiClient::Et_industry_openapiClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RoaServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +Et_industry_openapiClient::Et_industry_openapiClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +Et_industry_openapiClient::Et_industry_openapiClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RoaServiceClient(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, ""); +} + +Et_industry_openapiClient::~Et_industry_openapiClient() +{} + +Et_industry_openapiClient::UploadDeviceDataOutcome Et_industry_openapiClient::uploadDeviceData(const UploadDeviceDataRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UploadDeviceDataOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UploadDeviceDataOutcome(UploadDeviceDataResult(outcome.result())); + else + return UploadDeviceDataOutcome(outcome.error()); +} + +void Et_industry_openapiClient::uploadDeviceDataAsync(const UploadDeviceDataRequest& request, const UploadDeviceDataAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, uploadDeviceData(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Et_industry_openapiClient::UploadDeviceDataOutcomeCallable Et_industry_openapiClient::uploadDeviceDataCallable(const UploadDeviceDataRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->uploadDeviceData(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/et-industry-openapi/src/model/UploadDeviceDataRequest.cc b/et-industry-openapi/src/model/UploadDeviceDataRequest.cc new file mode 100644 index 000000000..c1563aa6d --- /dev/null +++ b/et-industry-openapi/src/model/UploadDeviceDataRequest.cc @@ -0,0 +1,30 @@ +/* + * 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::Et_industry_openapi::Model::UploadDeviceDataRequest; + +UploadDeviceDataRequest::UploadDeviceDataRequest() : + RoaServiceRequest("et-industry-openapi", "2019-06-10") +{ + setResourcePath("/openapi/batch/data/up"); + setMethod(HttpRequest::Method::Post); +} + +UploadDeviceDataRequest::~UploadDeviceDataRequest() +{} + diff --git a/et-industry-openapi/src/model/UploadDeviceDataResult.cc b/et-industry-openapi/src/model/UploadDeviceDataResult.cc new file mode 100644 index 000000000..30e8b0ac2 --- /dev/null +++ b/et-industry-openapi/src/model/UploadDeviceDataResult.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::Et_industry_openapi; +using namespace AlibabaCloud::Et_industry_openapi::Model; + +UploadDeviceDataResult::UploadDeviceDataResult() : + ServiceResult() +{} + +UploadDeviceDataResult::UploadDeviceDataResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UploadDeviceDataResult::~UploadDeviceDataResult() +{} + +void UploadDeviceDataResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Data"].isNull()) + data_ = value["Data"].asString(); + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string UploadDeviceDataResult::getMessage()const +{ + return message_; +} + +std::string UploadDeviceDataResult::getData()const +{ + return data_; +} + +std::string UploadDeviceDataResult::getCode()const +{ + return code_; +} +