diff --git a/VERSION b/VERSION index b7f2d7c41..9a6f6925b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1988 \ No newline at end of file +1.36.1989 \ No newline at end of file diff --git a/osssddp/CMakeLists.txt b/osssddp/CMakeLists.txt new file mode 100644 index 000000000..6e6da1b8f --- /dev/null +++ b/osssddp/CMakeLists.txt @@ -0,0 +1,90 @@ +# +# 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(osssddp_public_header + include/alibabacloud/osssddp/OssSddpClient.h + include/alibabacloud/osssddp/OssSddpExport.h ) + +set(osssddp_public_header_model + include/alibabacloud/osssddp/model/GetSddpVersionRequest.h + include/alibabacloud/osssddp/model/GetSddpVersionResult.h + include/alibabacloud/osssddp/model/UpgradeSddpVersionRequest.h + include/alibabacloud/osssddp/model/UpgradeSddpVersionResult.h ) + +set(osssddp_src + src/OssSddpClient.cc + src/model/GetSddpVersionRequest.cc + src/model/GetSddpVersionResult.cc + src/model/UpgradeSddpVersionRequest.cc + src/model/UpgradeSddpVersionResult.cc ) + +add_library(osssddp ${LIB_TYPE} + ${osssddp_public_header} + ${osssddp_public_header_model} + ${osssddp_src}) + +set_target_properties(osssddp + 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}osssddp + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(osssddp + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_OSSSDDP_LIBRARY) +endif() + +target_include_directories(osssddp + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(osssddp + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(osssddp + jsoncpp) + target_include_directories(osssddp + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(osssddp + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(osssddp + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(osssddp + PRIVATE /usr/include/jsoncpp) + target_link_libraries(osssddp + jsoncpp) +endif() + +install(FILES ${osssddp_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/osssddp) +install(FILES ${osssddp_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/osssddp/model) +install(TARGETS osssddp + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/osssddp/include/alibabacloud/osssddp/OssSddpClient.h b/osssddp/include/alibabacloud/osssddp/OssSddpClient.h new file mode 100644 index 000000000..f1d5e1d36 --- /dev/null +++ b/osssddp/include/alibabacloud/osssddp/OssSddpClient.h @@ -0,0 +1,62 @@ +/* + * 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_OSSSDDP_OSSSDDPCLIENT_H_ +#define ALIBABACLOUD_OSSSDDP_OSSSDDPCLIENT_H_ + +#include +#include +#include +#include +#include "OssSddpExport.h" +#include "model/GetSddpVersionRequest.h" +#include "model/GetSddpVersionResult.h" +#include "model/UpgradeSddpVersionRequest.h" +#include "model/UpgradeSddpVersionResult.h" + + +namespace AlibabaCloud +{ + namespace OssSddp + { + class ALIBABACLOUD_OSSSDDP_EXPORT OssSddpClient : public RpcServiceClient + { + public: + typedef Outcome GetSddpVersionOutcome; + typedef std::future GetSddpVersionOutcomeCallable; + typedef std::function&)> GetSddpVersionAsyncHandler; + typedef Outcome UpgradeSddpVersionOutcome; + typedef std::future UpgradeSddpVersionOutcomeCallable; + typedef std::function&)> UpgradeSddpVersionAsyncHandler; + + OssSddpClient(const Credentials &credentials, const ClientConfiguration &configuration); + OssSddpClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + OssSddpClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~OssSddpClient(); + GetSddpVersionOutcome getSddpVersion(const Model::GetSddpVersionRequest &request)const; + void getSddpVersionAsync(const Model::GetSddpVersionRequest& request, const GetSddpVersionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetSddpVersionOutcomeCallable getSddpVersionCallable(const Model::GetSddpVersionRequest& request) const; + UpgradeSddpVersionOutcome upgradeSddpVersion(const Model::UpgradeSddpVersionRequest &request)const; + void upgradeSddpVersionAsync(const Model::UpgradeSddpVersionRequest& request, const UpgradeSddpVersionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpgradeSddpVersionOutcomeCallable upgradeSddpVersionCallable(const Model::UpgradeSddpVersionRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_OSSSDDP_OSSSDDPCLIENT_H_ diff --git a/osssddp/include/alibabacloud/osssddp/OssSddpExport.h b/osssddp/include/alibabacloud/osssddp/OssSddpExport.h new file mode 100644 index 000000000..cd53d4af7 --- /dev/null +++ b/osssddp/include/alibabacloud/osssddp/OssSddpExport.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_OSSSDDP_OSSSDDPEXPORT_H_ +#define ALIBABACLOUD_OSSSDDP_OSSSDDPEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_OSSSDDP_LIBRARY) +# define ALIBABACLOUD_OSSSDDP_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_OSSSDDP_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_OSSSDDP_EXPORT +#endif + +#endif // !ALIBABACLOUD_OSSSDDP_OSSSDDPEXPORT_H_ \ No newline at end of file diff --git a/osssddp/include/alibabacloud/osssddp/model/GetSddpVersionRequest.h b/osssddp/include/alibabacloud/osssddp/model/GetSddpVersionRequest.h new file mode 100644 index 000000000..1c33ed8b7 --- /dev/null +++ b/osssddp/include/alibabacloud/osssddp/model/GetSddpVersionRequest.h @@ -0,0 +1,42 @@ +/* + * 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_OSSSDDP_MODEL_GETSDDPVERSIONREQUEST_H_ +#define ALIBABACLOUD_OSSSDDP_MODEL_GETSDDPVERSIONREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace OssSddp { +namespace Model { +class ALIBABACLOUD_OSSSDDP_EXPORT GetSddpVersionRequest : public RpcServiceRequest { +public: + GetSddpVersionRequest(); + ~GetSddpVersionRequest(); + std::string getClientToken() const; + void setClientToken(const std::string &clientToken); + +private: + std::string clientToken_; +}; +} // namespace Model +} // namespace OssSddp +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_OSSSDDP_MODEL_GETSDDPVERSIONREQUEST_H_ diff --git a/osssddp/include/alibabacloud/osssddp/model/GetSddpVersionResult.h b/osssddp/include/alibabacloud/osssddp/model/GetSddpVersionResult.h new file mode 100644 index 000000000..1e955e45c --- /dev/null +++ b/osssddp/include/alibabacloud/osssddp/model/GetSddpVersionResult.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_OSSSDDP_MODEL_GETSDDPVERSIONRESULT_H_ +#define ALIBABACLOUD_OSSSDDP_MODEL_GETSDDPVERSIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OssSddp + { + namespace Model + { + class ALIBABACLOUD_OSSSDDP_EXPORT GetSddpVersionResult : public ServiceResult + { + public: + + + GetSddpVersionResult(); + explicit GetSddpVersionResult(const std::string &payload); + ~GetSddpVersionResult(); + int getContent()const; + + protected: + void parse(const std::string &payload); + private: + int content_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OSSSDDP_MODEL_GETSDDPVERSIONRESULT_H_ \ No newline at end of file diff --git a/osssddp/include/alibabacloud/osssddp/model/UpgradeSddpVersionRequest.h b/osssddp/include/alibabacloud/osssddp/model/UpgradeSddpVersionRequest.h new file mode 100644 index 000000000..6a7a920c3 --- /dev/null +++ b/osssddp/include/alibabacloud/osssddp/model/UpgradeSddpVersionRequest.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_OSSSDDP_MODEL_UPGRADESDDPVERSIONREQUEST_H_ +#define ALIBABACLOUD_OSSSDDP_MODEL_UPGRADESDDPVERSIONREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace OssSddp { +namespace Model { +class ALIBABACLOUD_OSSSDDP_EXPORT UpgradeSddpVersionRequest : public RpcServiceRequest { +public: + UpgradeSddpVersionRequest(); + ~UpgradeSddpVersionRequest(); + std::string getClientToken() const; + void setClientToken(const std::string &clientToken); + int getOssVersion() const; + void setOssVersion(int ossVersion); + +private: + std::string clientToken_; + int ossVersion_; +}; +} // namespace Model +} // namespace OssSddp +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_OSSSDDP_MODEL_UPGRADESDDPVERSIONREQUEST_H_ diff --git a/osssddp/include/alibabacloud/osssddp/model/UpgradeSddpVersionResult.h b/osssddp/include/alibabacloud/osssddp/model/UpgradeSddpVersionResult.h new file mode 100644 index 000000000..a6700423d --- /dev/null +++ b/osssddp/include/alibabacloud/osssddp/model/UpgradeSddpVersionResult.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_OSSSDDP_MODEL_UPGRADESDDPVERSIONRESULT_H_ +#define ALIBABACLOUD_OSSSDDP_MODEL_UPGRADESDDPVERSIONRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OssSddp + { + namespace Model + { + class ALIBABACLOUD_OSSSDDP_EXPORT UpgradeSddpVersionResult : public ServiceResult + { + public: + + + UpgradeSddpVersionResult(); + explicit UpgradeSddpVersionResult(const std::string &payload); + ~UpgradeSddpVersionResult(); + std::string getContent()const; + + protected: + void parse(const std::string &payload); + private: + std::string content_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OSSSDDP_MODEL_UPGRADESDDPVERSIONRESULT_H_ \ No newline at end of file diff --git a/osssddp/src/OssSddpClient.cc b/osssddp/src/OssSddpClient.cc new file mode 100644 index 000000000..0fac02269 --- /dev/null +++ b/osssddp/src/OssSddpClient.cc @@ -0,0 +1,125 @@ +/* + * 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::OssSddp; +using namespace AlibabaCloud::OssSddp::Model; + +namespace +{ + const std::string SERVICE_NAME = "OssSddp"; +} + +OssSddpClient::OssSddpClient(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, ""); +} + +OssSddpClient::OssSddpClient(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, ""); +} + +OssSddpClient::OssSddpClient(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, ""); +} + +OssSddpClient::~OssSddpClient() +{} + +OssSddpClient::GetSddpVersionOutcome OssSddpClient::getSddpVersion(const GetSddpVersionRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetSddpVersionOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetSddpVersionOutcome(GetSddpVersionResult(outcome.result())); + else + return GetSddpVersionOutcome(outcome.error()); +} + +void OssSddpClient::getSddpVersionAsync(const GetSddpVersionRequest& request, const GetSddpVersionAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getSddpVersion(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OssSddpClient::GetSddpVersionOutcomeCallable OssSddpClient::getSddpVersionCallable(const GetSddpVersionRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getSddpVersion(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +OssSddpClient::UpgradeSddpVersionOutcome OssSddpClient::upgradeSddpVersion(const UpgradeSddpVersionRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpgradeSddpVersionOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpgradeSddpVersionOutcome(UpgradeSddpVersionResult(outcome.result())); + else + return UpgradeSddpVersionOutcome(outcome.error()); +} + +void OssSddpClient::upgradeSddpVersionAsync(const UpgradeSddpVersionRequest& request, const UpgradeSddpVersionAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, upgradeSddpVersion(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OssSddpClient::UpgradeSddpVersionOutcomeCallable OssSddpClient::upgradeSddpVersionCallable(const UpgradeSddpVersionRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->upgradeSddpVersion(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/osssddp/src/model/GetSddpVersionRequest.cc b/osssddp/src/model/GetSddpVersionRequest.cc new file mode 100644 index 000000000..a06876780 --- /dev/null +++ b/osssddp/src/model/GetSddpVersionRequest.cc @@ -0,0 +1,36 @@ +/* + * 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::OssSddp::Model::GetSddpVersionRequest; + +GetSddpVersionRequest::GetSddpVersionRequest() + : RpcServiceRequest("osssddp", "2024-02-22", "GetSddpVersion") { + setMethod(HttpRequest::Method::Post); +} + +GetSddpVersionRequest::~GetSddpVersionRequest() {} + +std::string GetSddpVersionRequest::getClientToken() const { + return clientToken_; +} + +void GetSddpVersionRequest::setClientToken(const std::string &clientToken) { + clientToken_ = clientToken; + setParameter(std::string("ClientToken"), clientToken); +} + diff --git a/osssddp/src/model/GetSddpVersionResult.cc b/osssddp/src/model/GetSddpVersionResult.cc new file mode 100644 index 000000000..91af30943 --- /dev/null +++ b/osssddp/src/model/GetSddpVersionResult.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::OssSddp; +using namespace AlibabaCloud::OssSddp::Model; + +GetSddpVersionResult::GetSddpVersionResult() : + ServiceResult() +{} + +GetSddpVersionResult::GetSddpVersionResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetSddpVersionResult::~GetSddpVersionResult() +{} + +void GetSddpVersionResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Content"].isNull()) + content_ = std::stoi(value["Content"].asString()); + +} + +int GetSddpVersionResult::getContent()const +{ + return content_; +} + diff --git a/osssddp/src/model/UpgradeSddpVersionRequest.cc b/osssddp/src/model/UpgradeSddpVersionRequest.cc new file mode 100644 index 000000000..779ea0a9d --- /dev/null +++ b/osssddp/src/model/UpgradeSddpVersionRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::OssSddp::Model::UpgradeSddpVersionRequest; + +UpgradeSddpVersionRequest::UpgradeSddpVersionRequest() + : RpcServiceRequest("osssddp", "2024-02-22", "UpgradeSddpVersion") { + setMethod(HttpRequest::Method::Post); +} + +UpgradeSddpVersionRequest::~UpgradeSddpVersionRequest() {} + +std::string UpgradeSddpVersionRequest::getClientToken() const { + return clientToken_; +} + +void UpgradeSddpVersionRequest::setClientToken(const std::string &clientToken) { + clientToken_ = clientToken; + setParameter(std::string("ClientToken"), clientToken); +} + +int UpgradeSddpVersionRequest::getOssVersion() const { + return ossVersion_; +} + +void UpgradeSddpVersionRequest::setOssVersion(int ossVersion) { + ossVersion_ = ossVersion; + setParameter(std::string("OssVersion"), std::to_string(ossVersion)); +} + diff --git a/osssddp/src/model/UpgradeSddpVersionResult.cc b/osssddp/src/model/UpgradeSddpVersionResult.cc new file mode 100644 index 000000000..db8ccea04 --- /dev/null +++ b/osssddp/src/model/UpgradeSddpVersionResult.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::OssSddp; +using namespace AlibabaCloud::OssSddp::Model; + +UpgradeSddpVersionResult::UpgradeSddpVersionResult() : + ServiceResult() +{} + +UpgradeSddpVersionResult::UpgradeSddpVersionResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpgradeSddpVersionResult::~UpgradeSddpVersionResult() +{} + +void UpgradeSddpVersionResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Content"].isNull()) + content_ = value["Content"].asString(); + +} + +std::string UpgradeSddpVersionResult::getContent()const +{ + return content_; +} +