From e9912734b29b2b4ca491c35c0e1882ebd575cb55 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 26 Apr 2023 11:30:42 +0000 Subject: [PATCH] Api add media storage class. --- VERSION | 2 +- vod/CMakeLists.txt | 8 ++ vod/include/alibabacloud/vod/VodClient.h | 16 ++++ .../vod/model/RestoreMediaRequest.h | 51 +++++++++++++ .../vod/model/RestoreMediaResult.h | 60 +++++++++++++++ .../model/UpdateMediaStorageClassRequest.h | 51 +++++++++++++ .../vod/model/UpdateMediaStorageClassResult.h | 60 +++++++++++++++ vod/src/VodClient.cc | 72 ++++++++++++++++++ vod/src/model/RestoreMediaRequest.cc | 63 ++++++++++++++++ vod/src/model/RestoreMediaResult.cc | 74 +++++++++++++++++++ .../model/UpdateMediaStorageClassRequest.cc | 63 ++++++++++++++++ .../model/UpdateMediaStorageClassResult.cc | 74 +++++++++++++++++++ 12 files changed, 593 insertions(+), 1 deletion(-) create mode 100644 vod/include/alibabacloud/vod/model/RestoreMediaRequest.h create mode 100644 vod/include/alibabacloud/vod/model/RestoreMediaResult.h create mode 100644 vod/include/alibabacloud/vod/model/UpdateMediaStorageClassRequest.h create mode 100644 vod/include/alibabacloud/vod/model/UpdateMediaStorageClassResult.h create mode 100644 vod/src/model/RestoreMediaRequest.cc create mode 100644 vod/src/model/RestoreMediaResult.cc create mode 100644 vod/src/model/UpdateMediaStorageClassRequest.cc create mode 100644 vod/src/model/UpdateMediaStorageClassResult.cc diff --git a/VERSION b/VERSION index 0fec523f2..e6723f495 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1543 \ No newline at end of file +1.36.1544 \ No newline at end of file diff --git a/vod/CMakeLists.txt b/vod/CMakeLists.txt index f39f705aa..241b0d6fe 100644 --- a/vod/CMakeLists.txt +++ b/vod/CMakeLists.txt @@ -245,6 +245,8 @@ set(vod_public_header_model include/alibabacloud/vod/model/RefreshVodObjectCachesResult.h include/alibabacloud/vod/model/RegisterMediaRequest.h include/alibabacloud/vod/model/RegisterMediaResult.h + include/alibabacloud/vod/model/RestoreMediaRequest.h + include/alibabacloud/vod/model/RestoreMediaResult.h include/alibabacloud/vod/model/SearchEditingProjectRequest.h include/alibabacloud/vod/model/SearchEditingProjectResult.h include/alibabacloud/vod/model/SearchMediaRequest.h @@ -297,6 +299,8 @@ set(vod_public_header_model include/alibabacloud/vod/model/UpdateEditingProjectResult.h include/alibabacloud/vod/model/UpdateImageInfosRequest.h include/alibabacloud/vod/model/UpdateImageInfosResult.h + include/alibabacloud/vod/model/UpdateMediaStorageClassRequest.h + include/alibabacloud/vod/model/UpdateMediaStorageClassResult.h include/alibabacloud/vod/model/UpdateTranscodeTemplateGroupRequest.h include/alibabacloud/vod/model/UpdateTranscodeTemplateGroupResult.h include/alibabacloud/vod/model/UpdateVideoInfoRequest.h @@ -542,6 +546,8 @@ set(vod_src src/model/RefreshVodObjectCachesResult.cc src/model/RegisterMediaRequest.cc src/model/RegisterMediaResult.cc + src/model/RestoreMediaRequest.cc + src/model/RestoreMediaResult.cc src/model/SearchEditingProjectRequest.cc src/model/SearchEditingProjectResult.cc src/model/SearchMediaRequest.cc @@ -594,6 +600,8 @@ set(vod_src src/model/UpdateEditingProjectResult.cc src/model/UpdateImageInfosRequest.cc src/model/UpdateImageInfosResult.cc + src/model/UpdateMediaStorageClassRequest.cc + src/model/UpdateMediaStorageClassResult.cc src/model/UpdateTranscodeTemplateGroupRequest.cc src/model/UpdateTranscodeTemplateGroupResult.cc src/model/UpdateVideoInfoRequest.cc diff --git a/vod/include/alibabacloud/vod/VodClient.h b/vod/include/alibabacloud/vod/VodClient.h index a77e53ced..197cd4ca8 100644 --- a/vod/include/alibabacloud/vod/VodClient.h +++ b/vod/include/alibabacloud/vod/VodClient.h @@ -246,6 +246,8 @@ #include "model/RefreshVodObjectCachesResult.h" #include "model/RegisterMediaRequest.h" #include "model/RegisterMediaResult.h" +#include "model/RestoreMediaRequest.h" +#include "model/RestoreMediaResult.h" #include "model/SearchEditingProjectRequest.h" #include "model/SearchEditingProjectResult.h" #include "model/SearchMediaRequest.h" @@ -298,6 +300,8 @@ #include "model/UpdateEditingProjectResult.h" #include "model/UpdateImageInfosRequest.h" #include "model/UpdateImageInfosResult.h" +#include "model/UpdateMediaStorageClassRequest.h" +#include "model/UpdateMediaStorageClassResult.h" #include "model/UpdateTranscodeTemplateGroupRequest.h" #include "model/UpdateTranscodeTemplateGroupResult.h" #include "model/UpdateVideoInfoRequest.h" @@ -661,6 +665,9 @@ namespace AlibabaCloud typedef Outcome RegisterMediaOutcome; typedef std::future RegisterMediaOutcomeCallable; typedef std::function&)> RegisterMediaAsyncHandler; + typedef Outcome RestoreMediaOutcome; + typedef std::future RestoreMediaOutcomeCallable; + typedef std::function&)> RestoreMediaAsyncHandler; typedef Outcome SearchEditingProjectOutcome; typedef std::future SearchEditingProjectOutcomeCallable; typedef std::function&)> SearchEditingProjectAsyncHandler; @@ -739,6 +746,9 @@ namespace AlibabaCloud typedef Outcome UpdateImageInfosOutcome; typedef std::future UpdateImageInfosOutcomeCallable; typedef std::function&)> UpdateImageInfosAsyncHandler; + typedef Outcome UpdateMediaStorageClassOutcome; + typedef std::future UpdateMediaStorageClassOutcomeCallable; + typedef std::function&)> UpdateMediaStorageClassAsyncHandler; typedef Outcome UpdateTranscodeTemplateGroupOutcome; typedef std::future UpdateTranscodeTemplateGroupOutcomeCallable; typedef std::function&)> UpdateTranscodeTemplateGroupAsyncHandler; @@ -1107,6 +1117,9 @@ namespace AlibabaCloud RegisterMediaOutcome registerMedia(const Model::RegisterMediaRequest &request)const; void registerMediaAsync(const Model::RegisterMediaRequest& request, const RegisterMediaAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RegisterMediaOutcomeCallable registerMediaCallable(const Model::RegisterMediaRequest& request) const; + RestoreMediaOutcome restoreMedia(const Model::RestoreMediaRequest &request)const; + void restoreMediaAsync(const Model::RestoreMediaRequest& request, const RestoreMediaAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RestoreMediaOutcomeCallable restoreMediaCallable(const Model::RestoreMediaRequest& request) const; SearchEditingProjectOutcome searchEditingProject(const Model::SearchEditingProjectRequest &request)const; void searchEditingProjectAsync(const Model::SearchEditingProjectRequest& request, const SearchEditingProjectAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SearchEditingProjectOutcomeCallable searchEditingProjectCallable(const Model::SearchEditingProjectRequest& request) const; @@ -1185,6 +1198,9 @@ namespace AlibabaCloud UpdateImageInfosOutcome updateImageInfos(const Model::UpdateImageInfosRequest &request)const; void updateImageInfosAsync(const Model::UpdateImageInfosRequest& request, const UpdateImageInfosAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateImageInfosOutcomeCallable updateImageInfosCallable(const Model::UpdateImageInfosRequest& request) const; + UpdateMediaStorageClassOutcome updateMediaStorageClass(const Model::UpdateMediaStorageClassRequest &request)const; + void updateMediaStorageClassAsync(const Model::UpdateMediaStorageClassRequest& request, const UpdateMediaStorageClassAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateMediaStorageClassOutcomeCallable updateMediaStorageClassCallable(const Model::UpdateMediaStorageClassRequest& request) const; UpdateTranscodeTemplateGroupOutcome updateTranscodeTemplateGroup(const Model::UpdateTranscodeTemplateGroupRequest &request)const; void updateTranscodeTemplateGroupAsync(const Model::UpdateTranscodeTemplateGroupRequest& request, const UpdateTranscodeTemplateGroupAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateTranscodeTemplateGroupOutcomeCallable updateTranscodeTemplateGroupCallable(const Model::UpdateTranscodeTemplateGroupRequest& request) const; diff --git a/vod/include/alibabacloud/vod/model/RestoreMediaRequest.h b/vod/include/alibabacloud/vod/model/RestoreMediaRequest.h new file mode 100644 index 000000000..af05b37b3 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/RestoreMediaRequest.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_VOD_MODEL_RESTOREMEDIAREQUEST_H_ +#define ALIBABACLOUD_VOD_MODEL_RESTOREMEDIAREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Vod { +namespace Model { +class ALIBABACLOUD_VOD_EXPORT RestoreMediaRequest : public RpcServiceRequest { +public: + RestoreMediaRequest(); + ~RestoreMediaRequest(); + std::string getRestoreTier() const; + void setRestoreTier(const std::string &restoreTier); + std::string getRestoreDays() const; + void setRestoreDays(const std::string &restoreDays); + std::string getScope() const; + void setScope(const std::string &scope); + std::string getMediaIds() const; + void setMediaIds(const std::string &mediaIds); + +private: + std::string restoreTier_; + std::string restoreDays_; + std::string scope_; + std::string mediaIds_; +}; +} // namespace Model +} // namespace Vod +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_VOD_MODEL_RESTOREMEDIAREQUEST_H_ diff --git a/vod/include/alibabacloud/vod/model/RestoreMediaResult.h b/vod/include/alibabacloud/vod/model/RestoreMediaResult.h new file mode 100644 index 000000000..ffd2d3346 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/RestoreMediaResult.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_VOD_MODEL_RESTOREMEDIARESULT_H_ +#define ALIBABACLOUD_VOD_MODEL_RESTOREMEDIARESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vod + { + namespace Model + { + class ALIBABACLOUD_VOD_EXPORT RestoreMediaResult : public ServiceResult + { + public: + struct MediaForbiddenReasonDTO + { + std::string mediaId; + std::string reason; + }; + + + RestoreMediaResult(); + explicit RestoreMediaResult(const std::string &payload); + ~RestoreMediaResult(); + std::vector getIgnoredList()const; + std::vector getForbiddenList()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::vector ignoredList_; + std::vector forbiddenList_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VOD_MODEL_RESTOREMEDIARESULT_H_ \ No newline at end of file diff --git a/vod/include/alibabacloud/vod/model/UpdateMediaStorageClassRequest.h b/vod/include/alibabacloud/vod/model/UpdateMediaStorageClassRequest.h new file mode 100644 index 000000000..c6170c2b5 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/UpdateMediaStorageClassRequest.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_VOD_MODEL_UPDATEMEDIASTORAGECLASSREQUEST_H_ +#define ALIBABACLOUD_VOD_MODEL_UPDATEMEDIASTORAGECLASSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Vod { +namespace Model { +class ALIBABACLOUD_VOD_EXPORT UpdateMediaStorageClassRequest : public RpcServiceRequest { +public: + UpdateMediaStorageClassRequest(); + ~UpdateMediaStorageClassRequest(); + std::string getRestoreTier() const; + void setRestoreTier(const std::string &restoreTier); + std::string getScope() const; + void setScope(const std::string &scope); + std::string getMediaIds() const; + void setMediaIds(const std::string &mediaIds); + std::string getStorageClass() const; + void setStorageClass(const std::string &storageClass); + +private: + std::string restoreTier_; + std::string scope_; + std::string mediaIds_; + std::string storageClass_; +}; +} // namespace Model +} // namespace Vod +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_VOD_MODEL_UPDATEMEDIASTORAGECLASSREQUEST_H_ diff --git a/vod/include/alibabacloud/vod/model/UpdateMediaStorageClassResult.h b/vod/include/alibabacloud/vod/model/UpdateMediaStorageClassResult.h new file mode 100644 index 000000000..76f23add5 --- /dev/null +++ b/vod/include/alibabacloud/vod/model/UpdateMediaStorageClassResult.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_VOD_MODEL_UPDATEMEDIASTORAGECLASSRESULT_H_ +#define ALIBABACLOUD_VOD_MODEL_UPDATEMEDIASTORAGECLASSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Vod + { + namespace Model + { + class ALIBABACLOUD_VOD_EXPORT UpdateMediaStorageClassResult : public ServiceResult + { + public: + struct MediaForbiddenReasonDTO + { + std::string mediaId; + std::string reason; + }; + + + UpdateMediaStorageClassResult(); + explicit UpdateMediaStorageClassResult(const std::string &payload); + ~UpdateMediaStorageClassResult(); + std::string getStatus()const; + std::vector getIgnoredList()const; + std::vector getForbiddenList()const; + + protected: + void parse(const std::string &payload); + private: + std::string status_; + std::vector ignoredList_; + std::vector forbiddenList_; + + }; + } + } +} +#endif // !ALIBABACLOUD_VOD_MODEL_UPDATEMEDIASTORAGECLASSRESULT_H_ \ No newline at end of file diff --git a/vod/src/VodClient.cc b/vod/src/VodClient.cc index bde13b690..9558cb2a5 100644 --- a/vod/src/VodClient.cc +++ b/vod/src/VodClient.cc @@ -4083,6 +4083,42 @@ VodClient::RegisterMediaOutcomeCallable VodClient::registerMediaCallable(const R return task->get_future(); } +VodClient::RestoreMediaOutcome VodClient::restoreMedia(const RestoreMediaRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RestoreMediaOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RestoreMediaOutcome(RestoreMediaResult(outcome.result())); + else + return RestoreMediaOutcome(outcome.error()); +} + +void VodClient::restoreMediaAsync(const RestoreMediaRequest& request, const RestoreMediaAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, restoreMedia(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +VodClient::RestoreMediaOutcomeCallable VodClient::restoreMediaCallable(const RestoreMediaRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->restoreMedia(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + VodClient::SearchEditingProjectOutcome VodClient::searchEditingProject(const SearchEditingProjectRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -5019,6 +5055,42 @@ VodClient::UpdateImageInfosOutcomeCallable VodClient::updateImageInfosCallable(c return task->get_future(); } +VodClient::UpdateMediaStorageClassOutcome VodClient::updateMediaStorageClass(const UpdateMediaStorageClassRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateMediaStorageClassOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateMediaStorageClassOutcome(UpdateMediaStorageClassResult(outcome.result())); + else + return UpdateMediaStorageClassOutcome(outcome.error()); +} + +void VodClient::updateMediaStorageClassAsync(const UpdateMediaStorageClassRequest& request, const UpdateMediaStorageClassAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateMediaStorageClass(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +VodClient::UpdateMediaStorageClassOutcomeCallable VodClient::updateMediaStorageClassCallable(const UpdateMediaStorageClassRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateMediaStorageClass(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + VodClient::UpdateTranscodeTemplateGroupOutcome VodClient::updateTranscodeTemplateGroup(const UpdateTranscodeTemplateGroupRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/vod/src/model/RestoreMediaRequest.cc b/vod/src/model/RestoreMediaRequest.cc new file mode 100644 index 000000000..79a2b1e6b --- /dev/null +++ b/vod/src/model/RestoreMediaRequest.cc @@ -0,0 +1,63 @@ +/* + * 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::Vod::Model::RestoreMediaRequest; + +RestoreMediaRequest::RestoreMediaRequest() + : RpcServiceRequest("vod", "2017-03-21", "RestoreMedia") { + setMethod(HttpRequest::Method::Post); +} + +RestoreMediaRequest::~RestoreMediaRequest() {} + +std::string RestoreMediaRequest::getRestoreTier() const { + return restoreTier_; +} + +void RestoreMediaRequest::setRestoreTier(const std::string &restoreTier) { + restoreTier_ = restoreTier; + setParameter(std::string("RestoreTier"), restoreTier); +} + +std::string RestoreMediaRequest::getRestoreDays() const { + return restoreDays_; +} + +void RestoreMediaRequest::setRestoreDays(const std::string &restoreDays) { + restoreDays_ = restoreDays; + setParameter(std::string("RestoreDays"), restoreDays); +} + +std::string RestoreMediaRequest::getScope() const { + return scope_; +} + +void RestoreMediaRequest::setScope(const std::string &scope) { + scope_ = scope; + setParameter(std::string("Scope"), scope); +} + +std::string RestoreMediaRequest::getMediaIds() const { + return mediaIds_; +} + +void RestoreMediaRequest::setMediaIds(const std::string &mediaIds) { + mediaIds_ = mediaIds; + setParameter(std::string("MediaIds"), mediaIds); +} + diff --git a/vod/src/model/RestoreMediaResult.cc b/vod/src/model/RestoreMediaResult.cc new file mode 100644 index 000000000..eea95ba16 --- /dev/null +++ b/vod/src/model/RestoreMediaResult.cc @@ -0,0 +1,74 @@ +/* + * 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::Vod; +using namespace AlibabaCloud::Vod::Model; + +RestoreMediaResult::RestoreMediaResult() : + ServiceResult() +{} + +RestoreMediaResult::RestoreMediaResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RestoreMediaResult::~RestoreMediaResult() +{} + +void RestoreMediaResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allForbiddenListNode = value["ForbiddenList"]["MediaForbiddenReasonDTO"]; + for (auto valueForbiddenListMediaForbiddenReasonDTO : allForbiddenListNode) + { + MediaForbiddenReasonDTO forbiddenListObject; + if(!valueForbiddenListMediaForbiddenReasonDTO["MediaId"].isNull()) + forbiddenListObject.mediaId = valueForbiddenListMediaForbiddenReasonDTO["MediaId"].asString(); + if(!valueForbiddenListMediaForbiddenReasonDTO["Reason"].isNull()) + forbiddenListObject.reason = valueForbiddenListMediaForbiddenReasonDTO["Reason"].asString(); + forbiddenList_.push_back(forbiddenListObject); + } + auto allIgnoredList = value["IgnoredList"]["MediaId"]; + for (const auto &item : allIgnoredList) + ignoredList_.push_back(item.asString()); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + +} + +std::vector RestoreMediaResult::getIgnoredList()const +{ + return ignoredList_; +} + +std::vector RestoreMediaResult::getForbiddenList()const +{ + return forbiddenList_; +} + +bool RestoreMediaResult::getSuccess()const +{ + return success_; +} + diff --git a/vod/src/model/UpdateMediaStorageClassRequest.cc b/vod/src/model/UpdateMediaStorageClassRequest.cc new file mode 100644 index 000000000..5c81ef515 --- /dev/null +++ b/vod/src/model/UpdateMediaStorageClassRequest.cc @@ -0,0 +1,63 @@ +/* + * 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::Vod::Model::UpdateMediaStorageClassRequest; + +UpdateMediaStorageClassRequest::UpdateMediaStorageClassRequest() + : RpcServiceRequest("vod", "2017-03-21", "UpdateMediaStorageClass") { + setMethod(HttpRequest::Method::Post); +} + +UpdateMediaStorageClassRequest::~UpdateMediaStorageClassRequest() {} + +std::string UpdateMediaStorageClassRequest::getRestoreTier() const { + return restoreTier_; +} + +void UpdateMediaStorageClassRequest::setRestoreTier(const std::string &restoreTier) { + restoreTier_ = restoreTier; + setParameter(std::string("RestoreTier"), restoreTier); +} + +std::string UpdateMediaStorageClassRequest::getScope() const { + return scope_; +} + +void UpdateMediaStorageClassRequest::setScope(const std::string &scope) { + scope_ = scope; + setParameter(std::string("Scope"), scope); +} + +std::string UpdateMediaStorageClassRequest::getMediaIds() const { + return mediaIds_; +} + +void UpdateMediaStorageClassRequest::setMediaIds(const std::string &mediaIds) { + mediaIds_ = mediaIds; + setParameter(std::string("MediaIds"), mediaIds); +} + +std::string UpdateMediaStorageClassRequest::getStorageClass() const { + return storageClass_; +} + +void UpdateMediaStorageClassRequest::setStorageClass(const std::string &storageClass) { + storageClass_ = storageClass; + setParameter(std::string("StorageClass"), storageClass); +} + diff --git a/vod/src/model/UpdateMediaStorageClassResult.cc b/vod/src/model/UpdateMediaStorageClassResult.cc new file mode 100644 index 000000000..6a519b2b7 --- /dev/null +++ b/vod/src/model/UpdateMediaStorageClassResult.cc @@ -0,0 +1,74 @@ +/* + * 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::Vod; +using namespace AlibabaCloud::Vod::Model; + +UpdateMediaStorageClassResult::UpdateMediaStorageClassResult() : + ServiceResult() +{} + +UpdateMediaStorageClassResult::UpdateMediaStorageClassResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateMediaStorageClassResult::~UpdateMediaStorageClassResult() +{} + +void UpdateMediaStorageClassResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allForbiddenListNode = value["ForbiddenList"]["MediaForbiddenReasonDTO"]; + for (auto valueForbiddenListMediaForbiddenReasonDTO : allForbiddenListNode) + { + MediaForbiddenReasonDTO forbiddenListObject; + if(!valueForbiddenListMediaForbiddenReasonDTO["MediaId"].isNull()) + forbiddenListObject.mediaId = valueForbiddenListMediaForbiddenReasonDTO["MediaId"].asString(); + if(!valueForbiddenListMediaForbiddenReasonDTO["Reason"].isNull()) + forbiddenListObject.reason = valueForbiddenListMediaForbiddenReasonDTO["Reason"].asString(); + forbiddenList_.push_back(forbiddenListObject); + } + auto allIgnoredList = value["IgnoredList"]["MediaId"]; + for (const auto &item : allIgnoredList) + ignoredList_.push_back(item.asString()); + if(!value["Status"].isNull()) + status_ = value["Status"].asString(); + +} + +std::string UpdateMediaStorageClassResult::getStatus()const +{ + return status_; +} + +std::vector UpdateMediaStorageClassResult::getIgnoredList()const +{ + return ignoredList_; +} + +std::vector UpdateMediaStorageClassResult::getForbiddenList()const +{ + return forbiddenList_; +} +