AddServersToServerGroupRequest.cc 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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/gwlb/model/AddServersToServerGroupRequest.h>
  17. using AlibabaCloud::Gwlb::Model::AddServersToServerGroupRequest;
  18. AddServersToServerGroupRequest::AddServersToServerGroupRequest()
  19. : RpcServiceRequest("gwlb", "2024-04-15", "AddServersToServerGroup") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. AddServersToServerGroupRequest::~AddServersToServerGroupRequest() {}
  23. std::string AddServersToServerGroupRequest::getClientToken() const {
  24. return clientToken_;
  25. }
  26. void AddServersToServerGroupRequest::setClientToken(const std::string &clientToken) {
  27. clientToken_ = clientToken;
  28. setBodyParameter(std::string("ClientToken"), clientToken);
  29. }
  30. std::string AddServersToServerGroupRequest::getServerGroupId() const {
  31. return serverGroupId_;
  32. }
  33. void AddServersToServerGroupRequest::setServerGroupId(const std::string &serverGroupId) {
  34. serverGroupId_ = serverGroupId;
  35. setBodyParameter(std::string("ServerGroupId"), serverGroupId);
  36. }
  37. std::vector<AddServersToServerGroupRequest::Servers> AddServersToServerGroupRequest::getServers() const {
  38. return servers_;
  39. }
  40. void AddServersToServerGroupRequest::setServers(const std::vector<AddServersToServerGroupRequest::Servers> &servers) {
  41. servers_ = servers;
  42. for(int dep1 = 0; dep1 != servers.size(); dep1++) {
  43. setBodyParameter(std::string("Servers") + "." + std::to_string(dep1 + 1) + ".Port", std::to_string(servers[dep1].port));
  44. setBodyParameter(std::string("Servers") + "." + std::to_string(dep1 + 1) + ".ServerId", servers[dep1].serverId);
  45. setBodyParameter(std::string("Servers") + "." + std::to_string(dep1 + 1) + ".ServerIp", servers[dep1].serverIp);
  46. setBodyParameter(std::string("Servers") + "." + std::to_string(dep1 + 1) + ".ServerType", servers[dep1].serverType);
  47. }
  48. }
  49. bool AddServersToServerGroupRequest::getDryRun() const {
  50. return dryRun_;
  51. }
  52. void AddServersToServerGroupRequest::setDryRun(bool dryRun) {
  53. dryRun_ = dryRun;
  54. setBodyParameter(std::string("DryRun"), dryRun ? "true" : "false");
  55. }