AddGatewayRouteRequest.cc 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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/mse/model/AddGatewayRouteRequest.h>
  17. using AlibabaCloud::Mse::Model::AddGatewayRouteRequest;
  18. AddGatewayRouteRequest::AddGatewayRouteRequest()
  19. : RpcServiceRequest("mse", "2019-05-31", "AddGatewayRoute") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. AddGatewayRouteRequest::~AddGatewayRouteRequest() {}
  23. std::string AddGatewayRouteRequest::getGatewayUniqueId() const {
  24. return gatewayUniqueId_;
  25. }
  26. void AddGatewayRouteRequest::setGatewayUniqueId(const std::string &gatewayUniqueId) {
  27. gatewayUniqueId_ = gatewayUniqueId;
  28. setParameter(std::string("GatewayUniqueId"), gatewayUniqueId);
  29. }
  30. std::string AddGatewayRouteRequest::getDestinationType() const {
  31. return destinationType_;
  32. }
  33. void AddGatewayRouteRequest::setDestinationType(const std::string &destinationType) {
  34. destinationType_ = destinationType;
  35. setParameter(std::string("DestinationType"), destinationType);
  36. }
  37. std::string AddGatewayRouteRequest::getDomainIdListJSON() const {
  38. return domainIdListJSON_;
  39. }
  40. void AddGatewayRouteRequest::setDomainIdListJSON(const std::string &domainIdListJSON) {
  41. domainIdListJSON_ = domainIdListJSON;
  42. setParameter(std::string("DomainIdListJSON"), domainIdListJSON);
  43. }
  44. long AddGatewayRouteRequest::getDomainId() const {
  45. return domainId_;
  46. }
  47. void AddGatewayRouteRequest::setDomainId(long domainId) {
  48. domainId_ = domainId;
  49. setParameter(std::string("DomainId"), std::to_string(domainId));
  50. }
  51. long AddGatewayRouteRequest::getGatewayId() const {
  52. return gatewayId_;
  53. }
  54. void AddGatewayRouteRequest::setGatewayId(long gatewayId) {
  55. gatewayId_ = gatewayId;
  56. setParameter(std::string("GatewayId"), std::to_string(gatewayId));
  57. }
  58. int AddGatewayRouteRequest::getRouteOrder() const {
  59. return routeOrder_;
  60. }
  61. void AddGatewayRouteRequest::setRouteOrder(int routeOrder) {
  62. routeOrder_ = routeOrder;
  63. setParameter(std::string("RouteOrder"), std::to_string(routeOrder));
  64. }
  65. std::vector<AddGatewayRouteRequest::Services> AddGatewayRouteRequest::getServices() const {
  66. return services_;
  67. }
  68. void AddGatewayRouteRequest::setServices(const std::vector<AddGatewayRouteRequest::Services> &services) {
  69. services_ = services;
  70. for(int dep1 = 0; dep1 != services.size(); dep1++) {
  71. setParameter(std::string("Services") + "." + std::to_string(dep1 + 1) + ".Name", services[dep1].name);
  72. setParameter(std::string("Services") + "." + std::to_string(dep1 + 1) + ".Namespace", services[dep1]._namespace);
  73. setParameter(std::string("Services") + "." + std::to_string(dep1 + 1) + ".SourceType", services[dep1].sourceType);
  74. setParameter(std::string("Services") + "." + std::to_string(dep1 + 1) + ".ServiceId", std::to_string(services[dep1].serviceId));
  75. setParameter(std::string("Services") + "." + std::to_string(dep1 + 1) + ".Percent", std::to_string(services[dep1].percent));
  76. setParameter(std::string("Services") + "." + std::to_string(dep1 + 1) + ".Version", services[dep1].version);
  77. setParameter(std::string("Services") + "." + std::to_string(dep1 + 1) + ".GroupName", services[dep1].groupName);
  78. }
  79. }
  80. AddGatewayRouteRequest::Predicates AddGatewayRouteRequest::getPredicates() const {
  81. return predicates_;
  82. }
  83. void AddGatewayRouteRequest::setPredicates(const AddGatewayRouteRequest::Predicates &predicates) {
  84. predicates_ = predicates;
  85. setParameter(std::string("Predicates") + ".PathPredicates.Path", predicates.pathPredicates.path);
  86. setParameter(std::string("Predicates") + ".PathPredicates.IgnoreCase", predicates.pathPredicates.ignoreCase ? "true" : "false");
  87. setParameter(std::string("Predicates") + ".PathPredicates.Type", predicates.pathPredicates.type);
  88. for(int dep1 = 0; dep1 != predicates.methodPredicates.size(); dep1++) {
  89. setParameter(std::string("Predicates") + ".MethodPredicates." + std::to_string(dep1 + 1), predicates.methodPredicates[dep1]);
  90. }
  91. for(int dep1 = 0; dep1 != predicates.headerPredicates.size(); dep1++) {
  92. setParameter(std::string("Predicates") + ".HeaderPredicates." + std::to_string(dep1 + 1) + ".Type", predicates.headerPredicates[dep1].type);
  93. setParameter(std::string("Predicates") + ".HeaderPredicates." + std::to_string(dep1 + 1) + ".Value", predicates.headerPredicates[dep1].value);
  94. setParameter(std::string("Predicates") + ".HeaderPredicates." + std::to_string(dep1 + 1) + ".Key", predicates.headerPredicates[dep1].key);
  95. }
  96. for(int dep1 = 0; dep1 != predicates.queryPredicates.size(); dep1++) {
  97. setParameter(std::string("Predicates") + ".QueryPredicates." + std::to_string(dep1 + 1) + ".Type", predicates.queryPredicates[dep1].type);
  98. setParameter(std::string("Predicates") + ".QueryPredicates." + std::to_string(dep1 + 1) + ".Value", predicates.queryPredicates[dep1].value);
  99. setParameter(std::string("Predicates") + ".QueryPredicates." + std::to_string(dep1 + 1) + ".Key", predicates.queryPredicates[dep1].key);
  100. }
  101. }
  102. AddGatewayRouteRequest::RedirectJSON AddGatewayRouteRequest::getRedirectJSON() const {
  103. return redirectJSON_;
  104. }
  105. void AddGatewayRouteRequest::setRedirectJSON(const AddGatewayRouteRequest::RedirectJSON &redirectJSON) {
  106. redirectJSON_ = redirectJSON;
  107. setParameter(std::string("RedirectJSON") + ".Path", redirectJSON.path);
  108. setParameter(std::string("RedirectJSON") + ".Code", std::to_string(redirectJSON.code));
  109. setParameter(std::string("RedirectJSON") + ".Host", redirectJSON.host);
  110. }
  111. AddGatewayRouteRequest::DirectResponseJSON AddGatewayRouteRequest::getDirectResponseJSON() const {
  112. return directResponseJSON_;
  113. }
  114. void AddGatewayRouteRequest::setDirectResponseJSON(const AddGatewayRouteRequest::DirectResponseJSON &directResponseJSON) {
  115. directResponseJSON_ = directResponseJSON;
  116. setParameter(std::string("DirectResponseJSON") + ".Code", std::to_string(directResponseJSON.code));
  117. setParameter(std::string("DirectResponseJSON") + ".Body", directResponseJSON.body);
  118. }
  119. std::string AddGatewayRouteRequest::getName() const {
  120. return name_;
  121. }
  122. void AddGatewayRouteRequest::setName(const std::string &name) {
  123. name_ = name;
  124. setParameter(std::string("Name"), name);
  125. }
  126. std::string AddGatewayRouteRequest::getAcceptLanguage() const {
  127. return acceptLanguage_;
  128. }
  129. void AddGatewayRouteRequest::setAcceptLanguage(const std::string &acceptLanguage) {
  130. acceptLanguage_ = acceptLanguage;
  131. setParameter(std::string("AcceptLanguage"), acceptLanguage);
  132. }