Supports tag management APIs.

This commit is contained in:
sdk-team
2020-07-03 10:53:44 +08:00
parent 7fecdadace
commit 4b39c98f5a
29 changed files with 1040 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
2020-07-03 Version: 1.36.498
- Supports tag management APIs.
2020-07-03 Version: 1.36.497
- Add PicUrl parameter for picture related API.

View File

@@ -1 +1 @@
1.36.497
1.36.498

View File

@@ -21,6 +21,8 @@ set(ons_public_header
include/alibabacloud/ons/OnsExport.h )
set(ons_public_header_model
include/alibabacloud/ons/model/ListTagResourcesRequest.h
include/alibabacloud/ons/model/ListTagResourcesResult.h
include/alibabacloud/ons/model/OnsConsumerAccumulateRequest.h
include/alibabacloud/ons/model/OnsConsumerAccumulateResult.h
include/alibabacloud/ons/model/OnsConsumerGetConnectionRequest.h
@@ -112,10 +114,16 @@ set(ons_public_header_model
include/alibabacloud/ons/model/OnsWarnCreateRequest.h
include/alibabacloud/ons/model/OnsWarnCreateResult.h
include/alibabacloud/ons/model/OnsWarnDeleteRequest.h
include/alibabacloud/ons/model/OnsWarnDeleteResult.h )
include/alibabacloud/ons/model/OnsWarnDeleteResult.h
include/alibabacloud/ons/model/TagResourcesRequest.h
include/alibabacloud/ons/model/TagResourcesResult.h
include/alibabacloud/ons/model/UntagResourcesRequest.h
include/alibabacloud/ons/model/UntagResourcesResult.h )
set(ons_src
src/OnsClient.cc
src/model/ListTagResourcesRequest.cc
src/model/ListTagResourcesResult.cc
src/model/OnsConsumerAccumulateRequest.cc
src/model/OnsConsumerAccumulateResult.cc
src/model/OnsConsumerGetConnectionRequest.cc
@@ -207,7 +215,11 @@ set(ons_src
src/model/OnsWarnCreateRequest.cc
src/model/OnsWarnCreateResult.cc
src/model/OnsWarnDeleteRequest.cc
src/model/OnsWarnDeleteResult.cc )
src/model/OnsWarnDeleteResult.cc
src/model/TagResourcesRequest.cc
src/model/TagResourcesResult.cc
src/model/UntagResourcesRequest.cc
src/model/UntagResourcesResult.cc )
add_library(ons ${LIB_TYPE}
${ons_public_header}

View File

@@ -22,6 +22,8 @@
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "OnsExport.h"
#include "model/ListTagResourcesRequest.h"
#include "model/ListTagResourcesResult.h"
#include "model/OnsConsumerAccumulateRequest.h"
#include "model/OnsConsumerAccumulateResult.h"
#include "model/OnsConsumerGetConnectionRequest.h"
@@ -114,6 +116,10 @@
#include "model/OnsWarnCreateResult.h"
#include "model/OnsWarnDeleteRequest.h"
#include "model/OnsWarnDeleteResult.h"
#include "model/TagResourcesRequest.h"
#include "model/TagResourcesResult.h"
#include "model/UntagResourcesRequest.h"
#include "model/UntagResourcesResult.h"
namespace AlibabaCloud
@@ -123,6 +129,9 @@ namespace AlibabaCloud
class ALIBABACLOUD_ONS_EXPORT OnsClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::ListTagResourcesResult> ListTagResourcesOutcome;
typedef std::future<ListTagResourcesOutcome> ListTagResourcesOutcomeCallable;
typedef std::function<void(const OnsClient*, const Model::ListTagResourcesRequest&, const ListTagResourcesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListTagResourcesAsyncHandler;
typedef Outcome<Error, Model::OnsConsumerAccumulateResult> OnsConsumerAccumulateOutcome;
typedef std::future<OnsConsumerAccumulateOutcome> OnsConsumerAccumulateOutcomeCallable;
typedef std::function<void(const OnsClient*, const Model::OnsConsumerAccumulateRequest&, const OnsConsumerAccumulateOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> OnsConsumerAccumulateAsyncHandler;
@@ -261,11 +270,20 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::OnsWarnDeleteResult> OnsWarnDeleteOutcome;
typedef std::future<OnsWarnDeleteOutcome> OnsWarnDeleteOutcomeCallable;
typedef std::function<void(const OnsClient*, const Model::OnsWarnDeleteRequest&, const OnsWarnDeleteOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> OnsWarnDeleteAsyncHandler;
typedef Outcome<Error, Model::TagResourcesResult> TagResourcesOutcome;
typedef std::future<TagResourcesOutcome> TagResourcesOutcomeCallable;
typedef std::function<void(const OnsClient*, const Model::TagResourcesRequest&, const TagResourcesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TagResourcesAsyncHandler;
typedef Outcome<Error, Model::UntagResourcesResult> UntagResourcesOutcome;
typedef std::future<UntagResourcesOutcome> UntagResourcesOutcomeCallable;
typedef std::function<void(const OnsClient*, const Model::UntagResourcesRequest&, const UntagResourcesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UntagResourcesAsyncHandler;
OnsClient(const Credentials &credentials, const ClientConfiguration &configuration);
OnsClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
OnsClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~OnsClient();
ListTagResourcesOutcome listTagResources(const Model::ListTagResourcesRequest &request)const;
void listTagResourcesAsync(const Model::ListTagResourcesRequest& request, const ListTagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListTagResourcesOutcomeCallable listTagResourcesCallable(const Model::ListTagResourcesRequest& request) const;
OnsConsumerAccumulateOutcome onsConsumerAccumulate(const Model::OnsConsumerAccumulateRequest &request)const;
void onsConsumerAccumulateAsync(const Model::OnsConsumerAccumulateRequest& request, const OnsConsumerAccumulateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
OnsConsumerAccumulateOutcomeCallable onsConsumerAccumulateCallable(const Model::OnsConsumerAccumulateRequest& request) const;
@@ -404,6 +422,12 @@ namespace AlibabaCloud
OnsWarnDeleteOutcome onsWarnDelete(const Model::OnsWarnDeleteRequest &request)const;
void onsWarnDeleteAsync(const Model::OnsWarnDeleteRequest& request, const OnsWarnDeleteAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
OnsWarnDeleteOutcomeCallable onsWarnDeleteCallable(const Model::OnsWarnDeleteRequest& request) const;
TagResourcesOutcome tagResources(const Model::TagResourcesRequest &request)const;
void tagResourcesAsync(const Model::TagResourcesRequest& request, const TagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
TagResourcesOutcomeCallable tagResourcesCallable(const Model::TagResourcesRequest& request) const;
UntagResourcesOutcome untagResources(const Model::UntagResourcesRequest &request)const;
void untagResourcesAsync(const Model::UntagResourcesRequest& request, const UntagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
UntagResourcesOutcomeCallable untagResourcesCallable(const Model::UntagResourcesRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;

View File

@@ -0,0 +1,66 @@
/*
* 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_ONS_MODEL_LISTTAGRESOURCESREQUEST_H_
#define ALIBABACLOUD_ONS_MODEL_LISTTAGRESOURCESREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ons/OnsExport.h>
namespace AlibabaCloud
{
namespace Ons
{
namespace Model
{
class ALIBABACLOUD_ONS_EXPORT ListTagResourcesRequest : public RpcServiceRequest
{
public:
struct Tag
{
std::string value;
std::string key;
};
public:
ListTagResourcesRequest();
~ListTagResourcesRequest();
std::vector<std::string> getResourceId()const;
void setResourceId(const std::vector<std::string>& resourceId);
std::string getResourceType()const;
void setResourceType(const std::string& resourceType);
std::string getInstanceId()const;
void setInstanceId(const std::string& instanceId);
std::string getNextToken()const;
void setNextToken(const std::string& nextToken);
std::vector<Tag> getTag()const;
void setTag(const std::vector<Tag>& tag);
private:
std::vector<std::string> resourceId_;
std::string resourceType_;
std::string instanceId_;
std::string nextToken_;
std::vector<Tag> tag_;
};
}
}
}
#endif // !ALIBABACLOUD_ONS_MODEL_LISTTAGRESOURCESREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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_ONS_MODEL_LISTTAGRESOURCESRESULT_H_
#define ALIBABACLOUD_ONS_MODEL_LISTTAGRESOURCESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ons/OnsExport.h>
namespace AlibabaCloud
{
namespace Ons
{
namespace Model
{
class ALIBABACLOUD_ONS_EXPORT ListTagResourcesResult : public ServiceResult
{
public:
struct TagResource
{
std::string resourceId;
std::string instanceId;
std::string tagKey;
std::string resourceType;
std::string tagValue;
};
ListTagResourcesResult();
explicit ListTagResourcesResult(const std::string &payload);
~ListTagResourcesResult();
std::string getNextToken()const;
std::vector<TagResource> getTagResources()const;
protected:
void parse(const std::string &payload);
private:
std::string nextToken_;
std::vector<TagResource> tagResources_;
};
}
}
}
#endif // !ALIBABACLOUD_ONS_MODEL_LISTTAGRESOURCESRESULT_H_

View File

@@ -30,6 +30,12 @@ namespace AlibabaCloud
{
class ALIBABACLOUD_ONS_EXPORT OnsGroupListRequest : public RpcServiceRequest
{
public:
struct Tag
{
std::string value;
std::string key;
};
public:
OnsGroupListRequest();
@@ -41,11 +47,14 @@ namespace AlibabaCloud
void setInstanceId(const std::string& instanceId);
std::string getGroupType()const;
void setGroupType(const std::string& groupType);
std::vector<Tag> getTag()const;
void setTag(const std::vector<Tag>& tag);
private:
std::string groupId_;
std::string instanceId_;
std::string groupType_;
std::vector<Tag> tag_;
};
}

View File

@@ -34,12 +34,18 @@ namespace AlibabaCloud
public:
struct SubscribeInfoDo
{
struct Tag
{
std::string value;
std::string key;
};
std::string owner;
std::string groupType;
std::string instanceId;
long createTime;
long updateTime;
bool independentNaming;
std::vector<SubscribeInfoDo::Tag> tags;
std::string groupId;
std::string remark;
};

View File

@@ -30,13 +30,22 @@ namespace AlibabaCloud
{
class ALIBABACLOUD_ONS_EXPORT OnsInstanceInServiceListRequest : public RpcServiceRequest
{
public:
struct Tag
{
std::string value;
std::string key;
};
public:
OnsInstanceInServiceListRequest();
~OnsInstanceInServiceListRequest();
std::vector<Tag> getTag()const;
void setTag(const std::vector<Tag>& tag);
private:
std::vector<Tag> tag_;
};
}

View File

@@ -34,12 +34,18 @@ namespace AlibabaCloud
public:
struct InstanceVO
{
struct Tag
{
std::string value;
std::string key;
};
std::string instanceName;
std::string instanceId;
long releaseTime;
int instanceStatus;
bool independentNaming;
int instanceType;
std::vector<InstanceVO::Tag> tags;
};

View File

@@ -30,6 +30,12 @@ namespace AlibabaCloud
{
class ALIBABACLOUD_ONS_EXPORT OnsTopicListRequest : public RpcServiceRequest
{
public:
struct Tag
{
std::string value;
std::string key;
};
public:
OnsTopicListRequest();
@@ -39,10 +45,13 @@ namespace AlibabaCloud
void setInstanceId(const std::string& instanceId);
std::string getTopic()const;
void setTopic(const std::string& topic);
std::vector<Tag> getTag()const;
void setTag(const std::vector<Tag>& tag);
private:
std::string instanceId_;
std::string topic_;
std::vector<Tag> tag_;
};
}

View File

@@ -34,6 +34,11 @@ namespace AlibabaCloud
public:
struct PublishInfoDo
{
struct Tag
{
std::string value;
std::string key;
};
std::string owner;
int relation;
std::string instanceId;
@@ -41,6 +46,7 @@ namespace AlibabaCloud
std::string relationName;
bool independentNaming;
std::string topic;
std::vector<PublishInfoDo::Tag> tags;
int messageType;
std::string remark;
};

View 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.
*/
#ifndef ALIBABACLOUD_ONS_MODEL_TAGRESOURCESREQUEST_H_
#define ALIBABACLOUD_ONS_MODEL_TAGRESOURCESREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ons/OnsExport.h>
namespace AlibabaCloud
{
namespace Ons
{
namespace Model
{
class ALIBABACLOUD_ONS_EXPORT TagResourcesRequest : public RpcServiceRequest
{
public:
struct Tag
{
std::string value;
std::string key;
};
public:
TagResourcesRequest();
~TagResourcesRequest();
std::vector<std::string> getResourceId()const;
void setResourceId(const std::vector<std::string>& resourceId);
std::string getResourceType()const;
void setResourceType(const std::string& resourceType);
std::string getInstanceId()const;
void setInstanceId(const std::string& instanceId);
std::vector<Tag> getTag()const;
void setTag(const std::vector<Tag>& tag);
private:
std::vector<std::string> resourceId_;
std::string resourceType_;
std::string instanceId_;
std::vector<Tag> tag_;
};
}
}
}
#endif // !ALIBABACLOUD_ONS_MODEL_TAGRESOURCESREQUEST_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_ONS_MODEL_TAGRESOURCESRESULT_H_
#define ALIBABACLOUD_ONS_MODEL_TAGRESOURCESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ons/OnsExport.h>
namespace AlibabaCloud
{
namespace Ons
{
namespace Model
{
class ALIBABACLOUD_ONS_EXPORT TagResourcesResult : public ServiceResult
{
public:
TagResourcesResult();
explicit TagResourcesResult(const std::string &payload);
~TagResourcesResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_ONS_MODEL_TAGRESOURCESRESULT_H_

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.
*/
#ifndef ALIBABACLOUD_ONS_MODEL_UNTAGRESOURCESREQUEST_H_
#define ALIBABACLOUD_ONS_MODEL_UNTAGRESOURCESREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/ons/OnsExport.h>
namespace AlibabaCloud
{
namespace Ons
{
namespace Model
{
class ALIBABACLOUD_ONS_EXPORT UntagResourcesRequest : public RpcServiceRequest
{
public:
UntagResourcesRequest();
~UntagResourcesRequest();
bool getAll()const;
void setAll(bool all);
std::vector<std::string> getResourceId()const;
void setResourceId(const std::vector<std::string>& resourceId);
std::string getResourceType()const;
void setResourceType(const std::string& resourceType);
std::string getInstanceId()const;
void setInstanceId(const std::string& instanceId);
std::vector<std::string> getTagKey()const;
void setTagKey(const std::vector<std::string>& tagKey);
private:
bool all_;
std::vector<std::string> resourceId_;
std::string resourceType_;
std::string instanceId_;
std::vector<std::string> tagKey_;
};
}
}
}
#endif // !ALIBABACLOUD_ONS_MODEL_UNTAGRESOURCESREQUEST_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_ONS_MODEL_UNTAGRESOURCESRESULT_H_
#define ALIBABACLOUD_ONS_MODEL_UNTAGRESOURCESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ons/OnsExport.h>
namespace AlibabaCloud
{
namespace Ons
{
namespace Model
{
class ALIBABACLOUD_ONS_EXPORT UntagResourcesResult : public ServiceResult
{
public:
UntagResourcesResult();
explicit UntagResourcesResult(const std::string &payload);
~UntagResourcesResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_ONS_MODEL_UNTAGRESOURCESRESULT_H_

View File

@@ -51,6 +51,42 @@ OnsClient::OnsClient(const std::string & accessKeyId, const std::string & access
OnsClient::~OnsClient()
{}
OnsClient::ListTagResourcesOutcome OnsClient::listTagResources(const ListTagResourcesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListTagResourcesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListTagResourcesOutcome(ListTagResourcesResult(outcome.result()));
else
return ListTagResourcesOutcome(outcome.error());
}
void OnsClient::listTagResourcesAsync(const ListTagResourcesRequest& request, const ListTagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listTagResources(request), context);
};
asyncExecute(new Runnable(fn));
}
OnsClient::ListTagResourcesOutcomeCallable OnsClient::listTagResourcesCallable(const ListTagResourcesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListTagResourcesOutcome()>>(
[this, request]()
{
return this->listTagResources(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OnsClient::OnsConsumerAccumulateOutcome OnsClient::onsConsumerAccumulate(const OnsConsumerAccumulateRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1707,3 +1743,75 @@ OnsClient::OnsWarnDeleteOutcomeCallable OnsClient::onsWarnDeleteCallable(const O
return task->get_future();
}
OnsClient::TagResourcesOutcome OnsClient::tagResources(const TagResourcesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return TagResourcesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return TagResourcesOutcome(TagResourcesResult(outcome.result()));
else
return TagResourcesOutcome(outcome.error());
}
void OnsClient::tagResourcesAsync(const TagResourcesRequest& request, const TagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, tagResources(request), context);
};
asyncExecute(new Runnable(fn));
}
OnsClient::TagResourcesOutcomeCallable OnsClient::tagResourcesCallable(const TagResourcesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<TagResourcesOutcome()>>(
[this, request]()
{
return this->tagResources(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OnsClient::UntagResourcesOutcome OnsClient::untagResources(const UntagResourcesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UntagResourcesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UntagResourcesOutcome(UntagResourcesResult(outcome.result()));
else
return UntagResourcesOutcome(outcome.error());
}
void OnsClient::untagResourcesAsync(const UntagResourcesRequest& request, const UntagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, untagResources(request), context);
};
asyncExecute(new Runnable(fn));
}
OnsClient::UntagResourcesOutcomeCallable OnsClient::untagResourcesCallable(const UntagResourcesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UntagResourcesOutcome()>>(
[this, request]()
{
return this->untagResources(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,91 @@
/*
* 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/ons/model/ListTagResourcesRequest.h>
using AlibabaCloud::Ons::Model::ListTagResourcesRequest;
ListTagResourcesRequest::ListTagResourcesRequest() :
RpcServiceRequest("ons", "2019-02-14", "ListTagResources")
{
setMethod(HttpRequest::Method::Post);
}
ListTagResourcesRequest::~ListTagResourcesRequest()
{}
std::vector<std::string> ListTagResourcesRequest::getResourceId()const
{
return resourceId_;
}
void ListTagResourcesRequest::setResourceId(const std::vector<std::string>& resourceId)
{
resourceId_ = resourceId;
for(int dep1 = 0; dep1!= resourceId.size(); dep1++) {
setParameter("ResourceId."+ std::to_string(dep1), resourceId.at(dep1));
}
}
std::string ListTagResourcesRequest::getResourceType()const
{
return resourceType_;
}
void ListTagResourcesRequest::setResourceType(const std::string& resourceType)
{
resourceType_ = resourceType;
setParameter("ResourceType", resourceType);
}
std::string ListTagResourcesRequest::getInstanceId()const
{
return instanceId_;
}
void ListTagResourcesRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
std::string ListTagResourcesRequest::getNextToken()const
{
return nextToken_;
}
void ListTagResourcesRequest::setNextToken(const std::string& nextToken)
{
nextToken_ = nextToken;
setParameter("NextToken", nextToken);
}
std::vector<ListTagResourcesRequest::Tag> ListTagResourcesRequest::getTag()const
{
return tag_;
}
void ListTagResourcesRequest::setTag(const std::vector<Tag>& tag)
{
tag_ = tag;
for(int dep1 = 0; dep1!= tag.size(); dep1++) {
auto tagObj = tag.at(dep1);
std::string tagObjStr = "Tag." + std::to_string(dep1 + 1);
setParameter(tagObjStr + ".Value", tagObj.value);
setParameter(tagObjStr + ".Key", tagObj.key);
}
}

View File

@@ -0,0 +1,72 @@
/*
* 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/ons/model/ListTagResourcesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ons;
using namespace AlibabaCloud::Ons::Model;
ListTagResourcesResult::ListTagResourcesResult() :
ServiceResult()
{}
ListTagResourcesResult::ListTagResourcesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListTagResourcesResult::~ListTagResourcesResult()
{}
void ListTagResourcesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allTagResourcesNode = value["TagResources"]["TagResource"];
for (auto valueTagResourcesTagResource : allTagResourcesNode)
{
TagResource tagResourcesObject;
if(!valueTagResourcesTagResource["TagKey"].isNull())
tagResourcesObject.tagKey = valueTagResourcesTagResource["TagKey"].asString();
if(!valueTagResourcesTagResource["TagValue"].isNull())
tagResourcesObject.tagValue = valueTagResourcesTagResource["TagValue"].asString();
if(!valueTagResourcesTagResource["ResourceType"].isNull())
tagResourcesObject.resourceType = valueTagResourcesTagResource["ResourceType"].asString();
if(!valueTagResourcesTagResource["ResourceId"].isNull())
tagResourcesObject.resourceId = valueTagResourcesTagResource["ResourceId"].asString();
if(!valueTagResourcesTagResource["InstanceId"].isNull())
tagResourcesObject.instanceId = valueTagResourcesTagResource["InstanceId"].asString();
tagResources_.push_back(tagResourcesObject);
}
if(!value["NextToken"].isNull())
nextToken_ = value["NextToken"].asString();
}
std::string ListTagResourcesResult::getNextToken()const
{
return nextToken_;
}
std::vector<ListTagResourcesResult::TagResource> ListTagResourcesResult::getTagResources()const
{
return tagResources_;
}

View File

@@ -60,3 +60,19 @@ void OnsGroupListRequest::setGroupType(const std::string& groupType)
setParameter("GroupType", groupType);
}
std::vector<OnsGroupListRequest::Tag> OnsGroupListRequest::getTag()const
{
return tag_;
}
void OnsGroupListRequest::setTag(const std::vector<Tag>& tag)
{
tag_ = tag;
for(int dep1 = 0; dep1!= tag.size(); dep1++) {
auto tagObj = tag.at(dep1);
std::string tagObjStr = "Tag." + std::to_string(dep1 + 1);
setParameter(tagObjStr + ".Value", tagObj.value);
setParameter(tagObjStr + ".Key", tagObj.key);
}
}

View File

@@ -59,6 +59,16 @@ void OnsGroupListResult::parse(const std::string &payload)
dataObject.createTime = std::stol(valueDataSubscribeInfoDo["CreateTime"].asString());
if(!valueDataSubscribeInfoDo["GroupType"].isNull())
dataObject.groupType = valueDataSubscribeInfoDo["GroupType"].asString();
auto allTagsNode = allDataNode["Tags"]["Tag"];
for (auto allDataNodeTagsTag : allTagsNode)
{
SubscribeInfoDo::Tag tagsObject;
if(!allDataNodeTagsTag["Key"].isNull())
tagsObject.key = allDataNodeTagsTag["Key"].asString();
if(!allDataNodeTagsTag["Value"].isNull())
tagsObject.value = allDataNodeTagsTag["Value"].asString();
dataObject.tags.push_back(tagsObject);
}
data_.push_back(dataObject);
}
if(!value["HelpUrl"].isNull())

View File

@@ -27,3 +27,19 @@ OnsInstanceInServiceListRequest::OnsInstanceInServiceListRequest() :
OnsInstanceInServiceListRequest::~OnsInstanceInServiceListRequest()
{}
std::vector<OnsInstanceInServiceListRequest::Tag> OnsInstanceInServiceListRequest::getTag()const
{
return tag_;
}
void OnsInstanceInServiceListRequest::setTag(const std::vector<Tag>& tag)
{
tag_ = tag;
for(int dep1 = 0; dep1!= tag.size(); dep1++) {
auto tagObj = tag.at(dep1);
std::string tagObjStr = "Tag." + std::to_string(dep1 + 1);
setParameter(tagObjStr + ".Value", tagObj.value);
setParameter(tagObjStr + ".Key", tagObj.key);
}
}

View File

@@ -55,6 +55,16 @@ void OnsInstanceInServiceListResult::parse(const std::string &payload)
dataObject.instanceName = valueDataInstanceVO["InstanceName"].asString();
if(!valueDataInstanceVO["IndependentNaming"].isNull())
dataObject.independentNaming = valueDataInstanceVO["IndependentNaming"].asString() == "true";
auto allTagsNode = allDataNode["Tags"]["Tag"];
for (auto allDataNodeTagsTag : allTagsNode)
{
InstanceVO::Tag tagsObject;
if(!allDataNodeTagsTag["Key"].isNull())
tagsObject.key = allDataNodeTagsTag["Key"].asString();
if(!allDataNodeTagsTag["Value"].isNull())
tagsObject.value = allDataNodeTagsTag["Value"].asString();
dataObject.tags.push_back(tagsObject);
}
data_.push_back(dataObject);
}
if(!value["HelpUrl"].isNull())

View File

@@ -49,3 +49,19 @@ void OnsTopicListRequest::setTopic(const std::string& topic)
setParameter("Topic", topic);
}
std::vector<OnsTopicListRequest::Tag> OnsTopicListRequest::getTag()const
{
return tag_;
}
void OnsTopicListRequest::setTag(const std::vector<Tag>& tag)
{
tag_ = tag;
for(int dep1 = 0; dep1!= tag.size(); dep1++) {
auto tagObj = tag.at(dep1);
std::string tagObjStr = "Tag." + std::to_string(dep1 + 1);
setParameter(tagObjStr + ".Value", tagObj.value);
setParameter(tagObjStr + ".Key", tagObj.key);
}
}

View File

@@ -61,6 +61,16 @@ void OnsTopicListResult::parse(const std::string &payload)
dataObject.instanceId = valueDataPublishInfoDo["InstanceId"].asString();
if(!valueDataPublishInfoDo["IndependentNaming"].isNull())
dataObject.independentNaming = valueDataPublishInfoDo["IndependentNaming"].asString() == "true";
auto allTagsNode = allDataNode["Tags"]["Tag"];
for (auto allDataNodeTagsTag : allTagsNode)
{
PublishInfoDo::Tag tagsObject;
if(!allDataNodeTagsTag["Key"].isNull())
tagsObject.key = allDataNodeTagsTag["Key"].asString();
if(!allDataNodeTagsTag["Value"].isNull())
tagsObject.value = allDataNodeTagsTag["Value"].asString();
dataObject.tags.push_back(tagsObject);
}
data_.push_back(dataObject);
}
if(!value["HelpUrl"].isNull())

View File

@@ -0,0 +1,80 @@
/*
* 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/ons/model/TagResourcesRequest.h>
using AlibabaCloud::Ons::Model::TagResourcesRequest;
TagResourcesRequest::TagResourcesRequest() :
RpcServiceRequest("ons", "2019-02-14", "TagResources")
{
setMethod(HttpRequest::Method::Post);
}
TagResourcesRequest::~TagResourcesRequest()
{}
std::vector<std::string> TagResourcesRequest::getResourceId()const
{
return resourceId_;
}
void TagResourcesRequest::setResourceId(const std::vector<std::string>& resourceId)
{
resourceId_ = resourceId;
for(int dep1 = 0; dep1!= resourceId.size(); dep1++) {
setParameter("ResourceId."+ std::to_string(dep1), resourceId.at(dep1));
}
}
std::string TagResourcesRequest::getResourceType()const
{
return resourceType_;
}
void TagResourcesRequest::setResourceType(const std::string& resourceType)
{
resourceType_ = resourceType;
setParameter("ResourceType", resourceType);
}
std::string TagResourcesRequest::getInstanceId()const
{
return instanceId_;
}
void TagResourcesRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
std::vector<TagResourcesRequest::Tag> TagResourcesRequest::getTag()const
{
return tag_;
}
void TagResourcesRequest::setTag(const std::vector<Tag>& tag)
{
tag_ = tag;
for(int dep1 = 0; dep1!= tag.size(); dep1++) {
auto tagObj = tag.at(dep1);
std::string tagObjStr = "Tag." + std::to_string(dep1 + 1);
setParameter(tagObjStr + ".Value", tagObj.value);
setParameter(tagObjStr + ".Key", tagObj.key);
}
}

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/ons/model/TagResourcesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ons;
using namespace AlibabaCloud::Ons::Model;
TagResourcesResult::TagResourcesResult() :
ServiceResult()
{}
TagResourcesResult::TagResourcesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
TagResourcesResult::~TagResourcesResult()
{}
void TagResourcesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,88 @@
/*
* 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/ons/model/UntagResourcesRequest.h>
using AlibabaCloud::Ons::Model::UntagResourcesRequest;
UntagResourcesRequest::UntagResourcesRequest() :
RpcServiceRequest("ons", "2019-02-14", "UntagResources")
{
setMethod(HttpRequest::Method::Post);
}
UntagResourcesRequest::~UntagResourcesRequest()
{}
bool UntagResourcesRequest::getAll()const
{
return all_;
}
void UntagResourcesRequest::setAll(bool all)
{
all_ = all;
setParameter("All", all ? "true" : "false");
}
std::vector<std::string> UntagResourcesRequest::getResourceId()const
{
return resourceId_;
}
void UntagResourcesRequest::setResourceId(const std::vector<std::string>& resourceId)
{
resourceId_ = resourceId;
for(int dep1 = 0; dep1!= resourceId.size(); dep1++) {
setParameter("ResourceId."+ std::to_string(dep1), resourceId.at(dep1));
}
}
std::string UntagResourcesRequest::getResourceType()const
{
return resourceType_;
}
void UntagResourcesRequest::setResourceType(const std::string& resourceType)
{
resourceType_ = resourceType;
setParameter("ResourceType", resourceType);
}
std::string UntagResourcesRequest::getInstanceId()const
{
return instanceId_;
}
void UntagResourcesRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
std::vector<std::string> UntagResourcesRequest::getTagKey()const
{
return tagKey_;
}
void UntagResourcesRequest::setTagKey(const std::vector<std::string>& tagKey)
{
tagKey_ = tagKey;
for(int dep1 = 0; dep1!= tagKey.size(); dep1++) {
setParameter("TagKey."+ std::to_string(dep1), tagKey.at(dep1));
}
}

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/ons/model/UntagResourcesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ons;
using namespace AlibabaCloud::Ons::Model;
UntagResourcesResult::UntagResourcesResult() :
ServiceResult()
{}
UntagResourcesResult::UntagResourcesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UntagResourcesResult::~UntagResourcesResult()
{}
void UntagResourcesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}