Compare commits

..

5 Commits

Author SHA1 Message Date
sdk-team
6e4fea5ea2 Supported console. 2021-02-04 06:22:03 +00:00
sdk-team
1b54ddd725 Update TaggingImage. 2021-02-04 05:53:32 +00:00
sdk-team
6e5ba8761d After normalizing the API group name, regenerate the SDK. 2021-02-03 08:45:46 +00:00
sdk-team
e71ef9a243 Add ModifyAuditLogConfig API. 2021-02-03 08:24:56 +00:00
sdk-team
17af8569c4 Add. 2021-02-02 03:03:51 +00:00
38 changed files with 1712 additions and 2 deletions

View File

@@ -1,3 +1,18 @@
2021-02-04 Version: patch
- Supported console.
2021-02-04 Version: patch
- Update TaggingImage.
2021-02-03 Version: patch
- After normalizing the API group name, regenerate the SDK.
2021-02-03 Version: patch
- Add ModifyAuditLogConfig API.
2021-02-02 Version: patch
- Add.
2021-02-02 Version: patch
- CreateShardingDBInstance add ReadOnlyReplicas in ReplicaSet.

View File

@@ -36,7 +36,9 @@ set(eais_public_header_model
include/alibabacloud/eais/model/DescribeRegionsRequest.h
include/alibabacloud/eais/model/DescribeRegionsResult.h
include/alibabacloud/eais/model/DetachEaiRequest.h
include/alibabacloud/eais/model/DetachEaiResult.h )
include/alibabacloud/eais/model/DetachEaiResult.h
include/alibabacloud/eais/model/GetPrivateIpRequest.h
include/alibabacloud/eais/model/GetPrivateIpResult.h )
set(eais_src
src/EaisClient.cc
@@ -55,7 +57,9 @@ set(eais_src
src/model/DescribeRegionsRequest.cc
src/model/DescribeRegionsResult.cc
src/model/DetachEaiRequest.cc
src/model/DetachEaiResult.cc )
src/model/DetachEaiResult.cc
src/model/GetPrivateIpRequest.cc
src/model/GetPrivateIpResult.cc )
add_library(eais ${LIB_TYPE}
${eais_public_header}

View File

@@ -38,6 +38,8 @@
#include "model/DescribeRegionsResult.h"
#include "model/DetachEaiRequest.h"
#include "model/DetachEaiResult.h"
#include "model/GetPrivateIpRequest.h"
#include "model/GetPrivateIpResult.h"
namespace AlibabaCloud
@@ -71,6 +73,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::DetachEaiResult> DetachEaiOutcome;
typedef std::future<DetachEaiOutcome> DetachEaiOutcomeCallable;
typedef std::function<void(const EaisClient*, const Model::DetachEaiRequest&, const DetachEaiOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetachEaiAsyncHandler;
typedef Outcome<Error, Model::GetPrivateIpResult> GetPrivateIpOutcome;
typedef std::future<GetPrivateIpOutcome> GetPrivateIpOutcomeCallable;
typedef std::function<void(const EaisClient*, const Model::GetPrivateIpRequest&, const GetPrivateIpOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetPrivateIpAsyncHandler;
EaisClient(const Credentials &credentials, const ClientConfiguration &configuration);
EaisClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
@@ -100,6 +105,9 @@ namespace AlibabaCloud
DetachEaiOutcome detachEai(const Model::DetachEaiRequest &request)const;
void detachEaiAsync(const Model::DetachEaiRequest& request, const DetachEaiAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DetachEaiOutcomeCallable detachEaiCallable(const Model::DetachEaiRequest& request) const;
GetPrivateIpOutcome getPrivateIp(const Model::GetPrivateIpRequest &request)const;
void getPrivateIpAsync(const Model::GetPrivateIpRequest& request, const GetPrivateIpAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetPrivateIpOutcomeCallable getPrivateIpCallable(const Model::GetPrivateIpRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;

View File

@@ -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_EAIS_MODEL_GETPRIVATEIPREQUEST_H_
#define ALIBABACLOUD_EAIS_MODEL_GETPRIVATEIPREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/eais/EaisExport.h>
namespace AlibabaCloud
{
namespace Eais
{
namespace Model
{
class ALIBABACLOUD_EAIS_EXPORT GetPrivateIpRequest : public RpcServiceRequest
{
public:
GetPrivateIpRequest();
~GetPrivateIpRequest();
std::string getClientInstanceId()const;
void setClientInstanceId(const std::string& clientInstanceId);
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
private:
std::string clientInstanceId_;
std::string regionId_;
};
}
}
}
#endif // !ALIBABACLOUD_EAIS_MODEL_GETPRIVATEIPREQUEST_H_

View File

@@ -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_EAIS_MODEL_GETPRIVATEIPRESULT_H_
#define ALIBABACLOUD_EAIS_MODEL_GETPRIVATEIPRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/eais/EaisExport.h>
namespace AlibabaCloud
{
namespace Eais
{
namespace Model
{
class ALIBABACLOUD_EAIS_EXPORT GetPrivateIpResult : public ServiceResult
{
public:
GetPrivateIpResult();
explicit GetPrivateIpResult(const std::string &payload);
~GetPrivateIpResult();
std::string getPrivateIp()const;
protected:
void parse(const std::string &payload);
private:
std::string privateIp_;
};
}
}
}
#endif // !ALIBABACLOUD_EAIS_MODEL_GETPRIVATEIPRESULT_H_

View File

@@ -339,3 +339,39 @@ EaisClient::DetachEaiOutcomeCallable EaisClient::detachEaiCallable(const DetachE
return task->get_future();
}
EaisClient::GetPrivateIpOutcome EaisClient::getPrivateIp(const GetPrivateIpRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetPrivateIpOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetPrivateIpOutcome(GetPrivateIpResult(outcome.result()));
else
return GetPrivateIpOutcome(outcome.error());
}
void EaisClient::getPrivateIpAsync(const GetPrivateIpRequest& request, const GetPrivateIpAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getPrivateIp(request), context);
};
asyncExecute(new Runnable(fn));
}
EaisClient::GetPrivateIpOutcomeCallable EaisClient::getPrivateIpCallable(const GetPrivateIpRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetPrivateIpOutcome()>>(
[this, request]()
{
return this->getPrivateIp(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -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 <alibabacloud/eais/model/GetPrivateIpRequest.h>
using AlibabaCloud::Eais::Model::GetPrivateIpRequest;
GetPrivateIpRequest::GetPrivateIpRequest() :
RpcServiceRequest("eais", "2019-06-24", "GetPrivateIp")
{
setMethod(HttpRequest::Method::Post);
}
GetPrivateIpRequest::~GetPrivateIpRequest()
{}
std::string GetPrivateIpRequest::getClientInstanceId()const
{
return clientInstanceId_;
}
void GetPrivateIpRequest::setClientInstanceId(const std::string& clientInstanceId)
{
clientInstanceId_ = clientInstanceId;
setParameter("ClientInstanceId", clientInstanceId);
}
std::string GetPrivateIpRequest::getRegionId()const
{
return regionId_;
}
void GetPrivateIpRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}

View File

@@ -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 <alibabacloud/eais/model/GetPrivateIpResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Eais;
using namespace AlibabaCloud::Eais::Model;
GetPrivateIpResult::GetPrivateIpResult() :
ServiceResult()
{}
GetPrivateIpResult::GetPrivateIpResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetPrivateIpResult::~GetPrivateIpResult()
{}
void GetPrivateIpResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["PrivateIp"].isNull())
privateIp_ = value["PrivateIp"].asString();
}
std::string GetPrivateIpResult::getPrivateIp()const
{
return privateIp_;
}

View File

@@ -29,6 +29,8 @@ set(imagerecog_public_header_model
include/alibabacloud/imagerecog/model/DetectImageElementsResult.h
include/alibabacloud/imagerecog/model/EvaluateCertificateQualityRequest.h
include/alibabacloud/imagerecog/model/EvaluateCertificateQualityResult.h
include/alibabacloud/imagerecog/model/GetAsyncJobResultRequest.h
include/alibabacloud/imagerecog/model/GetAsyncJobResultResult.h
include/alibabacloud/imagerecog/model/RecognizeFoodRequest.h
include/alibabacloud/imagerecog/model/RecognizeFoodResult.h
include/alibabacloud/imagerecog/model/RecognizeImageColorRequest.h
@@ -54,6 +56,8 @@ set(imagerecog_src
src/model/DetectImageElementsResult.cc
src/model/EvaluateCertificateQualityRequest.cc
src/model/EvaluateCertificateQualityResult.cc
src/model/GetAsyncJobResultRequest.cc
src/model/GetAsyncJobResultResult.cc
src/model/RecognizeFoodRequest.cc
src/model/RecognizeFoodResult.cc
src/model/RecognizeImageColorRequest.cc

View File

@@ -30,6 +30,8 @@
#include "model/DetectImageElementsResult.h"
#include "model/EvaluateCertificateQualityRequest.h"
#include "model/EvaluateCertificateQualityResult.h"
#include "model/GetAsyncJobResultRequest.h"
#include "model/GetAsyncJobResultResult.h"
#include "model/RecognizeFoodRequest.h"
#include "model/RecognizeFoodResult.h"
#include "model/RecognizeImageColorRequest.h"
@@ -65,6 +67,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::EvaluateCertificateQualityResult> EvaluateCertificateQualityOutcome;
typedef std::future<EvaluateCertificateQualityOutcome> EvaluateCertificateQualityOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::EvaluateCertificateQualityRequest&, const EvaluateCertificateQualityOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> EvaluateCertificateQualityAsyncHandler;
typedef Outcome<Error, Model::GetAsyncJobResultResult> GetAsyncJobResultOutcome;
typedef std::future<GetAsyncJobResultOutcome> GetAsyncJobResultOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::GetAsyncJobResultRequest&, const GetAsyncJobResultOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetAsyncJobResultAsyncHandler;
typedef Outcome<Error, Model::RecognizeFoodResult> RecognizeFoodOutcome;
typedef std::future<RecognizeFoodOutcome> RecognizeFoodOutcomeCallable;
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeFoodRequest&, const RecognizeFoodOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeFoodAsyncHandler;
@@ -103,6 +108,9 @@ namespace AlibabaCloud
EvaluateCertificateQualityOutcome evaluateCertificateQuality(const Model::EvaluateCertificateQualityRequest &request)const;
void evaluateCertificateQualityAsync(const Model::EvaluateCertificateQualityRequest& request, const EvaluateCertificateQualityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
EvaluateCertificateQualityOutcomeCallable evaluateCertificateQualityCallable(const Model::EvaluateCertificateQualityRequest& request) const;
GetAsyncJobResultOutcome getAsyncJobResult(const Model::GetAsyncJobResultRequest &request)const;
void getAsyncJobResultAsync(const Model::GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetAsyncJobResultOutcomeCallable getAsyncJobResultCallable(const Model::GetAsyncJobResultRequest& request) const;
RecognizeFoodOutcome recognizeFood(const Model::RecognizeFoodRequest &request)const;
void recognizeFoodAsync(const Model::RecognizeFoodRequest& request, const RecognizeFoodAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RecognizeFoodOutcomeCallable recognizeFoodCallable(const Model::RecognizeFoodRequest& request) const;

View File

@@ -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_IMAGERECOG_MODEL_GETASYNCJOBRESULTREQUEST_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_GETASYNCJOBRESULTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT GetAsyncJobResultRequest : public RpcServiceRequest
{
public:
GetAsyncJobResultRequest();
~GetAsyncJobResultRequest();
std::string getJobId()const;
void setJobId(const std::string& jobId);
std::string getAsync()const;
void setAsync(const std::string& async);
private:
std::string jobId_;
std::string async_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_GETASYNCJOBRESULTREQUEST_H_

View File

@@ -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_IMAGERECOG_MODEL_GETASYNCJOBRESULTRESULT_H_
#define ALIBABACLOUD_IMAGERECOG_MODEL_GETASYNCJOBRESULTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/imagerecog/ImagerecogExport.h>
namespace AlibabaCloud
{
namespace Imagerecog
{
namespace Model
{
class ALIBABACLOUD_IMAGERECOG_EXPORT GetAsyncJobResultResult : public ServiceResult
{
public:
struct Data
{
std::string status;
std::string errorCode;
std::string errorMessage;
std::string jobId;
std::string result;
};
GetAsyncJobResultResult();
explicit GetAsyncJobResultResult(const std::string &payload);
~GetAsyncJobResultResult();
Data getData()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
};
}
}
}
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_GETASYNCJOBRESULTRESULT_H_

View File

@@ -37,11 +37,14 @@ namespace AlibabaCloud
int getImageType()const;
void setImageType(int imageType);
bool getAsync()const;
void setAsync(bool async);
std::string getImageURL()const;
void setImageURL(const std::string& imageURL);
private:
int imageType_;
bool async_;
std::string imageURL_;
};

View File

@@ -195,6 +195,42 @@ ImagerecogClient::EvaluateCertificateQualityOutcomeCallable ImagerecogClient::ev
return task->get_future();
}
ImagerecogClient::GetAsyncJobResultOutcome ImagerecogClient::getAsyncJobResult(const GetAsyncJobResultRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetAsyncJobResultOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetAsyncJobResultOutcome(GetAsyncJobResultResult(outcome.result()));
else
return GetAsyncJobResultOutcome(outcome.error());
}
void ImagerecogClient::getAsyncJobResultAsync(const GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getAsyncJobResult(request), context);
};
asyncExecute(new Runnable(fn));
}
ImagerecogClient::GetAsyncJobResultOutcomeCallable ImagerecogClient::getAsyncJobResultCallable(const GetAsyncJobResultRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetAsyncJobResultOutcome()>>(
[this, request]()
{
return this->getAsyncJobResult(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ImagerecogClient::RecognizeFoodOutcome ImagerecogClient::recognizeFood(const RecognizeFoodRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -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 <alibabacloud/imagerecog/model/GetAsyncJobResultRequest.h>
using AlibabaCloud::Imagerecog::Model::GetAsyncJobResultRequest;
GetAsyncJobResultRequest::GetAsyncJobResultRequest() :
RpcServiceRequest("imagerecog", "2019-09-30", "GetAsyncJobResult")
{
setMethod(HttpRequest::Method::Get);
}
GetAsyncJobResultRequest::~GetAsyncJobResultRequest()
{}
std::string GetAsyncJobResultRequest::getJobId()const
{
return jobId_;
}
void GetAsyncJobResultRequest::setJobId(const std::string& jobId)
{
jobId_ = jobId;
setParameter("JobId", jobId);
}
std::string GetAsyncJobResultRequest::getAsync()const
{
return async_;
}
void GetAsyncJobResultRequest::setAsync(const std::string& async)
{
async_ = async;
setParameter("Async", async);
}

View 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/imagerecog/model/GetAsyncJobResultResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Imagerecog;
using namespace AlibabaCloud::Imagerecog::Model;
GetAsyncJobResultResult::GetAsyncJobResultResult() :
ServiceResult()
{}
GetAsyncJobResultResult::GetAsyncJobResultResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetAsyncJobResultResult::~GetAsyncJobResultResult()
{}
void GetAsyncJobResultResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["Status"].isNull())
data_.status = dataNode["Status"].asString();
if(!dataNode["ErrorCode"].isNull())
data_.errorCode = dataNode["ErrorCode"].asString();
if(!dataNode["ErrorMessage"].isNull())
data_.errorMessage = dataNode["ErrorMessage"].asString();
if(!dataNode["JobId"].isNull())
data_.jobId = dataNode["JobId"].asString();
if(!dataNode["Result"].isNull())
data_.result = dataNode["Result"].asString();
}
GetAsyncJobResultResult::Data GetAsyncJobResultResult::getData()const
{
return data_;
}

View File

@@ -38,6 +38,17 @@ void TaggingImageRequest::setImageType(int imageType)
setBodyParameter("ImageType", std::to_string(imageType));
}
bool TaggingImageRequest::getAsync()const
{
return async_;
}
void TaggingImageRequest::setAsync(bool async)
{
async_ = async;
setBodyParameter("Async", async ? "true" : "false");
}
std::string TaggingImageRequest::getImageURL()const
{
return imageURL_;

View File

@@ -137,6 +137,8 @@ set(r-kvstore_public_header_model
include/alibabacloud/r-kvstore/model/ModifyAccountPasswordResult.h
include/alibabacloud/r-kvstore/model/ModifyActiveOperationTaskRequest.h
include/alibabacloud/r-kvstore/model/ModifyActiveOperationTaskResult.h
include/alibabacloud/r-kvstore/model/ModifyAuditLogConfigRequest.h
include/alibabacloud/r-kvstore/model/ModifyAuditLogConfigResult.h
include/alibabacloud/r-kvstore/model/ModifyBackupPolicyRequest.h
include/alibabacloud/r-kvstore/model/ModifyBackupPolicyResult.h
include/alibabacloud/r-kvstore/model/ModifyDBInstanceConnectionStringRequest.h
@@ -318,6 +320,8 @@ set(r-kvstore_src
src/model/ModifyAccountPasswordResult.cc
src/model/ModifyActiveOperationTaskRequest.cc
src/model/ModifyActiveOperationTaskResult.cc
src/model/ModifyAuditLogConfigRequest.cc
src/model/ModifyAuditLogConfigResult.cc
src/model/ModifyBackupPolicyRequest.cc
src/model/ModifyBackupPolicyResult.cc
src/model/ModifyDBInstanceConnectionStringRequest.cc

View File

@@ -138,6 +138,8 @@
#include "model/ModifyAccountPasswordResult.h"
#include "model/ModifyActiveOperationTaskRequest.h"
#include "model/ModifyActiveOperationTaskResult.h"
#include "model/ModifyAuditLogConfigRequest.h"
#include "model/ModifyAuditLogConfigResult.h"
#include "model/ModifyBackupPolicyRequest.h"
#include "model/ModifyBackupPolicyResult.h"
#include "model/ModifyDBInstanceConnectionStringRequest.h"
@@ -383,6 +385,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ModifyActiveOperationTaskResult> ModifyActiveOperationTaskOutcome;
typedef std::future<ModifyActiveOperationTaskOutcome> ModifyActiveOperationTaskOutcomeCallable;
typedef std::function<void(const R_kvstoreClient*, const Model::ModifyActiveOperationTaskRequest&, const ModifyActiveOperationTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyActiveOperationTaskAsyncHandler;
typedef Outcome<Error, Model::ModifyAuditLogConfigResult> ModifyAuditLogConfigOutcome;
typedef std::future<ModifyAuditLogConfigOutcome> ModifyAuditLogConfigOutcomeCallable;
typedef std::function<void(const R_kvstoreClient*, const Model::ModifyAuditLogConfigRequest&, const ModifyAuditLogConfigOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyAuditLogConfigAsyncHandler;
typedef Outcome<Error, Model::ModifyBackupPolicyResult> ModifyBackupPolicyOutcome;
typedef std::future<ModifyBackupPolicyOutcome> ModifyBackupPolicyOutcomeCallable;
typedef std::function<void(const R_kvstoreClient*, const Model::ModifyBackupPolicyRequest&, const ModifyBackupPolicyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyBackupPolicyAsyncHandler;
@@ -655,6 +660,9 @@ namespace AlibabaCloud
ModifyActiveOperationTaskOutcome modifyActiveOperationTask(const Model::ModifyActiveOperationTaskRequest &request)const;
void modifyActiveOperationTaskAsync(const Model::ModifyActiveOperationTaskRequest& request, const ModifyActiveOperationTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyActiveOperationTaskOutcomeCallable modifyActiveOperationTaskCallable(const Model::ModifyActiveOperationTaskRequest& request) const;
ModifyAuditLogConfigOutcome modifyAuditLogConfig(const Model::ModifyAuditLogConfigRequest &request)const;
void modifyAuditLogConfigAsync(const Model::ModifyAuditLogConfigRequest& request, const ModifyAuditLogConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyAuditLogConfigOutcomeCallable modifyAuditLogConfigCallable(const Model::ModifyAuditLogConfigRequest& request) const;
ModifyBackupPolicyOutcome modifyBackupPolicy(const Model::ModifyBackupPolicyRequest &request)const;
void modifyBackupPolicyAsync(const Model::ModifyBackupPolicyRequest& request, const ModifyBackupPolicyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyBackupPolicyOutcomeCallable modifyBackupPolicyCallable(const Model::ModifyBackupPolicyRequest& request) const;

View File

@@ -41,6 +41,8 @@ namespace AlibabaCloud
void setEngineVersion(const std::string& engineVersion);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getResourceGroupId()const;
void setResourceGroupId(const std::string& resourceGroupId);
std::string getSecurityToken()const;
void setSecurityToken(const std::string& securityToken);
std::string getEngine()const;
@@ -58,6 +60,7 @@ namespace AlibabaCloud
long resourceOwnerId_;
std::string engineVersion_;
std::string accessKeyId_;
std::string resourceGroupId_;
std::string securityToken_;
std::string engine_;
std::string resourceOwnerAccount_;

View File

@@ -0,0 +1,84 @@
/*
* 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_R_KVSTORE_MODEL_MODIFYAUDITLOGCONFIGREQUEST_H_
#define ALIBABACLOUD_R_KVSTORE_MODEL_MODIFYAUDITLOGCONFIGREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/r-kvstore/R_kvstoreExport.h>
namespace AlibabaCloud
{
namespace R_kvstore
{
namespace Model
{
class ALIBABACLOUD_R_KVSTORE_EXPORT ModifyAuditLogConfigRequest : public RpcServiceRequest
{
public:
ModifyAuditLogConfigRequest();
~ModifyAuditLogConfigRequest();
long getResourceOwnerId()const;
void setResourceOwnerId(long resourceOwnerId);
std::string getAccessKeyId()const;
void setAccessKeyId(const std::string& accessKeyId);
std::string getSecurityToken()const;
void setSecurityToken(const std::string& securityToken);
std::string getAuditCommand()const;
void setAuditCommand(const std::string& auditCommand);
std::string getAuditLogSwitchSource()const;
void setAuditLogSwitchSource(const std::string& auditLogSwitchSource);
std::string getProxyAudit()const;
void setProxyAudit(const std::string& proxyAudit);
int getRetention()const;
void setRetention(int retention);
std::string getResourceOwnerAccount()const;
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
std::string getOwnerAccount()const;
void setOwnerAccount(const std::string& ownerAccount);
bool getDbAudit()const;
void setDbAudit(bool dbAudit);
long getOwnerId()const;
void setOwnerId(long ownerId);
std::string getServiceType()const;
void setServiceType(const std::string& serviceType);
std::string getInstanceId()const;
void setInstanceId(const std::string& instanceId);
private:
long resourceOwnerId_;
std::string accessKeyId_;
std::string securityToken_;
std::string auditCommand_;
std::string auditLogSwitchSource_;
std::string proxyAudit_;
int retention_;
std::string resourceOwnerAccount_;
std::string ownerAccount_;
bool dbAudit_;
long ownerId_;
std::string serviceType_;
std::string instanceId_;
};
}
}
}
#endif // !ALIBABACLOUD_R_KVSTORE_MODEL_MODIFYAUDITLOGCONFIGREQUEST_H_

View File

@@ -0,0 +1,49 @@
/*
* 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_R_KVSTORE_MODEL_MODIFYAUDITLOGCONFIGRESULT_H_
#define ALIBABACLOUD_R_KVSTORE_MODEL_MODIFYAUDITLOGCONFIGRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/r-kvstore/R_kvstoreExport.h>
namespace AlibabaCloud
{
namespace R_kvstore
{
namespace Model
{
class ALIBABACLOUD_R_KVSTORE_EXPORT ModifyAuditLogConfigResult : public ServiceResult
{
public:
ModifyAuditLogConfigResult();
explicit ModifyAuditLogConfigResult(const std::string &payload);
~ModifyAuditLogConfigResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_R_KVSTORE_MODEL_MODIFYAUDITLOGCONFIGRESULT_H_

View File

@@ -2139,6 +2139,42 @@ R_kvstoreClient::ModifyActiveOperationTaskOutcomeCallable R_kvstoreClient::modif
return task->get_future();
}
R_kvstoreClient::ModifyAuditLogConfigOutcome R_kvstoreClient::modifyAuditLogConfig(const ModifyAuditLogConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ModifyAuditLogConfigOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ModifyAuditLogConfigOutcome(ModifyAuditLogConfigResult(outcome.result()));
else
return ModifyAuditLogConfigOutcome(outcome.error());
}
void R_kvstoreClient::modifyAuditLogConfigAsync(const ModifyAuditLogConfigRequest& request, const ModifyAuditLogConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, modifyAuditLogConfig(request), context);
};
asyncExecute(new Runnable(fn));
}
R_kvstoreClient::ModifyAuditLogConfigOutcomeCallable R_kvstoreClient::modifyAuditLogConfigCallable(const ModifyAuditLogConfigRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ModifyAuditLogConfigOutcome()>>(
[this, request]()
{
return this->modifyAuditLogConfig(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
R_kvstoreClient::ModifyBackupPolicyOutcome R_kvstoreClient::modifyBackupPolicy(const ModifyBackupPolicyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -60,6 +60,17 @@ void DescribeParameterTemplatesRequest::setAccessKeyId(const std::string& access
setParameter("AccessKeyId", accessKeyId);
}
std::string DescribeParameterTemplatesRequest::getResourceGroupId()const
{
return resourceGroupId_;
}
void DescribeParameterTemplatesRequest::setResourceGroupId(const std::string& resourceGroupId)
{
resourceGroupId_ = resourceGroupId;
setParameter("ResourceGroupId", resourceGroupId);
}
std::string DescribeParameterTemplatesRequest::getSecurityToken()const
{
return securityToken_;

View File

@@ -0,0 +1,172 @@
/*
* 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/r-kvstore/model/ModifyAuditLogConfigRequest.h>
using AlibabaCloud::R_kvstore::Model::ModifyAuditLogConfigRequest;
ModifyAuditLogConfigRequest::ModifyAuditLogConfigRequest() :
RpcServiceRequest("r-kvstore", "2015-01-01", "ModifyAuditLogConfig")
{
setMethod(HttpRequest::Method::Post);
}
ModifyAuditLogConfigRequest::~ModifyAuditLogConfigRequest()
{}
long ModifyAuditLogConfigRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void ModifyAuditLogConfigRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string ModifyAuditLogConfigRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void ModifyAuditLogConfigRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string ModifyAuditLogConfigRequest::getSecurityToken()const
{
return securityToken_;
}
void ModifyAuditLogConfigRequest::setSecurityToken(const std::string& securityToken)
{
securityToken_ = securityToken;
setParameter("SecurityToken", securityToken);
}
std::string ModifyAuditLogConfigRequest::getAuditCommand()const
{
return auditCommand_;
}
void ModifyAuditLogConfigRequest::setAuditCommand(const std::string& auditCommand)
{
auditCommand_ = auditCommand;
setParameter("AuditCommand", auditCommand);
}
std::string ModifyAuditLogConfigRequest::getAuditLogSwitchSource()const
{
return auditLogSwitchSource_;
}
void ModifyAuditLogConfigRequest::setAuditLogSwitchSource(const std::string& auditLogSwitchSource)
{
auditLogSwitchSource_ = auditLogSwitchSource;
setParameter("AuditLogSwitchSource", auditLogSwitchSource);
}
std::string ModifyAuditLogConfigRequest::getProxyAudit()const
{
return proxyAudit_;
}
void ModifyAuditLogConfigRequest::setProxyAudit(const std::string& proxyAudit)
{
proxyAudit_ = proxyAudit;
setParameter("ProxyAudit", proxyAudit);
}
int ModifyAuditLogConfigRequest::getRetention()const
{
return retention_;
}
void ModifyAuditLogConfigRequest::setRetention(int retention)
{
retention_ = retention;
setParameter("Retention", std::to_string(retention));
}
std::string ModifyAuditLogConfigRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void ModifyAuditLogConfigRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string ModifyAuditLogConfigRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void ModifyAuditLogConfigRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
bool ModifyAuditLogConfigRequest::getDbAudit()const
{
return dbAudit_;
}
void ModifyAuditLogConfigRequest::setDbAudit(bool dbAudit)
{
dbAudit_ = dbAudit;
setParameter("DbAudit", dbAudit ? "true" : "false");
}
long ModifyAuditLogConfigRequest::getOwnerId()const
{
return ownerId_;
}
void ModifyAuditLogConfigRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::string ModifyAuditLogConfigRequest::getServiceType()const
{
return serviceType_;
}
void ModifyAuditLogConfigRequest::setServiceType(const std::string& serviceType)
{
serviceType_ = serviceType;
setParameter("ServiceType", serviceType);
}
std::string ModifyAuditLogConfigRequest::getInstanceId()const
{
return instanceId_;
}
void ModifyAuditLogConfigRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/r-kvstore/model/ModifyAuditLogConfigResult.h>
#include <json/json.h>
using namespace AlibabaCloud::R_kvstore;
using namespace AlibabaCloud::R_kvstore::Model;
ModifyAuditLogConfigResult::ModifyAuditLogConfigResult() :
ServiceResult()
{}
ModifyAuditLogConfigResult::ModifyAuditLogConfigResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ModifyAuditLogConfigResult::~ModifyAuditLogConfigResult()
{}
void ModifyAuditLogConfigResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

90
safconsole/CMakeLists.txt Normal file
View File

@@ -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(safconsole_public_header
include/alibabacloud/safconsole/SafconsoleClient.h
include/alibabacloud/safconsole/SafconsoleExport.h )
set(safconsole_public_header_model
include/alibabacloud/safconsole/model/RevokeFeedbackRequest.h
include/alibabacloud/safconsole/model/RevokeFeedbackResult.h
include/alibabacloud/safconsole/model/SendFeedbackRequest.h
include/alibabacloud/safconsole/model/SendFeedbackResult.h )
set(safconsole_src
src/SafconsoleClient.cc
src/model/RevokeFeedbackRequest.cc
src/model/RevokeFeedbackResult.cc
src/model/SendFeedbackRequest.cc
src/model/SendFeedbackResult.cc )
add_library(safconsole ${LIB_TYPE}
${safconsole_public_header}
${safconsole_public_header_model}
${safconsole_src})
set_target_properties(safconsole
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}safconsole
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(safconsole
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_SAFCONSOLE_LIBRARY)
endif()
target_include_directories(safconsole
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(safconsole
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(safconsole
jsoncpp)
target_include_directories(safconsole
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(safconsole
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(safconsole
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(safconsole
PRIVATE /usr/include/jsoncpp)
target_link_libraries(safconsole
jsoncpp)
endif()
install(FILES ${safconsole_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/safconsole)
install(FILES ${safconsole_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/safconsole/model)
install(TARGETS safconsole
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -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_SAFCONSOLE_SAFCONSOLECLIENT_H_
#define ALIBABACLOUD_SAFCONSOLE_SAFCONSOLECLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "SafconsoleExport.h"
#include "model/RevokeFeedbackRequest.h"
#include "model/RevokeFeedbackResult.h"
#include "model/SendFeedbackRequest.h"
#include "model/SendFeedbackResult.h"
namespace AlibabaCloud
{
namespace Safconsole
{
class ALIBABACLOUD_SAFCONSOLE_EXPORT SafconsoleClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::RevokeFeedbackResult> RevokeFeedbackOutcome;
typedef std::future<RevokeFeedbackOutcome> RevokeFeedbackOutcomeCallable;
typedef std::function<void(const SafconsoleClient*, const Model::RevokeFeedbackRequest&, const RevokeFeedbackOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RevokeFeedbackAsyncHandler;
typedef Outcome<Error, Model::SendFeedbackResult> SendFeedbackOutcome;
typedef std::future<SendFeedbackOutcome> SendFeedbackOutcomeCallable;
typedef std::function<void(const SafconsoleClient*, const Model::SendFeedbackRequest&, const SendFeedbackOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SendFeedbackAsyncHandler;
SafconsoleClient(const Credentials &credentials, const ClientConfiguration &configuration);
SafconsoleClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
SafconsoleClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~SafconsoleClient();
RevokeFeedbackOutcome revokeFeedback(const Model::RevokeFeedbackRequest &request)const;
void revokeFeedbackAsync(const Model::RevokeFeedbackRequest& request, const RevokeFeedbackAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RevokeFeedbackOutcomeCallable revokeFeedbackCallable(const Model::RevokeFeedbackRequest& request) const;
SendFeedbackOutcome sendFeedback(const Model::SendFeedbackRequest &request)const;
void sendFeedbackAsync(const Model::SendFeedbackRequest& request, const SendFeedbackAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
SendFeedbackOutcomeCallable sendFeedbackCallable(const Model::SendFeedbackRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_SAFCONSOLE_SAFCONSOLECLIENT_H_

View File

@@ -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_SAFCONSOLE_SAFCONSOLEEXPORT_H_
#define ALIBABACLOUD_SAFCONSOLE_SAFCONSOLEEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_SAFCONSOLE_LIBRARY)
# define ALIBABACLOUD_SAFCONSOLE_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_SAFCONSOLE_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_SAFCONSOLE_EXPORT
#endif
#endif // !ALIBABACLOUD_SAFCONSOLE_SAFCONSOLEEXPORT_H_

View File

@@ -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_SAFCONSOLE_MODEL_REVOKEFEEDBACKREQUEST_H_
#define ALIBABACLOUD_SAFCONSOLE_MODEL_REVOKEFEEDBACKREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/safconsole/SafconsoleExport.h>
namespace AlibabaCloud
{
namespace Safconsole
{
namespace Model
{
class ALIBABACLOUD_SAFCONSOLE_EXPORT RevokeFeedbackRequest : public RpcServiceRequest
{
public:
RevokeFeedbackRequest();
~RevokeFeedbackRequest();
std::string getSampleType()const;
void setSampleType(const std::string& sampleType);
std::string getValue()const;
void setValue(const std::string& value);
private:
std::string sampleType_;
std::string value_;
};
}
}
}
#endif // !ALIBABACLOUD_SAFCONSOLE_MODEL_REVOKEFEEDBACKREQUEST_H_

View File

@@ -0,0 +1,53 @@
/*
* 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_SAFCONSOLE_MODEL_REVOKEFEEDBACKRESULT_H_
#define ALIBABACLOUD_SAFCONSOLE_MODEL_REVOKEFEEDBACKRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/safconsole/SafconsoleExport.h>
namespace AlibabaCloud
{
namespace Safconsole
{
namespace Model
{
class ALIBABACLOUD_SAFCONSOLE_EXPORT RevokeFeedbackResult : public ServiceResult
{
public:
RevokeFeedbackResult();
explicit RevokeFeedbackResult(const std::string &payload);
~RevokeFeedbackResult();
std::string getMessage()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_SAFCONSOLE_MODEL_REVOKEFEEDBACKRESULT_H_

View File

@@ -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_SAFCONSOLE_MODEL_SENDFEEDBACKREQUEST_H_
#define ALIBABACLOUD_SAFCONSOLE_MODEL_SENDFEEDBACKREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/safconsole/SafconsoleExport.h>
namespace AlibabaCloud
{
namespace Safconsole
{
namespace Model
{
class ALIBABACLOUD_SAFCONSOLE_EXPORT SendFeedbackRequest : public RpcServiceRequest
{
public:
SendFeedbackRequest();
~SendFeedbackRequest();
std::string getRiskLabel()const;
void setRiskLabel(const std::string& riskLabel);
std::string getSampleType()const;
void setSampleType(const std::string& sampleType);
std::string getValue()const;
void setValue(const std::string& value);
private:
std::string riskLabel_;
std::string sampleType_;
std::string value_;
};
}
}
}
#endif // !ALIBABACLOUD_SAFCONSOLE_MODEL_SENDFEEDBACKREQUEST_H_

View File

@@ -0,0 +1,53 @@
/*
* 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_SAFCONSOLE_MODEL_SENDFEEDBACKRESULT_H_
#define ALIBABACLOUD_SAFCONSOLE_MODEL_SENDFEEDBACKRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/safconsole/SafconsoleExport.h>
namespace AlibabaCloud
{
namespace Safconsole
{
namespace Model
{
class ALIBABACLOUD_SAFCONSOLE_EXPORT SendFeedbackResult : public ServiceResult
{
public:
SendFeedbackResult();
explicit SendFeedbackResult(const std::string &payload);
~SendFeedbackResult();
std::string getMessage()const;
int getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
int code_;
};
}
}
}
#endif // !ALIBABACLOUD_SAFCONSOLE_MODEL_SENDFEEDBACKRESULT_H_

View File

@@ -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 <alibabacloud/safconsole/SafconsoleClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Safconsole;
using namespace AlibabaCloud::Safconsole::Model;
namespace
{
const std::string SERVICE_NAME = "safconsole";
}
SafconsoleClient::SafconsoleClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "safconsole");
}
SafconsoleClient::SafconsoleClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "safconsole");
}
SafconsoleClient::SafconsoleClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "safconsole");
}
SafconsoleClient::~SafconsoleClient()
{}
SafconsoleClient::RevokeFeedbackOutcome SafconsoleClient::revokeFeedback(const RevokeFeedbackRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RevokeFeedbackOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RevokeFeedbackOutcome(RevokeFeedbackResult(outcome.result()));
else
return RevokeFeedbackOutcome(outcome.error());
}
void SafconsoleClient::revokeFeedbackAsync(const RevokeFeedbackRequest& request, const RevokeFeedbackAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, revokeFeedback(request), context);
};
asyncExecute(new Runnable(fn));
}
SafconsoleClient::RevokeFeedbackOutcomeCallable SafconsoleClient::revokeFeedbackCallable(const RevokeFeedbackRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RevokeFeedbackOutcome()>>(
[this, request]()
{
return this->revokeFeedback(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SafconsoleClient::SendFeedbackOutcome SafconsoleClient::sendFeedback(const SendFeedbackRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SendFeedbackOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SendFeedbackOutcome(SendFeedbackResult(outcome.result()));
else
return SendFeedbackOutcome(outcome.error());
}
void SafconsoleClient::sendFeedbackAsync(const SendFeedbackRequest& request, const SendFeedbackAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, sendFeedback(request), context);
};
asyncExecute(new Runnable(fn));
}
SafconsoleClient::SendFeedbackOutcomeCallable SafconsoleClient::sendFeedbackCallable(const SendFeedbackRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SendFeedbackOutcome()>>(
[this, request]()
{
return this->sendFeedback(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -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 <alibabacloud/safconsole/model/RevokeFeedbackRequest.h>
using AlibabaCloud::Safconsole::Model::RevokeFeedbackRequest;
RevokeFeedbackRequest::RevokeFeedbackRequest() :
RpcServiceRequest("safconsole", "2021-01-12", "RevokeFeedback")
{
setMethod(HttpRequest::Method::Post);
}
RevokeFeedbackRequest::~RevokeFeedbackRequest()
{}
std::string RevokeFeedbackRequest::getSampleType()const
{
return sampleType_;
}
void RevokeFeedbackRequest::setSampleType(const std::string& sampleType)
{
sampleType_ = sampleType;
setBodyParameter("SampleType", sampleType);
}
std::string RevokeFeedbackRequest::getValue()const
{
return value_;
}
void RevokeFeedbackRequest::setValue(const std::string& value)
{
value_ = value;
setBodyParameter("Value", value);
}

View File

@@ -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.
*/
#include <alibabacloud/safconsole/model/RevokeFeedbackResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Safconsole;
using namespace AlibabaCloud::Safconsole::Model;
RevokeFeedbackResult::RevokeFeedbackResult() :
ServiceResult()
{}
RevokeFeedbackResult::RevokeFeedbackResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RevokeFeedbackResult::~RevokeFeedbackResult()
{}
void RevokeFeedbackResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = value["Code"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string RevokeFeedbackResult::getMessage()const
{
return message_;
}
std::string RevokeFeedbackResult::getCode()const
{
return code_;
}

View File

@@ -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.
*/
#include <alibabacloud/safconsole/model/SendFeedbackRequest.h>
using AlibabaCloud::Safconsole::Model::SendFeedbackRequest;
SendFeedbackRequest::SendFeedbackRequest() :
RpcServiceRequest("safconsole", "2021-01-12", "SendFeedback")
{
setMethod(HttpRequest::Method::Post);
}
SendFeedbackRequest::~SendFeedbackRequest()
{}
std::string SendFeedbackRequest::getRiskLabel()const
{
return riskLabel_;
}
void SendFeedbackRequest::setRiskLabel(const std::string& riskLabel)
{
riskLabel_ = riskLabel;
setParameter("RiskLabel", riskLabel);
}
std::string SendFeedbackRequest::getSampleType()const
{
return sampleType_;
}
void SendFeedbackRequest::setSampleType(const std::string& sampleType)
{
sampleType_ = sampleType;
setParameter("SampleType", sampleType);
}
std::string SendFeedbackRequest::getValue()const
{
return value_;
}
void SendFeedbackRequest::setValue(const std::string& value)
{
value_ = value;
setParameter("Value", value);
}

View File

@@ -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.
*/
#include <alibabacloud/safconsole/model/SendFeedbackResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Safconsole;
using namespace AlibabaCloud::Safconsole::Model;
SendFeedbackResult::SendFeedbackResult() :
ServiceResult()
{}
SendFeedbackResult::SendFeedbackResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SendFeedbackResult::~SendFeedbackResult()
{}
void SendFeedbackResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string SendFeedbackResult::getMessage()const
{
return message_;
}
int SendFeedbackResult::getCode()const
{
return code_;
}