PatchBaseline Support Tags.

This commit is contained in:
sdk-team
2023-07-25 09:55:45 +00:00
parent 38c284599d
commit 08ad4ba807
17 changed files with 356 additions and 68 deletions

View File

@@ -1 +1 @@
1.36.1681
1.36.1682

View File

@@ -28,34 +28,50 @@ namespace Oos {
namespace Model {
class ALIBABACLOUD_OOS_EXPORT CreatePatchBaselineRequest : public RpcServiceRequest {
public:
struct Tags {
std::string value;
std::string key;
};
CreatePatchBaselineRequest();
~CreatePatchBaselineRequest();
std::vector<std::string> getSources() const;
void setSources(const std::vector<std::string> &sources);
std::string getClientToken() const;
void setClientToken(const std::string &clientToken);
std::string getApprovalRules() const;
void setApprovalRules(const std::string &approvalRules);
std::string getDescription() const;
void setDescription(const std::string &description);
std::string getOperationSystem() const;
void setOperationSystem(const std::string &operationSystem);
std::vector<std::string> getRejectedPatches() const;
void setRejectedPatches(const std::vector<std::string> &rejectedPatches);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getRejectedPatchesAction() const;
void setRejectedPatchesAction(const std::string &rejectedPatchesAction);
bool getApprovedPatchesEnableNonSecurity() const;
void setApprovedPatchesEnableNonSecurity(bool approvedPatchesEnableNonSecurity);
std::vector<Tags> getTags() const;
void setTags(const std::vector<Tags> &tags);
std::string getOperationSystem() const;
void setOperationSystem(const std::string &operationSystem);
std::vector<std::string> getRejectedPatches() const;
void setRejectedPatches(const std::vector<std::string> &rejectedPatches);
std::string getName() const;
void setName(const std::string &name);
std::vector<std::string> getApprovedPatches() const;
void setApprovedPatches(const std::vector<std::string> &approvedPatches);
private:
std::vector<std::string> sources_;
std::string clientToken_;
std::string approvalRules_;
std::string description_;
std::string operationSystem_;
std::vector<std::string> rejectedPatches_;
std::string regionId_;
std::string rejectedPatchesAction_;
bool approvedPatchesEnableNonSecurity_;
std::vector<Tags> tags_;
std::string operationSystem_;
std::vector<std::string> rejectedPatches_;
std::string name_;
std::vector<std::string> approvedPatches_;
};
} // namespace Model
} // namespace Oos

View File

@@ -34,18 +34,27 @@ namespace AlibabaCloud
public:
struct PatchBaseline
{
std::string rejectedPatchesAction;
std::string updatedBy;
struct TagsItem
{
std::string tagKey;
std::string tagValue;
};
std::string description;
std::string createdBy;
std::string updatedDate;
std::string createdDate;
std::string operationSystem;
std::string id;
std::string approvalRules;
std::vector<std::string> sources;
std::string name;
std::string shareType;
std::vector<std::string> rejectedPatches;
std::string rejectedPatchesAction;
std::vector<std::string> approvedPatches;
std::string updatedBy;
std::string createdDate;
bool approvedPatchesEnableNonSecurity;
std::string id;
std::vector<TagsItem> tags;
std::string shareType;
};

View File

@@ -35,6 +35,7 @@ namespace AlibabaCloud
struct Application
{
std::string updateDate;
std::string applicationType;
std::string description;
std::string resourceGroupId;
std::string createDate;

View File

@@ -34,18 +34,27 @@ namespace AlibabaCloud
public:
struct PatchBaseline
{
struct TagsItem
{
std::string tagKey;
std::string tagValue;
};
bool isDefault;
std::string description;
std::string createdBy;
std::string updatedDate;
std::string operationSystem;
std::string approvalRules;
std::vector<std::string> sources;
std::string name;
std::vector<std::string> rejectedPatches;
std::string rejectedPatchesAction;
std::vector<std::string> approvedPatches;
std::string updatedBy;
std::string createdDate;
bool approvedPatchesEnableNonSecurity;
std::string id;
std::vector<TagsItem> tags;
std::string shareType;
};

View File

@@ -28,28 +28,44 @@ namespace Oos {
namespace Model {
class ALIBABACLOUD_OOS_EXPORT ListPatchBaselinesRequest : public RpcServiceRequest {
public:
struct Tags {
std::string value;
std::string key;
};
ListPatchBaselinesRequest();
~ListPatchBaselinesRequest();
std::string getOperationSystem() const;
void setOperationSystem(const std::string &operationSystem);
std::vector<std::string> getSources() const;
void setSources(const std::vector<std::string> &sources);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getNextToken() const;
void setNextToken(const std::string &nextToken);
std::string getShareType() const;
void setShareType(const std::string &shareType);
bool getApprovedPatchesEnableNonSecurity() const;
void setApprovedPatchesEnableNonSecurity(bool approvedPatchesEnableNonSecurity);
std::vector<Tags> getTags() const;
void setTags(const std::vector<Tags> &tags);
std::string getOperationSystem() const;
void setOperationSystem(const std::string &operationSystem);
std::string getName() const;
void setName(const std::string &name);
int getMaxResults() const;
void setMaxResults(int maxResults);
std::string getShareType() const;
void setShareType(const std::string &shareType);
std::vector<std::string> getApprovedPatches() const;
void setApprovedPatches(const std::vector<std::string> &approvedPatches);
private:
std::string operationSystem_;
std::vector<std::string> sources_;
std::string regionId_;
std::string nextToken_;
std::string shareType_;
bool approvedPatchesEnableNonSecurity_;
std::vector<Tags> tags_;
std::string operationSystem_;
std::string name_;
int maxResults_;
std::string shareType_;
std::vector<std::string> approvedPatches_;
};
} // namespace Model
} // namespace Oos

View File

@@ -34,15 +34,24 @@ namespace AlibabaCloud
public:
struct PatchBaseline
{
struct TagsItem
{
std::string tagKey;
std::string tagValue;
};
bool isDefault;
std::string updatedBy;
std::string description;
std::string createdBy;
std::string updatedDate;
std::string createdDate;
std::string operationSystem;
std::string id;
std::vector<std::string> sources;
std::string name;
std::vector<std::string> approvedPatches;
std::string updatedBy;
std::string createdDate;
bool approvedPatchesEnableNonSecurity;
std::string id;
std::vector<PatchBaseline::TagsItem> tags;
std::string shareType;
};

View File

@@ -28,31 +28,47 @@ namespace Oos {
namespace Model {
class ALIBABACLOUD_OOS_EXPORT UpdatePatchBaselineRequest : public RpcServiceRequest {
public:
struct Tags {
std::string value;
std::string key;
};
UpdatePatchBaselineRequest();
~UpdatePatchBaselineRequest();
std::vector<std::string> getSources() const;
void setSources(const std::vector<std::string> &sources);
std::string getClientToken() const;
void setClientToken(const std::string &clientToken);
std::string getApprovalRules() const;
void setApprovalRules(const std::string &approvalRules);
std::string getDescription() const;
void setDescription(const std::string &description);
std::vector<std::string> getRejectedPatches() const;
void setRejectedPatches(const std::vector<std::string> &rejectedPatches);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getRejectedPatchesAction() const;
void setRejectedPatchesAction(const std::string &rejectedPatchesAction);
bool getApprovedPatchesEnableNonSecurity() const;
void setApprovedPatchesEnableNonSecurity(bool approvedPatchesEnableNonSecurity);
std::vector<Tags> getTags() const;
void setTags(const std::vector<Tags> &tags);
std::vector<std::string> getRejectedPatches() const;
void setRejectedPatches(const std::vector<std::string> &rejectedPatches);
std::string getName() const;
void setName(const std::string &name);
std::vector<std::string> getApprovedPatches() const;
void setApprovedPatches(const std::vector<std::string> &approvedPatches);
private:
std::vector<std::string> sources_;
std::string clientToken_;
std::string approvalRules_;
std::string description_;
std::vector<std::string> rejectedPatches_;
std::string regionId_;
std::string rejectedPatchesAction_;
bool approvedPatchesEnableNonSecurity_;
std::vector<Tags> tags_;
std::vector<std::string> rejectedPatches_;
std::string name_;
std::vector<std::string> approvedPatches_;
};
} // namespace Model
} // namespace Oos

View File

@@ -34,18 +34,27 @@ namespace AlibabaCloud
public:
struct PatchBaseline
{
std::string rejectedPatchesAction;
std::string updatedBy;
struct TagsItem
{
std::string tagKey;
std::string tagValue;
};
std::string description;
std::string createdBy;
std::string updatedDate;
std::string createdDate;
std::string operationSystem;
std::string id;
std::string approvalRules;
std::vector<std::string> sources;
std::string name;
std::string shareType;
std::vector<std::string> rejectedPatches;
std::string rejectedPatchesAction;
std::vector<std::string> approvedPatches;
std::string updatedBy;
std::string createdDate;
bool approvedPatchesEnableNonSecurity;
std::string id;
std::vector<TagsItem> tags;
std::string shareType;
};

View File

@@ -25,6 +25,17 @@ CreatePatchBaselineRequest::CreatePatchBaselineRequest()
CreatePatchBaselineRequest::~CreatePatchBaselineRequest() {}
std::vector<CreatePatchBaselineRequest::std::string> CreatePatchBaselineRequest::getSources() const {
return sources_;
}
void CreatePatchBaselineRequest::setSources(const std::vector<CreatePatchBaselineRequest::std::string> &sources) {
sources_ = sources;
for(int dep1 = 0; dep1 != sources.size(); dep1++) {
setParameter(std::string("Sources") + "." + std::to_string(dep1 + 1), sources[dep1]);
}
}
std::string CreatePatchBaselineRequest::getClientToken() const {
return clientToken_;
}
@@ -52,6 +63,45 @@ void CreatePatchBaselineRequest::setDescription(const std::string &description)
setParameter(std::string("Description"), description);
}
std::string CreatePatchBaselineRequest::getRegionId() const {
return regionId_;
}
void CreatePatchBaselineRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string CreatePatchBaselineRequest::getRejectedPatchesAction() const {
return rejectedPatchesAction_;
}
void CreatePatchBaselineRequest::setRejectedPatchesAction(const std::string &rejectedPatchesAction) {
rejectedPatchesAction_ = rejectedPatchesAction;
setParameter(std::string("RejectedPatchesAction"), rejectedPatchesAction);
}
bool CreatePatchBaselineRequest::getApprovedPatchesEnableNonSecurity() const {
return approvedPatchesEnableNonSecurity_;
}
void CreatePatchBaselineRequest::setApprovedPatchesEnableNonSecurity(bool approvedPatchesEnableNonSecurity) {
approvedPatchesEnableNonSecurity_ = approvedPatchesEnableNonSecurity;
setParameter(std::string("ApprovedPatchesEnableNonSecurity"), approvedPatchesEnableNonSecurity ? "true" : "false");
}
std::vector<CreatePatchBaselineRequest::Tags> CreatePatchBaselineRequest::getTags() const {
return tags_;
}
void CreatePatchBaselineRequest::setTags(const std::vector<CreatePatchBaselineRequest::Tags> &tags) {
tags_ = tags;
for(int dep1 = 0; dep1 != tags.size(); dep1++) {
setParameter(std::string("Tags") + "." + std::to_string(dep1 + 1) + ".Value", tags[dep1].value);
setParameter(std::string("Tags") + "." + std::to_string(dep1 + 1) + ".Key", tags[dep1].key);
}
}
std::string CreatePatchBaselineRequest::getOperationSystem() const {
return operationSystem_;
}
@@ -72,24 +122,6 @@ void CreatePatchBaselineRequest::setRejectedPatches(const std::vector<CreatePatc
}
}
std::string CreatePatchBaselineRequest::getRegionId() const {
return regionId_;
}
void CreatePatchBaselineRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string CreatePatchBaselineRequest::getRejectedPatchesAction() const {
return rejectedPatchesAction_;
}
void CreatePatchBaselineRequest::setRejectedPatchesAction(const std::string &rejectedPatchesAction) {
rejectedPatchesAction_ = rejectedPatchesAction;
setParameter(std::string("RejectedPatchesAction"), rejectedPatchesAction);
}
std::string CreatePatchBaselineRequest::getName() const {
return name_;
}
@@ -99,3 +131,14 @@ void CreatePatchBaselineRequest::setName(const std::string &name) {
setParameter(std::string("Name"), name);
}
std::vector<CreatePatchBaselineRequest::std::string> CreatePatchBaselineRequest::getApprovedPatches() const {
return approvedPatches_;
}
void CreatePatchBaselineRequest::setApprovedPatches(const std::vector<CreatePatchBaselineRequest::std::string> &approvedPatches) {
approvedPatches_ = approvedPatches;
for(int dep1 = 0; dep1 != approvedPatches.size(); dep1++) {
setParameter(std::string("ApprovedPatches") + "." + std::to_string(dep1 + 1), approvedPatches[dep1]);
}
}

View File

@@ -62,9 +62,27 @@ void CreatePatchBaselineResult::parse(const std::string &payload)
patchBaseline_.shareType = patchBaselineNode["ShareType"].asString();
if(!patchBaselineNode["RejectedPatchesAction"].isNull())
patchBaseline_.rejectedPatchesAction = patchBaselineNode["RejectedPatchesAction"].asString();
if(!patchBaselineNode["ApprovedPatchesEnableNonSecurity"].isNull())
patchBaseline_.approvedPatchesEnableNonSecurity = patchBaselineNode["ApprovedPatchesEnableNonSecurity"].asString() == "true";
auto allTagsNode = patchBaselineNode["Tags"]["TagsItem"];
for (auto patchBaselineNodeTagsTagsItem : allTagsNode)
{
PatchBaseline::TagsItem tagsItemObject;
if(!patchBaselineNodeTagsTagsItem["TagKey"].isNull())
tagsItemObject.tagKey = patchBaselineNodeTagsTagsItem["TagKey"].asString();
if(!patchBaselineNodeTagsTagsItem["TagValue"].isNull())
tagsItemObject.tagValue = patchBaselineNodeTagsTagsItem["TagValue"].asString();
patchBaseline_.tags.push_back(tagsItemObject);
}
auto allRejectedPatches = patchBaselineNode["RejectedPatches"]["RejectedPatches"];
for (auto value : allRejectedPatches)
patchBaseline_.rejectedPatches.push_back(value.asString());
auto allApprovedPatches = patchBaselineNode["ApprovedPatches"]["ApprovedPatches"];
for (auto value : allApprovedPatches)
patchBaseline_.approvedPatches.push_back(value.asString());
auto allSources = patchBaselineNode["Sources"]["Sources"];
for (auto value : allSources)
patchBaseline_.sources.push_back(value.asString());
}

View File

@@ -52,6 +52,8 @@ void GetApplicationResult::parse(const std::string &payload)
application_.name = applicationNode["Name"].asString();
if(!applicationNode["CreateDate"].isNull())
application_.createDate = applicationNode["CreateDate"].asString();
if(!applicationNode["ApplicationType"].isNull())
application_.applicationType = applicationNode["ApplicationType"].asString();
}

View File

@@ -64,9 +64,27 @@ void GetPatchBaselineResult::parse(const std::string &payload)
patchBaseline_.shareType = patchBaselineNode["ShareType"].asString();
if(!patchBaselineNode["RejectedPatchesAction"].isNull())
patchBaseline_.rejectedPatchesAction = patchBaselineNode["RejectedPatchesAction"].asString();
if(!patchBaselineNode["ApprovedPatchesEnableNonSecurity"].isNull())
patchBaseline_.approvedPatchesEnableNonSecurity = patchBaselineNode["ApprovedPatchesEnableNonSecurity"].asString() == "true";
auto allTagsNode = patchBaselineNode["Tags"]["TagsItem"];
for (auto patchBaselineNodeTagsTagsItem : allTagsNode)
{
PatchBaseline::TagsItem tagsItemObject;
if(!patchBaselineNodeTagsTagsItem["TagKey"].isNull())
tagsItemObject.tagKey = patchBaselineNodeTagsTagsItem["TagKey"].asString();
if(!patchBaselineNodeTagsTagsItem["TagValue"].isNull())
tagsItemObject.tagValue = patchBaselineNodeTagsTagsItem["TagValue"].asString();
patchBaseline_.tags.push_back(tagsItemObject);
}
auto allRejectedPatches = patchBaselineNode["RejectedPatches"]["RejectedPatches"];
for (auto value : allRejectedPatches)
patchBaseline_.rejectedPatches.push_back(value.asString());
auto allApprovedPatches = patchBaselineNode["ApprovedPatches"]["ApprovedPatches"];
for (auto value : allApprovedPatches)
patchBaseline_.approvedPatches.push_back(value.asString());
auto allSources = patchBaselineNode["Sources"]["Sources"];
for (auto value : allSources)
patchBaseline_.sources.push_back(value.asString());
}

View File

@@ -25,13 +25,15 @@ ListPatchBaselinesRequest::ListPatchBaselinesRequest()
ListPatchBaselinesRequest::~ListPatchBaselinesRequest() {}
std::string ListPatchBaselinesRequest::getOperationSystem() const {
return operationSystem_;
std::vector<ListPatchBaselinesRequest::std::string> ListPatchBaselinesRequest::getSources() const {
return sources_;
}
void ListPatchBaselinesRequest::setOperationSystem(const std::string &operationSystem) {
operationSystem_ = operationSystem;
setParameter(std::string("OperationSystem"), operationSystem);
void ListPatchBaselinesRequest::setSources(const std::vector<ListPatchBaselinesRequest::std::string> &sources) {
sources_ = sources;
for(int dep1 = 0; dep1 != sources.size(); dep1++) {
setParameter(std::string("Sources") + "." + std::to_string(dep1 + 1), sources[dep1]);
}
}
std::string ListPatchBaselinesRequest::getRegionId() const {
@@ -52,6 +54,45 @@ void ListPatchBaselinesRequest::setNextToken(const std::string &nextToken) {
setParameter(std::string("NextToken"), nextToken);
}
std::string ListPatchBaselinesRequest::getShareType() const {
return shareType_;
}
void ListPatchBaselinesRequest::setShareType(const std::string &shareType) {
shareType_ = shareType;
setParameter(std::string("ShareType"), shareType);
}
bool ListPatchBaselinesRequest::getApprovedPatchesEnableNonSecurity() const {
return approvedPatchesEnableNonSecurity_;
}
void ListPatchBaselinesRequest::setApprovedPatchesEnableNonSecurity(bool approvedPatchesEnableNonSecurity) {
approvedPatchesEnableNonSecurity_ = approvedPatchesEnableNonSecurity;
setParameter(std::string("ApprovedPatchesEnableNonSecurity"), approvedPatchesEnableNonSecurity ? "true" : "false");
}
std::vector<ListPatchBaselinesRequest::Tags> ListPatchBaselinesRequest::getTags() const {
return tags_;
}
void ListPatchBaselinesRequest::setTags(const std::vector<ListPatchBaselinesRequest::Tags> &tags) {
tags_ = tags;
for(int dep1 = 0; dep1 != tags.size(); dep1++) {
setParameter(std::string("Tags") + "." + std::to_string(dep1 + 1) + ".Value", tags[dep1].value);
setParameter(std::string("Tags") + "." + std::to_string(dep1 + 1) + ".Key", tags[dep1].key);
}
}
std::string ListPatchBaselinesRequest::getOperationSystem() const {
return operationSystem_;
}
void ListPatchBaselinesRequest::setOperationSystem(const std::string &operationSystem) {
operationSystem_ = operationSystem;
setParameter(std::string("OperationSystem"), operationSystem);
}
std::string ListPatchBaselinesRequest::getName() const {
return name_;
}
@@ -70,12 +111,14 @@ void ListPatchBaselinesRequest::setMaxResults(int maxResults) {
setParameter(std::string("MaxResults"), std::to_string(maxResults));
}
std::string ListPatchBaselinesRequest::getShareType() const {
return shareType_;
std::vector<ListPatchBaselinesRequest::std::string> ListPatchBaselinesRequest::getApprovedPatches() const {
return approvedPatches_;
}
void ListPatchBaselinesRequest::setShareType(const std::string &shareType) {
shareType_ = shareType;
setParameter(std::string("ShareType"), shareType);
void ListPatchBaselinesRequest::setApprovedPatches(const std::vector<ListPatchBaselinesRequest::std::string> &approvedPatches) {
approvedPatches_ = approvedPatches;
for(int dep1 = 0; dep1 != approvedPatches.size(); dep1++) {
setParameter(std::string("ApprovedPatches") + "." + std::to_string(dep1 + 1), approvedPatches[dep1]);
}
}

View File

@@ -63,6 +63,24 @@ void ListPatchBaselinesResult::parse(const std::string &payload)
patchBaselinesObject.id = valuePatchBaselinesPatchBaseline["Id"].asString();
if(!valuePatchBaselinesPatchBaseline["ShareType"].isNull())
patchBaselinesObject.shareType = valuePatchBaselinesPatchBaseline["ShareType"].asString();
if(!valuePatchBaselinesPatchBaseline["ApprovedPatchesEnableNonSecurity"].isNull())
patchBaselinesObject.approvedPatchesEnableNonSecurity = valuePatchBaselinesPatchBaseline["ApprovedPatchesEnableNonSecurity"].asString() == "true";
auto allTagsNode = valuePatchBaselinesPatchBaseline["Tags"]["TagsItem"];
for (auto valuePatchBaselinesPatchBaselineTagsTagsItem : allTagsNode)
{
PatchBaseline::TagsItem tagsObject;
if(!valuePatchBaselinesPatchBaselineTagsTagsItem["TagKey"].isNull())
tagsObject.tagKey = valuePatchBaselinesPatchBaselineTagsTagsItem["TagKey"].asString();
if(!valuePatchBaselinesPatchBaselineTagsTagsItem["TagValue"].isNull())
tagsObject.tagValue = valuePatchBaselinesPatchBaselineTagsTagsItem["TagValue"].asString();
patchBaselinesObject.tags.push_back(tagsObject);
}
auto allApprovedPatches = value["ApprovedPatches"]["ApprovedPatches"];
for (auto value : allApprovedPatches)
patchBaselinesObject.approvedPatches.push_back(value.asString());
auto allSources = value["Sources"]["Sources"];
for (auto value : allSources)
patchBaselinesObject.sources.push_back(value.asString());
patchBaselines_.push_back(patchBaselinesObject);
}
if(!value["NextToken"].isNull())

View File

@@ -25,6 +25,17 @@ UpdatePatchBaselineRequest::UpdatePatchBaselineRequest()
UpdatePatchBaselineRequest::~UpdatePatchBaselineRequest() {}
std::vector<UpdatePatchBaselineRequest::std::string> UpdatePatchBaselineRequest::getSources() const {
return sources_;
}
void UpdatePatchBaselineRequest::setSources(const std::vector<UpdatePatchBaselineRequest::std::string> &sources) {
sources_ = sources;
for(int dep1 = 0; dep1 != sources.size(); dep1++) {
setParameter(std::string("Sources") + "." + std::to_string(dep1 + 1), sources[dep1]);
}
}
std::string UpdatePatchBaselineRequest::getClientToken() const {
return clientToken_;
}
@@ -52,17 +63,6 @@ void UpdatePatchBaselineRequest::setDescription(const std::string &description)
setParameter(std::string("Description"), description);
}
std::vector<UpdatePatchBaselineRequest::std::string> UpdatePatchBaselineRequest::getRejectedPatches() const {
return rejectedPatches_;
}
void UpdatePatchBaselineRequest::setRejectedPatches(const std::vector<UpdatePatchBaselineRequest::std::string> &rejectedPatches) {
rejectedPatches_ = rejectedPatches;
for(int dep1 = 0; dep1 != rejectedPatches.size(); dep1++) {
setParameter(std::string("RejectedPatches") + "." + std::to_string(dep1 + 1), rejectedPatches[dep1]);
}
}
std::string UpdatePatchBaselineRequest::getRegionId() const {
return regionId_;
}
@@ -81,6 +81,38 @@ void UpdatePatchBaselineRequest::setRejectedPatchesAction(const std::string &rej
setParameter(std::string("RejectedPatchesAction"), rejectedPatchesAction);
}
bool UpdatePatchBaselineRequest::getApprovedPatchesEnableNonSecurity() const {
return approvedPatchesEnableNonSecurity_;
}
void UpdatePatchBaselineRequest::setApprovedPatchesEnableNonSecurity(bool approvedPatchesEnableNonSecurity) {
approvedPatchesEnableNonSecurity_ = approvedPatchesEnableNonSecurity;
setParameter(std::string("ApprovedPatchesEnableNonSecurity"), approvedPatchesEnableNonSecurity ? "true" : "false");
}
std::vector<UpdatePatchBaselineRequest::Tags> UpdatePatchBaselineRequest::getTags() const {
return tags_;
}
void UpdatePatchBaselineRequest::setTags(const std::vector<UpdatePatchBaselineRequest::Tags> &tags) {
tags_ = tags;
for(int dep1 = 0; dep1 != tags.size(); dep1++) {
setParameter(std::string("Tags") + "." + std::to_string(dep1 + 1) + ".Value", tags[dep1].value);
setParameter(std::string("Tags") + "." + std::to_string(dep1 + 1) + ".Key", tags[dep1].key);
}
}
std::vector<UpdatePatchBaselineRequest::std::string> UpdatePatchBaselineRequest::getRejectedPatches() const {
return rejectedPatches_;
}
void UpdatePatchBaselineRequest::setRejectedPatches(const std::vector<UpdatePatchBaselineRequest::std::string> &rejectedPatches) {
rejectedPatches_ = rejectedPatches;
for(int dep1 = 0; dep1 != rejectedPatches.size(); dep1++) {
setParameter(std::string("RejectedPatches") + "." + std::to_string(dep1 + 1), rejectedPatches[dep1]);
}
}
std::string UpdatePatchBaselineRequest::getName() const {
return name_;
}
@@ -90,3 +122,14 @@ void UpdatePatchBaselineRequest::setName(const std::string &name) {
setParameter(std::string("Name"), name);
}
std::vector<UpdatePatchBaselineRequest::std::string> UpdatePatchBaselineRequest::getApprovedPatches() const {
return approvedPatches_;
}
void UpdatePatchBaselineRequest::setApprovedPatches(const std::vector<UpdatePatchBaselineRequest::std::string> &approvedPatches) {
approvedPatches_ = approvedPatches;
for(int dep1 = 0; dep1 != approvedPatches.size(); dep1++) {
setParameter(std::string("ApprovedPatches") + "." + std::to_string(dep1 + 1), approvedPatches[dep1]);
}
}

View File

@@ -62,9 +62,27 @@ void UpdatePatchBaselineResult::parse(const std::string &payload)
patchBaseline_.shareType = patchBaselineNode["ShareType"].asString();
if(!patchBaselineNode["RejectedPatchesAction"].isNull())
patchBaseline_.rejectedPatchesAction = patchBaselineNode["RejectedPatchesAction"].asString();
if(!patchBaselineNode["ApprovedPatchesEnableNonSecurity"].isNull())
patchBaseline_.approvedPatchesEnableNonSecurity = patchBaselineNode["ApprovedPatchesEnableNonSecurity"].asString() == "true";
auto allTagsNode = patchBaselineNode["Tags"]["TagsItem"];
for (auto patchBaselineNodeTagsTagsItem : allTagsNode)
{
PatchBaseline::TagsItem tagsItemObject;
if(!patchBaselineNodeTagsTagsItem["TagKey"].isNull())
tagsItemObject.tagKey = patchBaselineNodeTagsTagsItem["TagKey"].asString();
if(!patchBaselineNodeTagsTagsItem["TagValue"].isNull())
tagsItemObject.tagValue = patchBaselineNodeTagsTagsItem["TagValue"].asString();
patchBaseline_.tags.push_back(tagsItemObject);
}
auto allRejectedPatches = patchBaselineNode["RejectedPatches"]["RejectedPatches"];
for (auto value : allRejectedPatches)
patchBaseline_.rejectedPatches.push_back(value.asString());
auto allApprovedPatches = patchBaselineNode["ApprovedPatches"]["ApprovedPatches"];
for (auto value : allApprovedPatches)
patchBaseline_.approvedPatches.push_back(value.asString());
auto allSources = patchBaselineNode["Sources"]["Sources"];
for (auto value : allSources)
patchBaseline_.sources.push_back(value.asString());
}