Api add media storage class.
This commit is contained in:
@@ -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<const AsyncCallerContext>& 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<std::packaged_task<RestoreMediaOutcome()>>(
|
||||
[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<const AsyncCallerContext>& 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<std::packaged_task<UpdateMediaStorageClassOutcome()>>(
|
||||
[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();
|
||||
|
||||
63
vod/src/model/RestoreMediaRequest.cc
Normal file
63
vod/src/model/RestoreMediaRequest.cc
Normal file
@@ -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 <alibabacloud/vod/model/RestoreMediaRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
74
vod/src/model/RestoreMediaResult.cc
Normal file
74
vod/src/model/RestoreMediaResult.cc
Normal file
@@ -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 <alibabacloud/vod/model/RestoreMediaResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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<std::string> RestoreMediaResult::getIgnoredList()const
|
||||
{
|
||||
return ignoredList_;
|
||||
}
|
||||
|
||||
std::vector<RestoreMediaResult::MediaForbiddenReasonDTO> RestoreMediaResult::getForbiddenList()const
|
||||
{
|
||||
return forbiddenList_;
|
||||
}
|
||||
|
||||
bool RestoreMediaResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
63
vod/src/model/UpdateMediaStorageClassRequest.cc
Normal file
63
vod/src/model/UpdateMediaStorageClassRequest.cc
Normal file
@@ -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 <alibabacloud/vod/model/UpdateMediaStorageClassRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
74
vod/src/model/UpdateMediaStorageClassResult.cc
Normal file
74
vod/src/model/UpdateMediaStorageClassResult.cc
Normal file
@@ -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 <alibabacloud/vod/model/UpdateMediaStorageClassResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
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<std::string> UpdateMediaStorageClassResult::getIgnoredList()const
|
||||
{
|
||||
return ignoredList_;
|
||||
}
|
||||
|
||||
std::vector<UpdateMediaStorageClassResult::MediaForbiddenReasonDTO> UpdateMediaStorageClassResult::getForbiddenList()const
|
||||
{
|
||||
return forbiddenList_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user