Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d27410f202 | ||
|
|
3b1093ffe3 |
@@ -1,3 +1,9 @@
|
||||
2018-03-27 Version: 1.3.4
|
||||
1, add interface FetchLibraries
|
||||
|
||||
2018-03-23 Version: 1.3.3
|
||||
1, interface DescribeInstanceTypes output InstancePpsRx InstancePpsTx
|
||||
|
||||
2018-03-23 Version: 1.3.2
|
||||
1, interface DescribeInstanceTypes output InstancePpsRx InstancePpsTx
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ set(cloudphoto_public_header_model
|
||||
include/alibabacloud/cloudphoto/model/MergeFacesResult.h
|
||||
include/alibabacloud/cloudphoto/model/GetPhotosByMd5sRequest.h
|
||||
include/alibabacloud/cloudphoto/model/GetPhotosByMd5sResult.h
|
||||
include/alibabacloud/cloudphoto/model/FetchLibrariesRequest.h
|
||||
include/alibabacloud/cloudphoto/model/FetchLibrariesResult.h
|
||||
include/alibabacloud/cloudphoto/model/FetchAlbumTagPhotosRequest.h
|
||||
include/alibabacloud/cloudphoto/model/FetchAlbumTagPhotosResult.h
|
||||
include/alibabacloud/cloudphoto/model/CreateTransactionRequest.h
|
||||
@@ -188,6 +190,8 @@ set(cloudphoto_src
|
||||
src/model/MergeFacesResult.cc
|
||||
src/model/GetPhotosByMd5sRequest.cc
|
||||
src/model/GetPhotosByMd5sResult.cc
|
||||
src/model/FetchLibrariesRequest.cc
|
||||
src/model/FetchLibrariesResult.cc
|
||||
src/model/FetchAlbumTagPhotosRequest.cc
|
||||
src/model/FetchAlbumTagPhotosResult.cc
|
||||
src/model/CreateTransactionRequest.cc
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
#include "model/MergeFacesResult.h"
|
||||
#include "model/GetPhotosByMd5sRequest.h"
|
||||
#include "model/GetPhotosByMd5sResult.h"
|
||||
#include "model/FetchLibrariesRequest.h"
|
||||
#include "model/FetchLibrariesResult.h"
|
||||
#include "model/FetchAlbumTagPhotosRequest.h"
|
||||
#include "model/FetchAlbumTagPhotosResult.h"
|
||||
#include "model/CreateTransactionRequest.h"
|
||||
@@ -210,6 +212,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::GetPhotosByMd5sResult> GetPhotosByMd5sOutcome;
|
||||
typedef std::future<GetPhotosByMd5sOutcome> GetPhotosByMd5sOutcomeCallable;
|
||||
typedef std::function<void(const CloudPhotoClient*, const Model::GetPhotosByMd5sRequest&, const GetPhotosByMd5sOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetPhotosByMd5sAsyncHandler;
|
||||
typedef Outcome<Error, Model::FetchLibrariesResult> FetchLibrariesOutcome;
|
||||
typedef std::future<FetchLibrariesOutcome> FetchLibrariesOutcomeCallable;
|
||||
typedef std::function<void(const CloudPhotoClient*, const Model::FetchLibrariesRequest&, const FetchLibrariesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> FetchLibrariesAsyncHandler;
|
||||
typedef Outcome<Error, Model::FetchAlbumTagPhotosResult> FetchAlbumTagPhotosOutcome;
|
||||
typedef std::future<FetchAlbumTagPhotosOutcome> FetchAlbumTagPhotosOutcomeCallable;
|
||||
typedef std::function<void(const CloudPhotoClient*, const Model::FetchAlbumTagPhotosRequest&, const FetchAlbumTagPhotosOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> FetchAlbumTagPhotosAsyncHandler;
|
||||
@@ -416,6 +421,9 @@ namespace AlibabaCloud
|
||||
GetPhotosByMd5sOutcome getPhotosByMd5s(const Model::GetPhotosByMd5sRequest &request)const;
|
||||
void getPhotosByMd5sAsync(const Model::GetPhotosByMd5sRequest& request, const GetPhotosByMd5sAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetPhotosByMd5sOutcomeCallable getPhotosByMd5sCallable(const Model::GetPhotosByMd5sRequest& request) const;
|
||||
FetchLibrariesOutcome fetchLibraries(const Model::FetchLibrariesRequest &request)const;
|
||||
void fetchLibrariesAsync(const Model::FetchLibrariesRequest& request, const FetchLibrariesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
FetchLibrariesOutcomeCallable fetchLibrariesCallable(const Model::FetchLibrariesRequest& request) const;
|
||||
FetchAlbumTagPhotosOutcome fetchAlbumTagPhotos(const Model::FetchAlbumTagPhotosRequest &request)const;
|
||||
void fetchAlbumTagPhotosAsync(const Model::FetchAlbumTagPhotosRequest& request, const FetchAlbumTagPhotosAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
FetchAlbumTagPhotosOutcomeCallable fetchAlbumTagPhotosCallable(const Model::FetchAlbumTagPhotosRequest& request) const;
|
||||
|
||||
@@ -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_CLOUDPHOTO_MODEL_FETCHLIBRARIESREQUEST_H_
|
||||
#define ALIBABACLOUD_CLOUDPHOTO_MODEL_FETCHLIBRARIESREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/cloudphoto/CloudPhotoExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace CloudPhoto
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUDPHOTO_EXPORT FetchLibrariesRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
FetchLibrariesRequest();
|
||||
~FetchLibrariesRequest();
|
||||
|
||||
int getSize()const;
|
||||
void setSize(int size);
|
||||
std::string getStoreName()const;
|
||||
void setStoreName(const std::string& storeName);
|
||||
int getPage()const;
|
||||
void setPage(int page);
|
||||
|
||||
private:
|
||||
int size_;
|
||||
std::string storeName_;
|
||||
int page_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUDPHOTO_MODEL_FETCHLIBRARIESREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUDPHOTO_MODEL_FETCHLIBRARIESRESULT_H_
|
||||
#define ALIBABACLOUD_CLOUDPHOTO_MODEL_FETCHLIBRARIESRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/cloudphoto/CloudPhotoExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace CloudPhoto
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUDPHOTO_EXPORT FetchLibrariesResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
FetchLibrariesResult();
|
||||
explicit FetchLibrariesResult(const std::string &payload);
|
||||
~FetchLibrariesResult();
|
||||
int getTotalCount()const;
|
||||
std::string getAction()const;
|
||||
std::string getMessage()const;
|
||||
std::vector<std::string> getLibrary()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
int totalCount_;
|
||||
std::string action_;
|
||||
std::string message_;
|
||||
std::vector<std::string> library_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUDPHOTO_MODEL_FETCHLIBRARIESRESULT_H_
|
||||
@@ -591,6 +591,42 @@ CloudPhotoClient::GetPhotosByMd5sOutcomeCallable CloudPhotoClient::getPhotosByMd
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
CloudPhotoClient::FetchLibrariesOutcome CloudPhotoClient::fetchLibraries(const FetchLibrariesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return FetchLibrariesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return FetchLibrariesOutcome(FetchLibrariesResult(outcome.result()));
|
||||
else
|
||||
return FetchLibrariesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void CloudPhotoClient::fetchLibrariesAsync(const FetchLibrariesRequest& request, const FetchLibrariesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, fetchLibraries(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
CloudPhotoClient::FetchLibrariesOutcomeCallable CloudPhotoClient::fetchLibrariesCallable(const FetchLibrariesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<FetchLibrariesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->fetchLibraries(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
CloudPhotoClient::FetchAlbumTagPhotosOutcome CloudPhotoClient::fetchAlbumTagPhotos(const FetchAlbumTagPhotosRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
60
cloudphoto/src/model/FetchLibrariesRequest.cc
Normal file
60
cloudphoto/src/model/FetchLibrariesRequest.cc
Normal file
@@ -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 <alibabacloud/cloudphoto/model/FetchLibrariesRequest.h>
|
||||
|
||||
using AlibabaCloud::CloudPhoto::Model::FetchLibrariesRequest;
|
||||
|
||||
FetchLibrariesRequest::FetchLibrariesRequest() :
|
||||
RpcServiceRequest("cloudphoto", "2017-07-11", "FetchLibraries")
|
||||
{}
|
||||
|
||||
FetchLibrariesRequest::~FetchLibrariesRequest()
|
||||
{}
|
||||
|
||||
int FetchLibrariesRequest::getSize()const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
|
||||
void FetchLibrariesRequest::setSize(int size)
|
||||
{
|
||||
size_ = size;
|
||||
setParameter("Size", std::to_string(size));
|
||||
}
|
||||
|
||||
std::string FetchLibrariesRequest::getStoreName()const
|
||||
{
|
||||
return storeName_;
|
||||
}
|
||||
|
||||
void FetchLibrariesRequest::setStoreName(const std::string& storeName)
|
||||
{
|
||||
storeName_ = storeName;
|
||||
setParameter("StoreName", storeName);
|
||||
}
|
||||
|
||||
int FetchLibrariesRequest::getPage()const
|
||||
{
|
||||
return page_;
|
||||
}
|
||||
|
||||
void FetchLibrariesRequest::setPage(int page)
|
||||
{
|
||||
page_ = page;
|
||||
setParameter("Page", std::to_string(page));
|
||||
}
|
||||
|
||||
81
cloudphoto/src/model/FetchLibrariesResult.cc
Normal file
81
cloudphoto/src/model/FetchLibrariesResult.cc
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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/cloudphoto/model/FetchLibrariesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::CloudPhoto;
|
||||
using namespace AlibabaCloud::CloudPhoto::Model;
|
||||
|
||||
FetchLibrariesResult::FetchLibrariesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
FetchLibrariesResult::FetchLibrariesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
FetchLibrariesResult::~FetchLibrariesResult()
|
||||
{}
|
||||
|
||||
void FetchLibrariesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allLibrary = value["Library"]["Library"];
|
||||
for (const auto &item : allLibrary)
|
||||
library_.push_back(item.asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["Action"].isNull())
|
||||
action_ = value["Action"].asString();
|
||||
|
||||
}
|
||||
|
||||
int FetchLibrariesResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
std::string FetchLibrariesResult::getAction()const
|
||||
{
|
||||
return action_;
|
||||
}
|
||||
|
||||
std::string FetchLibrariesResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<std::string> FetchLibrariesResult::getLibrary()const
|
||||
{
|
||||
return library_;
|
||||
}
|
||||
|
||||
std::string FetchLibrariesResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user