diff --git a/CHANGELOG b/CHANGELOG index c71b53dc0..caba8eb37 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2019-03-20 Version: 1.34.54 +1, Update the Dependency + 2019-03-20 Version: 1.34.53 1, cloudwf: update bool type parameter diff --git a/CMakeLists.txt b/CMakeLists.txt index dff2135dd..9d35d3786 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,4 +112,5 @@ add_subdirectory(imagesearch) add_subdirectory(cas) add_subdirectory(bssopenapi) add_subdirectory(cloudwf) -add_subdirectory(alidns) \ No newline at end of file +add_subdirectory(alidns) +add_subdirectory(httpdns) \ No newline at end of file diff --git a/VERSION b/VERSION index 50f038a2f..1ae74cf1f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.34.53 \ No newline at end of file +1.34.54 \ No newline at end of file diff --git a/httpdns/CMakeLists.txt b/httpdns/CMakeLists.txt new file mode 100644 index 000000000..1295f5e3c --- /dev/null +++ b/httpdns/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(httpdns_public_header + include/alibabacloud/httpdns/HttpdnsClient.h + include/alibabacloud/httpdns/HttpdnsExport.h ) + +set(httpdns_public_header_model + include/alibabacloud/httpdns/model/GetResolveStatisticsRequest.h + include/alibabacloud/httpdns/model/GetResolveStatisticsResult.h + include/alibabacloud/httpdns/model/DeleteDomainRequest.h + include/alibabacloud/httpdns/model/DeleteDomainResult.h + include/alibabacloud/httpdns/model/DescribeDomainsRequest.h + include/alibabacloud/httpdns/model/DescribeDomainsResult.h + include/alibabacloud/httpdns/model/GetResolveCountSummaryRequest.h + include/alibabacloud/httpdns/model/GetResolveCountSummaryResult.h + include/alibabacloud/httpdns/model/AddDomainRequest.h + include/alibabacloud/httpdns/model/AddDomainResult.h + include/alibabacloud/httpdns/model/ListDomainsRequest.h + include/alibabacloud/httpdns/model/ListDomainsResult.h + include/alibabacloud/httpdns/model/GetAccountInfoRequest.h + include/alibabacloud/httpdns/model/GetAccountInfoResult.h ) + +set(httpdns_src + src/HttpdnsClient.cc + src/model/GetResolveStatisticsRequest.cc + src/model/GetResolveStatisticsResult.cc + src/model/DeleteDomainRequest.cc + src/model/DeleteDomainResult.cc + src/model/DescribeDomainsRequest.cc + src/model/DescribeDomainsResult.cc + src/model/GetResolveCountSummaryRequest.cc + src/model/GetResolveCountSummaryResult.cc + src/model/AddDomainRequest.cc + src/model/AddDomainResult.cc + src/model/ListDomainsRequest.cc + src/model/ListDomainsResult.cc + src/model/GetAccountInfoRequest.cc + src/model/GetAccountInfoResult.cc ) + +add_library(httpdns ${LIB_TYPE} + ${httpdns_public_header} + ${httpdns_public_header_model} + ${httpdns_src}) + +set_target_properties(httpdns + 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}httpdns + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(httpdns + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_HTTPDNS_LIBRARY) +endif() + +target_include_directories(httpdns + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(httpdns + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(httpdns + jsoncpp) + target_include_directories(httpdns + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(httpdns + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(httpdns + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(httpdns + PRIVATE /usr/include/jsoncpp) + target_link_libraries(httpdns + jsoncpp) +endif() + +install(FILES ${httpdns_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/httpdns) +install(FILES ${httpdns_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/httpdns/model) +install(TARGETS httpdns + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/HttpdnsClient.h b/httpdns/include/alibabacloud/httpdns/HttpdnsClient.h new file mode 100644 index 000000000..9be1f64e4 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/HttpdnsClient.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_HTTPDNS_HTTPDNSCLIENT_H_ +#define ALIBABACLOUD_HTTPDNS_HTTPDNSCLIENT_H_ + +#include +#include +#include +#include +#include "HttpdnsExport.h" +#include "model/GetResolveStatisticsRequest.h" +#include "model/GetResolveStatisticsResult.h" +#include "model/DeleteDomainRequest.h" +#include "model/DeleteDomainResult.h" +#include "model/DescribeDomainsRequest.h" +#include "model/DescribeDomainsResult.h" +#include "model/GetResolveCountSummaryRequest.h" +#include "model/GetResolveCountSummaryResult.h" +#include "model/AddDomainRequest.h" +#include "model/AddDomainResult.h" +#include "model/ListDomainsRequest.h" +#include "model/ListDomainsResult.h" +#include "model/GetAccountInfoRequest.h" +#include "model/GetAccountInfoResult.h" + + +namespace AlibabaCloud +{ + namespace Httpdns + { + class ALIBABACLOUD_HTTPDNS_EXPORT HttpdnsClient : public RpcServiceClient + { + public: + typedef Outcome GetResolveStatisticsOutcome; + typedef std::future GetResolveStatisticsOutcomeCallable; + typedef std::function&)> GetResolveStatisticsAsyncHandler; + typedef Outcome DeleteDomainOutcome; + typedef std::future DeleteDomainOutcomeCallable; + typedef std::function&)> DeleteDomainAsyncHandler; + typedef Outcome DescribeDomainsOutcome; + typedef std::future DescribeDomainsOutcomeCallable; + typedef std::function&)> DescribeDomainsAsyncHandler; + typedef Outcome GetResolveCountSummaryOutcome; + typedef std::future GetResolveCountSummaryOutcomeCallable; + typedef std::function&)> GetResolveCountSummaryAsyncHandler; + typedef Outcome AddDomainOutcome; + typedef std::future AddDomainOutcomeCallable; + typedef std::function&)> AddDomainAsyncHandler; + typedef Outcome ListDomainsOutcome; + typedef std::future ListDomainsOutcomeCallable; + typedef std::function&)> ListDomainsAsyncHandler; + typedef Outcome GetAccountInfoOutcome; + typedef std::future GetAccountInfoOutcomeCallable; + typedef std::function&)> GetAccountInfoAsyncHandler; + + HttpdnsClient(const Credentials &credentials, const ClientConfiguration &configuration); + HttpdnsClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + HttpdnsClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~HttpdnsClient(); + GetResolveStatisticsOutcome getResolveStatistics(const Model::GetResolveStatisticsRequest &request)const; + void getResolveStatisticsAsync(const Model::GetResolveStatisticsRequest& request, const GetResolveStatisticsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetResolveStatisticsOutcomeCallable getResolveStatisticsCallable(const Model::GetResolveStatisticsRequest& request) const; + DeleteDomainOutcome deleteDomain(const Model::DeleteDomainRequest &request)const; + void deleteDomainAsync(const Model::DeleteDomainRequest& request, const DeleteDomainAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteDomainOutcomeCallable deleteDomainCallable(const Model::DeleteDomainRequest& request) const; + DescribeDomainsOutcome describeDomains(const Model::DescribeDomainsRequest &request)const; + void describeDomainsAsync(const Model::DescribeDomainsRequest& request, const DescribeDomainsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeDomainsOutcomeCallable describeDomainsCallable(const Model::DescribeDomainsRequest& request) const; + GetResolveCountSummaryOutcome getResolveCountSummary(const Model::GetResolveCountSummaryRequest &request)const; + void getResolveCountSummaryAsync(const Model::GetResolveCountSummaryRequest& request, const GetResolveCountSummaryAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetResolveCountSummaryOutcomeCallable getResolveCountSummaryCallable(const Model::GetResolveCountSummaryRequest& request) const; + AddDomainOutcome addDomain(const Model::AddDomainRequest &request)const; + void addDomainAsync(const Model::AddDomainRequest& request, const AddDomainAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AddDomainOutcomeCallable addDomainCallable(const Model::AddDomainRequest& request) const; + ListDomainsOutcome listDomains(const Model::ListDomainsRequest &request)const; + void listDomainsAsync(const Model::ListDomainsRequest& request, const ListDomainsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListDomainsOutcomeCallable listDomainsCallable(const Model::ListDomainsRequest& request) const; + GetAccountInfoOutcome getAccountInfo(const Model::GetAccountInfoRequest &request)const; + void getAccountInfoAsync(const Model::GetAccountInfoRequest& request, const GetAccountInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetAccountInfoOutcomeCallable getAccountInfoCallable(const Model::GetAccountInfoRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_HTTPDNS_HTTPDNSCLIENT_H_ diff --git a/httpdns/include/alibabacloud/httpdns/HttpdnsExport.h b/httpdns/include/alibabacloud/httpdns/HttpdnsExport.h new file mode 100644 index 000000000..ddb627b00 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/HttpdnsExport.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_HTTPDNS_HTTPDNSEXPORT_H_ +#define ALIBABACLOUD_HTTPDNS_HTTPDNSEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_HTTPDNS_LIBRARY) +# define ALIBABACLOUD_HTTPDNS_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_HTTPDNS_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_HTTPDNS_EXPORT +#endif + +#endif // !ALIBABACLOUD_HTTPDNS_HTTPDNSEXPORT_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/AddDomainRequest.h b/httpdns/include/alibabacloud/httpdns/model/AddDomainRequest.h new file mode 100644 index 000000000..da40994ea --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/AddDomainRequest.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_HTTPDNS_MODEL_ADDDOMAINREQUEST_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_ADDDOMAINREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT AddDomainRequest : public RpcServiceRequest + { + + public: + AddDomainRequest(); + ~AddDomainRequest(); + + std::string getAccountId()const; + void setAccountId(const std::string& accountId); + std::string getDomainName()const; + void setDomainName(const std::string& domainName); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::string accountId_; + std::string domainName_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_ADDDOMAINREQUEST_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/AddDomainResult.h b/httpdns/include/alibabacloud/httpdns/model/AddDomainResult.h new file mode 100644 index 000000000..16701bfb8 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/AddDomainResult.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_HTTPDNS_MODEL_ADDDOMAINRESULT_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_ADDDOMAINRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT AddDomainResult : public ServiceResult + { + public: + + + AddDomainResult(); + explicit AddDomainResult(const std::string &payload); + ~AddDomainResult(); + std::string getDomainName()const; + + protected: + void parse(const std::string &payload); + private: + std::string domainName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_ADDDOMAINRESULT_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/DeleteDomainRequest.h b/httpdns/include/alibabacloud/httpdns/model/DeleteDomainRequest.h new file mode 100644 index 000000000..126c42924 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/DeleteDomainRequest.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_HTTPDNS_MODEL_DELETEDOMAINREQUEST_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_DELETEDOMAINREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT DeleteDomainRequest : public RpcServiceRequest + { + + public: + DeleteDomainRequest(); + ~DeleteDomainRequest(); + + std::string getAccountId()const; + void setAccountId(const std::string& accountId); + std::string getDomainName()const; + void setDomainName(const std::string& domainName); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::string accountId_; + std::string domainName_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_DELETEDOMAINREQUEST_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/DeleteDomainResult.h b/httpdns/include/alibabacloud/httpdns/model/DeleteDomainResult.h new file mode 100644 index 000000000..838cfe6aa --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/DeleteDomainResult.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_HTTPDNS_MODEL_DELETEDOMAINRESULT_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_DELETEDOMAINRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT DeleteDomainResult : public ServiceResult + { + public: + + + DeleteDomainResult(); + explicit DeleteDomainResult(const std::string &payload); + ~DeleteDomainResult(); + std::string getDomainName()const; + + protected: + void parse(const std::string &payload); + private: + std::string domainName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_DELETEDOMAINRESULT_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/DescribeDomainsRequest.h b/httpdns/include/alibabacloud/httpdns/model/DescribeDomainsRequest.h new file mode 100644 index 000000000..5ac4274e4 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/DescribeDomainsRequest.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_HTTPDNS_MODEL_DESCRIBEDOMAINSREQUEST_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_DESCRIBEDOMAINSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT DescribeDomainsRequest : public RpcServiceRequest + { + + public: + DescribeDomainsRequest(); + ~DescribeDomainsRequest(); + + std::string getAccountId()const; + void setAccountId(const std::string& accountId); + long getPageSize()const; + void setPageSize(long pageSize); + long getPageNumber()const; + void setPageNumber(long pageNumber); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::string accountId_; + long pageSize_; + long pageNumber_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_DESCRIBEDOMAINSREQUEST_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/DescribeDomainsResult.h b/httpdns/include/alibabacloud/httpdns/model/DescribeDomainsResult.h new file mode 100644 index 000000000..3e0c45124 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/DescribeDomainsResult.h @@ -0,0 +1,61 @@ +/* + * 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_HTTPDNS_MODEL_DESCRIBEDOMAINSRESULT_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_DESCRIBEDOMAINSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT DescribeDomainsResult : public ServiceResult + { + public: + struct Domain + { + std::string domainName; + }; + + + DescribeDomainsResult(); + explicit DescribeDomainsResult(const std::string &payload); + ~DescribeDomainsResult(); + std::vector getDomains()const; + long getTotalCount()const; + long getPageSize()const; + long getPageNumber()const; + + protected: + void parse(const std::string &payload); + private: + std::vector domains_; + long totalCount_; + long pageSize_; + long pageNumber_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_DESCRIBEDOMAINSRESULT_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/GetAccountInfoRequest.h b/httpdns/include/alibabacloud/httpdns/model/GetAccountInfoRequest.h new file mode 100644 index 000000000..57fa6b45b --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/GetAccountInfoRequest.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_HTTPDNS_MODEL_GETACCOUNTINFOREQUEST_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_GETACCOUNTINFOREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT GetAccountInfoRequest : public RpcServiceRequest + { + + public: + GetAccountInfoRequest(); + ~GetAccountInfoRequest(); + + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_GETACCOUNTINFOREQUEST_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/GetAccountInfoResult.h b/httpdns/include/alibabacloud/httpdns/model/GetAccountInfoResult.h new file mode 100644 index 000000000..a3187cbd0 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/GetAccountInfoResult.h @@ -0,0 +1,64 @@ +/* + * 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_HTTPDNS_MODEL_GETACCOUNTINFORESULT_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_GETACCOUNTINFORESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT GetAccountInfoResult : public ServiceResult + { + public: + struct AccountInfo + { + long unsignedCount; + int monthFreeCount; + std::string accountId; + int monthResolveCount; + bool unsignedEnabled; + int packageCount; + int monthHttpsResolveCount; + std::string signSecret; + int userStatus; + long signedCount; + }; + + + GetAccountInfoResult(); + explicit GetAccountInfoResult(const std::string &payload); + ~GetAccountInfoResult(); + AccountInfo getAccountInfo()const; + + protected: + void parse(const std::string &payload); + private: + AccountInfo accountInfo_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_GETACCOUNTINFORESULT_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/GetResolveCountSummaryRequest.h b/httpdns/include/alibabacloud/httpdns/model/GetResolveCountSummaryRequest.h new file mode 100644 index 000000000..752aedeb6 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/GetResolveCountSummaryRequest.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_HTTPDNS_MODEL_GETRESOLVECOUNTSUMMARYREQUEST_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVECOUNTSUMMARYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT GetResolveCountSummaryRequest : public RpcServiceRequest + { + + public: + GetResolveCountSummaryRequest(); + ~GetResolveCountSummaryRequest(); + + std::string getGranularity()const; + void setGranularity(const std::string& granularity); + int getTimeSpan()const; + void setTimeSpan(int timeSpan); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::string granularity_; + int timeSpan_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVECOUNTSUMMARYREQUEST_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/GetResolveCountSummaryResult.h b/httpdns/include/alibabacloud/httpdns/model/GetResolveCountSummaryResult.h new file mode 100644 index 000000000..4e850d55b --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/GetResolveCountSummaryResult.h @@ -0,0 +1,58 @@ +/* + * 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_HTTPDNS_MODEL_GETRESOLVECOUNTSUMMARYRESULT_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVECOUNTSUMMARYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT GetResolveCountSummaryResult : public ServiceResult + { + public: + struct ResolveSummary + { + long http6; + long https; + long http; + long https6; + }; + + + GetResolveCountSummaryResult(); + explicit GetResolveCountSummaryResult(const std::string &payload); + ~GetResolveCountSummaryResult(); + ResolveSummary getResolveSummary()const; + + protected: + void parse(const std::string &payload); + private: + ResolveSummary resolveSummary_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVECOUNTSUMMARYRESULT_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/GetResolveStatisticsRequest.h b/httpdns/include/alibabacloud/httpdns/model/GetResolveStatisticsRequest.h new file mode 100644 index 000000000..903f95a40 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/GetResolveStatisticsRequest.h @@ -0,0 +1,60 @@ +/* + * 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_HTTPDNS_MODEL_GETRESOLVESTATISTICSREQUEST_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVESTATISTICSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT GetResolveStatisticsRequest : public RpcServiceRequest + { + + public: + GetResolveStatisticsRequest(); + ~GetResolveStatisticsRequest(); + + std::string getGranularity()const; + void setGranularity(const std::string& granularity); + std::string getProtocolName()const; + void setProtocolName(const std::string& protocolName); + std::string getDomainName()const; + void setDomainName(const std::string& domainName); + int getTimeSpan()const; + void setTimeSpan(int timeSpan); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + std::string granularity_; + std::string protocolName_; + std::string domainName_; + int timeSpan_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVESTATISTICSREQUEST_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/GetResolveStatisticsResult.h b/httpdns/include/alibabacloud/httpdns/model/GetResolveStatisticsResult.h new file mode 100644 index 000000000..d02b01020 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/GetResolveStatisticsResult.h @@ -0,0 +1,56 @@ +/* + * 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_HTTPDNS_MODEL_GETRESOLVESTATISTICSRESULT_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVESTATISTICSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT GetResolveStatisticsResult : public ServiceResult + { + public: + struct DataPoint + { + int time; + int count; + }; + + + GetResolveStatisticsResult(); + explicit GetResolveStatisticsResult(const std::string &payload); + ~GetResolveStatisticsResult(); + std::vector getDataPoints()const; + + protected: + void parse(const std::string &payload); + private: + std::vector dataPoints_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_GETRESOLVESTATISTICSRESULT_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/ListDomainsRequest.h b/httpdns/include/alibabacloud/httpdns/model/ListDomainsRequest.h new file mode 100644 index 000000000..f1d320488 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/ListDomainsRequest.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_HTTPDNS_MODEL_LISTDOMAINSREQUEST_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_LISTDOMAINSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT ListDomainsRequest : public RpcServiceRequest + { + + public: + ListDomainsRequest(); + ~ListDomainsRequest(); + + int getPageSize()const; + void setPageSize(int pageSize); + int getPageNumber()const; + void setPageNumber(int pageNumber); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + + private: + int pageSize_; + int pageNumber_; + std::string accessKeyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_LISTDOMAINSREQUEST_H_ \ No newline at end of file diff --git a/httpdns/include/alibabacloud/httpdns/model/ListDomainsResult.h b/httpdns/include/alibabacloud/httpdns/model/ListDomainsResult.h new file mode 100644 index 000000000..e5eeaea16 --- /dev/null +++ b/httpdns/include/alibabacloud/httpdns/model/ListDomainsResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_HTTPDNS_MODEL_LISTDOMAINSRESULT_H_ +#define ALIBABACLOUD_HTTPDNS_MODEL_LISTDOMAINSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Httpdns + { + namespace Model + { + class ALIBABACLOUD_HTTPDNS_EXPORT ListDomainsResult : public ServiceResult + { + public: + struct DomainInfo + { + long resolvedHttps; + std::string domainName; + long resolvedHttps6; + long resolved; + long resolved6; + }; + + + ListDomainsResult(); + explicit ListDomainsResult(const std::string &payload); + ~ListDomainsResult(); + long getTotalCount()const; + long getPageSize()const; + long getPageNumber()const; + std::vector getDomainInfos()const; + + protected: + void parse(const std::string &payload); + private: + long totalCount_; + long pageSize_; + long pageNumber_; + std::vector domainInfos_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HTTPDNS_MODEL_LISTDOMAINSRESULT_H_ \ No newline at end of file diff --git a/httpdns/src/HttpdnsClient.cc b/httpdns/src/HttpdnsClient.cc new file mode 100644 index 000000000..27fccb0f5 --- /dev/null +++ b/httpdns/src/HttpdnsClient.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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +namespace +{ + const std::string SERVICE_NAME = "Httpdns"; +} + +HttpdnsClient::HttpdnsClient(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, "httpdns"); +} + +HttpdnsClient::HttpdnsClient(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, "httpdns"); +} + +HttpdnsClient::HttpdnsClient(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, "httpdns"); +} + +HttpdnsClient::~HttpdnsClient() +{} + +HttpdnsClient::GetResolveStatisticsOutcome HttpdnsClient::getResolveStatistics(const GetResolveStatisticsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetResolveStatisticsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetResolveStatisticsOutcome(GetResolveStatisticsResult(outcome.result())); + else + return GetResolveStatisticsOutcome(outcome.error()); +} + +void HttpdnsClient::getResolveStatisticsAsync(const GetResolveStatisticsRequest& request, const GetResolveStatisticsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getResolveStatistics(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HttpdnsClient::GetResolveStatisticsOutcomeCallable HttpdnsClient::getResolveStatisticsCallable(const GetResolveStatisticsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getResolveStatistics(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +HttpdnsClient::DeleteDomainOutcome HttpdnsClient::deleteDomain(const DeleteDomainRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteDomainOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteDomainOutcome(DeleteDomainResult(outcome.result())); + else + return DeleteDomainOutcome(outcome.error()); +} + +void HttpdnsClient::deleteDomainAsync(const DeleteDomainRequest& request, const DeleteDomainAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteDomain(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HttpdnsClient::DeleteDomainOutcomeCallable HttpdnsClient::deleteDomainCallable(const DeleteDomainRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteDomain(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +HttpdnsClient::DescribeDomainsOutcome HttpdnsClient::describeDomains(const DescribeDomainsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeDomainsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeDomainsOutcome(DescribeDomainsResult(outcome.result())); + else + return DescribeDomainsOutcome(outcome.error()); +} + +void HttpdnsClient::describeDomainsAsync(const DescribeDomainsRequest& request, const DescribeDomainsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeDomains(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HttpdnsClient::DescribeDomainsOutcomeCallable HttpdnsClient::describeDomainsCallable(const DescribeDomainsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeDomains(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +HttpdnsClient::GetResolveCountSummaryOutcome HttpdnsClient::getResolveCountSummary(const GetResolveCountSummaryRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetResolveCountSummaryOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetResolveCountSummaryOutcome(GetResolveCountSummaryResult(outcome.result())); + else + return GetResolveCountSummaryOutcome(outcome.error()); +} + +void HttpdnsClient::getResolveCountSummaryAsync(const GetResolveCountSummaryRequest& request, const GetResolveCountSummaryAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getResolveCountSummary(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HttpdnsClient::GetResolveCountSummaryOutcomeCallable HttpdnsClient::getResolveCountSummaryCallable(const GetResolveCountSummaryRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getResolveCountSummary(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +HttpdnsClient::AddDomainOutcome HttpdnsClient::addDomain(const AddDomainRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AddDomainOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AddDomainOutcome(AddDomainResult(outcome.result())); + else + return AddDomainOutcome(outcome.error()); +} + +void HttpdnsClient::addDomainAsync(const AddDomainRequest& request, const AddDomainAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, addDomain(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HttpdnsClient::AddDomainOutcomeCallable HttpdnsClient::addDomainCallable(const AddDomainRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->addDomain(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +HttpdnsClient::ListDomainsOutcome HttpdnsClient::listDomains(const ListDomainsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListDomainsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListDomainsOutcome(ListDomainsResult(outcome.result())); + else + return ListDomainsOutcome(outcome.error()); +} + +void HttpdnsClient::listDomainsAsync(const ListDomainsRequest& request, const ListDomainsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listDomains(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HttpdnsClient::ListDomainsOutcomeCallable HttpdnsClient::listDomainsCallable(const ListDomainsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listDomains(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +HttpdnsClient::GetAccountInfoOutcome HttpdnsClient::getAccountInfo(const GetAccountInfoRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetAccountInfoOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetAccountInfoOutcome(GetAccountInfoResult(outcome.result())); + else + return GetAccountInfoOutcome(outcome.error()); +} + +void HttpdnsClient::getAccountInfoAsync(const GetAccountInfoRequest& request, const GetAccountInfoAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getAccountInfo(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HttpdnsClient::GetAccountInfoOutcomeCallable HttpdnsClient::getAccountInfoCallable(const GetAccountInfoRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getAccountInfo(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/httpdns/src/model/AddDomainRequest.cc b/httpdns/src/model/AddDomainRequest.cc new file mode 100644 index 000000000..c01c61c4c --- /dev/null +++ b/httpdns/src/model/AddDomainRequest.cc @@ -0,0 +1,60 @@ +/* + * 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::Httpdns::Model::AddDomainRequest; + +AddDomainRequest::AddDomainRequest() : + RpcServiceRequest("httpdns", "2016-02-01", "AddDomain") +{} + +AddDomainRequest::~AddDomainRequest() +{} + +std::string AddDomainRequest::getAccountId()const +{ + return accountId_; +} + +void AddDomainRequest::setAccountId(const std::string& accountId) +{ + accountId_ = accountId; + setParameter("AccountId", accountId); +} + +std::string AddDomainRequest::getDomainName()const +{ + return domainName_; +} + +void AddDomainRequest::setDomainName(const std::string& domainName) +{ + domainName_ = domainName; + setParameter("DomainName", domainName); +} + +std::string AddDomainRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void AddDomainRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/httpdns/src/model/AddDomainResult.cc b/httpdns/src/model/AddDomainResult.cc new file mode 100644 index 000000000..a78704c59 --- /dev/null +++ b/httpdns/src/model/AddDomainResult.cc @@ -0,0 +1,52 @@ +/* + * 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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +AddDomainResult::AddDomainResult() : + ServiceResult() +{} + +AddDomainResult::AddDomainResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AddDomainResult::~AddDomainResult() +{} + +void AddDomainResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + if(!value["DomainName"].isNull()) + domainName_ = value["DomainName"].asString(); + +} + +std::string AddDomainResult::getDomainName()const +{ + return domainName_; +} + diff --git a/httpdns/src/model/DeleteDomainRequest.cc b/httpdns/src/model/DeleteDomainRequest.cc new file mode 100644 index 000000000..2c248cf5e --- /dev/null +++ b/httpdns/src/model/DeleteDomainRequest.cc @@ -0,0 +1,60 @@ +/* + * 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::Httpdns::Model::DeleteDomainRequest; + +DeleteDomainRequest::DeleteDomainRequest() : + RpcServiceRequest("httpdns", "2016-02-01", "DeleteDomain") +{} + +DeleteDomainRequest::~DeleteDomainRequest() +{} + +std::string DeleteDomainRequest::getAccountId()const +{ + return accountId_; +} + +void DeleteDomainRequest::setAccountId(const std::string& accountId) +{ + accountId_ = accountId; + setParameter("AccountId", accountId); +} + +std::string DeleteDomainRequest::getDomainName()const +{ + return domainName_; +} + +void DeleteDomainRequest::setDomainName(const std::string& domainName) +{ + domainName_ = domainName; + setParameter("DomainName", domainName); +} + +std::string DeleteDomainRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void DeleteDomainRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/httpdns/src/model/DeleteDomainResult.cc b/httpdns/src/model/DeleteDomainResult.cc new file mode 100644 index 000000000..c3cd15b74 --- /dev/null +++ b/httpdns/src/model/DeleteDomainResult.cc @@ -0,0 +1,52 @@ +/* + * 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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +DeleteDomainResult::DeleteDomainResult() : + ServiceResult() +{} + +DeleteDomainResult::DeleteDomainResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteDomainResult::~DeleteDomainResult() +{} + +void DeleteDomainResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + if(!value["DomainName"].isNull()) + domainName_ = value["DomainName"].asString(); + +} + +std::string DeleteDomainResult::getDomainName()const +{ + return domainName_; +} + diff --git a/httpdns/src/model/DescribeDomainsRequest.cc b/httpdns/src/model/DescribeDomainsRequest.cc new file mode 100644 index 000000000..78d9e9eac --- /dev/null +++ b/httpdns/src/model/DescribeDomainsRequest.cc @@ -0,0 +1,71 @@ +/* + * 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::Httpdns::Model::DescribeDomainsRequest; + +DescribeDomainsRequest::DescribeDomainsRequest() : + RpcServiceRequest("httpdns", "2016-02-01", "DescribeDomains") +{} + +DescribeDomainsRequest::~DescribeDomainsRequest() +{} + +std::string DescribeDomainsRequest::getAccountId()const +{ + return accountId_; +} + +void DescribeDomainsRequest::setAccountId(const std::string& accountId) +{ + accountId_ = accountId; + setParameter("AccountId", accountId); +} + +long DescribeDomainsRequest::getPageSize()const +{ + return pageSize_; +} + +void DescribeDomainsRequest::setPageSize(long pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +long DescribeDomainsRequest::getPageNumber()const +{ + return pageNumber_; +} + +void DescribeDomainsRequest::setPageNumber(long pageNumber) +{ + pageNumber_ = pageNumber; + setParameter("PageNumber", std::to_string(pageNumber)); +} + +std::string DescribeDomainsRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void DescribeDomainsRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/httpdns/src/model/DescribeDomainsResult.cc b/httpdns/src/model/DescribeDomainsResult.cc new file mode 100644 index 000000000..c51847a6b --- /dev/null +++ b/httpdns/src/model/DescribeDomainsResult.cc @@ -0,0 +1,79 @@ +/* + * 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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +DescribeDomainsResult::DescribeDomainsResult() : + ServiceResult() +{} + +DescribeDomainsResult::DescribeDomainsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeDomainsResult::~DescribeDomainsResult() +{} + +void DescribeDomainsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allDomains = value["Domains"]["Domain"]; + for (auto value : allDomains) + { + Domain domainsObject; + if(!value["DomainName"].isNull()) + domainsObject.domainName = value["DomainName"].asString(); + domains_.push_back(domainsObject); + } + if(!value["TotalCount"].isNull()) + totalCount_ = std::stol(value["TotalCount"].asString()); + if(!value["PageNumber"].isNull()) + pageNumber_ = std::stol(value["PageNumber"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stol(value["PageSize"].asString()); + +} + +std::vector DescribeDomainsResult::getDomains()const +{ + return domains_; +} + +long DescribeDomainsResult::getTotalCount()const +{ + return totalCount_; +} + +long DescribeDomainsResult::getPageSize()const +{ + return pageSize_; +} + +long DescribeDomainsResult::getPageNumber()const +{ + return pageNumber_; +} + diff --git a/httpdns/src/model/GetAccountInfoRequest.cc b/httpdns/src/model/GetAccountInfoRequest.cc new file mode 100644 index 000000000..5ef46c71c --- /dev/null +++ b/httpdns/src/model/GetAccountInfoRequest.cc @@ -0,0 +1,38 @@ +/* + * 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::Httpdns::Model::GetAccountInfoRequest; + +GetAccountInfoRequest::GetAccountInfoRequest() : + RpcServiceRequest("httpdns", "2016-02-01", "GetAccountInfo") +{} + +GetAccountInfoRequest::~GetAccountInfoRequest() +{} + +std::string GetAccountInfoRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void GetAccountInfoRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/httpdns/src/model/GetAccountInfoResult.cc b/httpdns/src/model/GetAccountInfoResult.cc new file mode 100644 index 000000000..8916a0e6b --- /dev/null +++ b/httpdns/src/model/GetAccountInfoResult.cc @@ -0,0 +1,71 @@ +/* + * 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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +GetAccountInfoResult::GetAccountInfoResult() : + ServiceResult() +{} + +GetAccountInfoResult::GetAccountInfoResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetAccountInfoResult::~GetAccountInfoResult() +{} + +void GetAccountInfoResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto accountInfoNode = value["AccountInfo"]; + if(!accountInfoNode["AccountId"].isNull()) + accountInfo_.accountId = accountInfoNode["AccountId"].asString(); + if(!accountInfoNode["MonthFreeCount"].isNull()) + accountInfo_.monthFreeCount = std::stoi(accountInfoNode["MonthFreeCount"].asString()); + if(!accountInfoNode["MonthHttpsResolveCount"].isNull()) + accountInfo_.monthHttpsResolveCount = std::stoi(accountInfoNode["MonthHttpsResolveCount"].asString()); + if(!accountInfoNode["MonthResolveCount"].isNull()) + accountInfo_.monthResolveCount = std::stoi(accountInfoNode["MonthResolveCount"].asString()); + if(!accountInfoNode["PackageCount"].isNull()) + accountInfo_.packageCount = std::stoi(accountInfoNode["PackageCount"].asString()); + if(!accountInfoNode["UserStatus"].isNull()) + accountInfo_.userStatus = std::stoi(accountInfoNode["UserStatus"].asString()); + if(!accountInfoNode["SignSecret"].isNull()) + accountInfo_.signSecret = accountInfoNode["SignSecret"].asString(); + if(!accountInfoNode["UnsignedEnabled"].isNull()) + accountInfo_.unsignedEnabled = accountInfoNode["UnsignedEnabled"].asString() == "true"; + if(!accountInfoNode["SignedCount"].isNull()) + accountInfo_.signedCount = std::stol(accountInfoNode["SignedCount"].asString()); + if(!accountInfoNode["UnsignedCount"].isNull()) + accountInfo_.unsignedCount = std::stol(accountInfoNode["UnsignedCount"].asString()); + +} + +GetAccountInfoResult::AccountInfo GetAccountInfoResult::getAccountInfo()const +{ + return accountInfo_; +} + diff --git a/httpdns/src/model/GetResolveCountSummaryRequest.cc b/httpdns/src/model/GetResolveCountSummaryRequest.cc new file mode 100644 index 000000000..181831ed9 --- /dev/null +++ b/httpdns/src/model/GetResolveCountSummaryRequest.cc @@ -0,0 +1,60 @@ +/* + * 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::Httpdns::Model::GetResolveCountSummaryRequest; + +GetResolveCountSummaryRequest::GetResolveCountSummaryRequest() : + RpcServiceRequest("httpdns", "2016-02-01", "GetResolveCountSummary") +{} + +GetResolveCountSummaryRequest::~GetResolveCountSummaryRequest() +{} + +std::string GetResolveCountSummaryRequest::getGranularity()const +{ + return granularity_; +} + +void GetResolveCountSummaryRequest::setGranularity(const std::string& granularity) +{ + granularity_ = granularity; + setParameter("Granularity", granularity); +} + +int GetResolveCountSummaryRequest::getTimeSpan()const +{ + return timeSpan_; +} + +void GetResolveCountSummaryRequest::setTimeSpan(int timeSpan) +{ + timeSpan_ = timeSpan; + setParameter("TimeSpan", std::to_string(timeSpan)); +} + +std::string GetResolveCountSummaryRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void GetResolveCountSummaryRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/httpdns/src/model/GetResolveCountSummaryResult.cc b/httpdns/src/model/GetResolveCountSummaryResult.cc new file mode 100644 index 000000000..69f68b5c0 --- /dev/null +++ b/httpdns/src/model/GetResolveCountSummaryResult.cc @@ -0,0 +1,59 @@ +/* + * 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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +GetResolveCountSummaryResult::GetResolveCountSummaryResult() : + ServiceResult() +{} + +GetResolveCountSummaryResult::GetResolveCountSummaryResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetResolveCountSummaryResult::~GetResolveCountSummaryResult() +{} + +void GetResolveCountSummaryResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto resolveSummaryNode = value["ResolveSummary"]; + if(!resolveSummaryNode["Http"].isNull()) + resolveSummary_.http = std::stol(resolveSummaryNode["Http"].asString()); + if(!resolveSummaryNode["Https"].isNull()) + resolveSummary_.https = std::stol(resolveSummaryNode["Https"].asString()); + if(!resolveSummaryNode["Http6"].isNull()) + resolveSummary_.http6 = std::stol(resolveSummaryNode["Http6"].asString()); + if(!resolveSummaryNode["Https6"].isNull()) + resolveSummary_.https6 = std::stol(resolveSummaryNode["Https6"].asString()); + +} + +GetResolveCountSummaryResult::ResolveSummary GetResolveCountSummaryResult::getResolveSummary()const +{ + return resolveSummary_; +} + diff --git a/httpdns/src/model/GetResolveStatisticsRequest.cc b/httpdns/src/model/GetResolveStatisticsRequest.cc new file mode 100644 index 000000000..5b9ed35dd --- /dev/null +++ b/httpdns/src/model/GetResolveStatisticsRequest.cc @@ -0,0 +1,82 @@ +/* + * 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::Httpdns::Model::GetResolveStatisticsRequest; + +GetResolveStatisticsRequest::GetResolveStatisticsRequest() : + RpcServiceRequest("httpdns", "2016-02-01", "GetResolveStatistics") +{} + +GetResolveStatisticsRequest::~GetResolveStatisticsRequest() +{} + +std::string GetResolveStatisticsRequest::getGranularity()const +{ + return granularity_; +} + +void GetResolveStatisticsRequest::setGranularity(const std::string& granularity) +{ + granularity_ = granularity; + setParameter("Granularity", granularity); +} + +std::string GetResolveStatisticsRequest::getProtocolName()const +{ + return protocolName_; +} + +void GetResolveStatisticsRequest::setProtocolName(const std::string& protocolName) +{ + protocolName_ = protocolName; + setParameter("ProtocolName", protocolName); +} + +std::string GetResolveStatisticsRequest::getDomainName()const +{ + return domainName_; +} + +void GetResolveStatisticsRequest::setDomainName(const std::string& domainName) +{ + domainName_ = domainName; + setParameter("DomainName", domainName); +} + +int GetResolveStatisticsRequest::getTimeSpan()const +{ + return timeSpan_; +} + +void GetResolveStatisticsRequest::setTimeSpan(int timeSpan) +{ + timeSpan_ = timeSpan; + setParameter("TimeSpan", std::to_string(timeSpan)); +} + +std::string GetResolveStatisticsRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void GetResolveStatisticsRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/httpdns/src/model/GetResolveStatisticsResult.cc b/httpdns/src/model/GetResolveStatisticsResult.cc new file mode 100644 index 000000000..7757f1e9c --- /dev/null +++ b/httpdns/src/model/GetResolveStatisticsResult.cc @@ -0,0 +1,60 @@ +/* + * 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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +GetResolveStatisticsResult::GetResolveStatisticsResult() : + ServiceResult() +{} + +GetResolveStatisticsResult::GetResolveStatisticsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetResolveStatisticsResult::~GetResolveStatisticsResult() +{} + +void GetResolveStatisticsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allDataPoints = value["DataPoints"]["DataPoint"]; + for (auto value : allDataPoints) + { + DataPoint dataPointsObject; + if(!value["Time"].isNull()) + dataPointsObject.time = std::stoi(value["Time"].asString()); + if(!value["Count"].isNull()) + dataPointsObject.count = std::stoi(value["Count"].asString()); + dataPoints_.push_back(dataPointsObject); + } + +} + +std::vector GetResolveStatisticsResult::getDataPoints()const +{ + return dataPoints_; +} + diff --git a/httpdns/src/model/ListDomainsRequest.cc b/httpdns/src/model/ListDomainsRequest.cc new file mode 100644 index 000000000..2f9786b2f --- /dev/null +++ b/httpdns/src/model/ListDomainsRequest.cc @@ -0,0 +1,60 @@ +/* + * 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::Httpdns::Model::ListDomainsRequest; + +ListDomainsRequest::ListDomainsRequest() : + RpcServiceRequest("httpdns", "2016-02-01", "ListDomains") +{} + +ListDomainsRequest::~ListDomainsRequest() +{} + +int ListDomainsRequest::getPageSize()const +{ + return pageSize_; +} + +void ListDomainsRequest::setPageSize(int pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +int ListDomainsRequest::getPageNumber()const +{ + return pageNumber_; +} + +void ListDomainsRequest::setPageNumber(int pageNumber) +{ + pageNumber_ = pageNumber; + setParameter("PageNumber", std::to_string(pageNumber)); +} + +std::string ListDomainsRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void ListDomainsRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + diff --git a/httpdns/src/model/ListDomainsResult.cc b/httpdns/src/model/ListDomainsResult.cc new file mode 100644 index 000000000..02441efa3 --- /dev/null +++ b/httpdns/src/model/ListDomainsResult.cc @@ -0,0 +1,87 @@ +/* + * 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::Httpdns; +using namespace AlibabaCloud::Httpdns::Model; + +ListDomainsResult::ListDomainsResult() : + ServiceResult() +{} + +ListDomainsResult::ListDomainsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListDomainsResult::~ListDomainsResult() +{} + +void ListDomainsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allDomainInfos = value["DomainInfos"]["DomainInfo"]; + for (auto value : allDomainInfos) + { + DomainInfo domainInfosObject; + if(!value["DomainName"].isNull()) + domainInfosObject.domainName = value["DomainName"].asString(); + if(!value["Resolved"].isNull()) + domainInfosObject.resolved = std::stol(value["Resolved"].asString()); + if(!value["ResolvedHttps"].isNull()) + domainInfosObject.resolvedHttps = std::stol(value["ResolvedHttps"].asString()); + if(!value["Resolved6"].isNull()) + domainInfosObject.resolved6 = std::stol(value["Resolved6"].asString()); + if(!value["ResolvedHttps6"].isNull()) + domainInfosObject.resolvedHttps6 = std::stol(value["ResolvedHttps6"].asString()); + domainInfos_.push_back(domainInfosObject); + } + if(!value["TotalCount"].isNull()) + totalCount_ = std::stol(value["TotalCount"].asString()); + if(!value["PageNumber"].isNull()) + pageNumber_ = std::stol(value["PageNumber"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stol(value["PageSize"].asString()); + +} + +long ListDomainsResult::getTotalCount()const +{ + return totalCount_; +} + +long ListDomainsResult::getPageSize()const +{ + return pageSize_; +} + +long ListDomainsResult::getPageNumber()const +{ + return pageNumber_; +} + +std::vector ListDomainsResult::getDomainInfos()const +{ + return domainInfos_; +} +