CreateTrafficMarkingPolicyRequest.cc 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/cbn/model/CreateTrafficMarkingPolicyRequest.h>
  17. using AlibabaCloud::Cbn::Model::CreateTrafficMarkingPolicyRequest;
  18. CreateTrafficMarkingPolicyRequest::CreateTrafficMarkingPolicyRequest() :
  19. RpcServiceRequest("cbn", "2017-09-12", "CreateTrafficMarkingPolicy")
  20. {
  21. setMethod(HttpRequest::Method::Post);
  22. }
  23. CreateTrafficMarkingPolicyRequest::~CreateTrafficMarkingPolicyRequest()
  24. {}
  25. long CreateTrafficMarkingPolicyRequest::getResourceOwnerId()const
  26. {
  27. return resourceOwnerId_;
  28. }
  29. void CreateTrafficMarkingPolicyRequest::setResourceOwnerId(long resourceOwnerId)
  30. {
  31. resourceOwnerId_ = resourceOwnerId;
  32. setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
  33. }
  34. std::string CreateTrafficMarkingPolicyRequest::getClientToken()const
  35. {
  36. return clientToken_;
  37. }
  38. void CreateTrafficMarkingPolicyRequest::setClientToken(const std::string& clientToken)
  39. {
  40. clientToken_ = clientToken;
  41. setParameter("ClientToken", clientToken);
  42. }
  43. std::string CreateTrafficMarkingPolicyRequest::getTrafficMarkingPolicyDescription()const
  44. {
  45. return trafficMarkingPolicyDescription_;
  46. }
  47. void CreateTrafficMarkingPolicyRequest::setTrafficMarkingPolicyDescription(const std::string& trafficMarkingPolicyDescription)
  48. {
  49. trafficMarkingPolicyDescription_ = trafficMarkingPolicyDescription;
  50. setParameter("TrafficMarkingPolicyDescription", trafficMarkingPolicyDescription);
  51. }
  52. std::string CreateTrafficMarkingPolicyRequest::getTrafficMarkingPolicyName()const
  53. {
  54. return trafficMarkingPolicyName_;
  55. }
  56. void CreateTrafficMarkingPolicyRequest::setTrafficMarkingPolicyName(const std::string& trafficMarkingPolicyName)
  57. {
  58. trafficMarkingPolicyName_ = trafficMarkingPolicyName;
  59. setParameter("TrafficMarkingPolicyName", trafficMarkingPolicyName);
  60. }
  61. bool CreateTrafficMarkingPolicyRequest::getDryRun()const
  62. {
  63. return dryRun_;
  64. }
  65. void CreateTrafficMarkingPolicyRequest::setDryRun(bool dryRun)
  66. {
  67. dryRun_ = dryRun;
  68. setParameter("DryRun", dryRun ? "true" : "false");
  69. }
  70. std::vector<CreateTrafficMarkingPolicyRequest::TrafficMatchRules> CreateTrafficMarkingPolicyRequest::getTrafficMatchRules()const
  71. {
  72. return trafficMatchRules_;
  73. }
  74. void CreateTrafficMarkingPolicyRequest::setTrafficMatchRules(const std::vector<TrafficMatchRules>& trafficMatchRules)
  75. {
  76. trafficMatchRules_ = trafficMatchRules;
  77. for(int dep1 = 0; dep1!= trafficMatchRules.size(); dep1++) {
  78. auto trafficMatchRulesObj = trafficMatchRules.at(dep1);
  79. std::string trafficMatchRulesObjStr = "TrafficMatchRules." + std::to_string(dep1 + 1);
  80. for(int dep2 = 0; dep2!= trafficMatchRulesObj.dstPortRange.size(); dep2++) {
  81. setParameter(trafficMatchRulesObjStr + ".DstPortRange."+ std::to_string(dep2), std::to_string(trafficMatchRulesObj.dstPortRange.at(dep2)));
  82. }
  83. setParameter(trafficMatchRulesObjStr + ".MatchDscp", std::to_string(trafficMatchRulesObj.matchDscp));
  84. setParameter(trafficMatchRulesObjStr + ".Protocol", trafficMatchRulesObj.protocol);
  85. setParameter(trafficMatchRulesObjStr + ".TrafficMatchRuleDescription", trafficMatchRulesObj.trafficMatchRuleDescription);
  86. for(int dep2 = 0; dep2!= trafficMatchRulesObj.srcPortRange.size(); dep2++) {
  87. setParameter(trafficMatchRulesObjStr + ".SrcPortRange."+ std::to_string(dep2), std::to_string(trafficMatchRulesObj.srcPortRange.at(dep2)));
  88. }
  89. setParameter(trafficMatchRulesObjStr + ".DstCidr", trafficMatchRulesObj.dstCidr);
  90. setParameter(trafficMatchRulesObjStr + ".TrafficMatchRuleName", trafficMatchRulesObj.trafficMatchRuleName);
  91. setParameter(trafficMatchRulesObjStr + ".SrcCidr", trafficMatchRulesObj.srcCidr);
  92. }
  93. }
  94. std::string CreateTrafficMarkingPolicyRequest::getResourceOwnerAccount()const
  95. {
  96. return resourceOwnerAccount_;
  97. }
  98. void CreateTrafficMarkingPolicyRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
  99. {
  100. resourceOwnerAccount_ = resourceOwnerAccount;
  101. setParameter("ResourceOwnerAccount", resourceOwnerAccount);
  102. }
  103. std::string CreateTrafficMarkingPolicyRequest::getOwnerAccount()const
  104. {
  105. return ownerAccount_;
  106. }
  107. void CreateTrafficMarkingPolicyRequest::setOwnerAccount(const std::string& ownerAccount)
  108. {
  109. ownerAccount_ = ownerAccount;
  110. setParameter("OwnerAccount", ownerAccount);
  111. }
  112. long CreateTrafficMarkingPolicyRequest::getOwnerId()const
  113. {
  114. return ownerId_;
  115. }
  116. void CreateTrafficMarkingPolicyRequest::setOwnerId(long ownerId)
  117. {
  118. ownerId_ = ownerId;
  119. setParameter("OwnerId", std::to_string(ownerId));
  120. }
  121. std::string CreateTrafficMarkingPolicyRequest::getTransitRouterId()const
  122. {
  123. return transitRouterId_;
  124. }
  125. void CreateTrafficMarkingPolicyRequest::setTransitRouterId(const std::string& transitRouterId)
  126. {
  127. transitRouterId_ = transitRouterId;
  128. setParameter("TransitRouterId", transitRouterId);
  129. }
  130. int CreateTrafficMarkingPolicyRequest::getPriority()const
  131. {
  132. return priority_;
  133. }
  134. void CreateTrafficMarkingPolicyRequest::setPriority(int priority)
  135. {
  136. priority_ = priority;
  137. setParameter("Priority", std::to_string(priority));
  138. }
  139. int CreateTrafficMarkingPolicyRequest::getMarkingDscp()const
  140. {
  141. return markingDscp_;
  142. }
  143. void CreateTrafficMarkingPolicyRequest::setMarkingDscp(int markingDscp)
  144. {
  145. markingDscp_ = markingDscp;
  146. setParameter("MarkingDscp", std::to_string(markingDscp));
  147. }