ModifyServiceRequest.cc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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/retailcloud/model/ModifyServiceRequest.h>
  17. using AlibabaCloud::Retailcloud::Model::ModifyServiceRequest;
  18. ModifyServiceRequest::ModifyServiceRequest() :
  19. RpcServiceRequest("retailcloud", "2018-03-13", "ModifyService")
  20. {
  21. setMethod(HttpRequest::Method::Post);
  22. }
  23. ModifyServiceRequest::~ModifyServiceRequest()
  24. {}
  25. std::string ModifyServiceRequest::getName()const
  26. {
  27. return name_;
  28. }
  29. void ModifyServiceRequest::setName(const std::string& name)
  30. {
  31. name_ = name;
  32. setParameter("Name", name);
  33. }
  34. std::vector<ModifyServiceRequest::PortMappings> ModifyServiceRequest::getPortMappings()const
  35. {
  36. return portMappings_;
  37. }
  38. void ModifyServiceRequest::setPortMappings(const std::vector<PortMappings>& portMappings)
  39. {
  40. portMappings_ = portMappings;
  41. for(int dep1 = 0; dep1!= portMappings.size(); dep1++) {
  42. auto portMappingsObj = portMappings.at(dep1);
  43. std::string portMappingsObjStr = "PortMappings." + std::to_string(dep1 + 1);
  44. setParameter(portMappingsObjStr + ".Protocol", portMappingsObj.protocol);
  45. setParameter(portMappingsObjStr + ".Port", std::to_string(portMappingsObj.port));
  46. setParameter(portMappingsObjStr + ".Name", portMappingsObj.name);
  47. setParameter(portMappingsObjStr + ".NodePort", std::to_string(portMappingsObj.nodePort));
  48. setParameter(portMappingsObjStr + ".TargetPort", portMappingsObj.targetPort);
  49. }
  50. }
  51. long ModifyServiceRequest::getServiceId()const
  52. {
  53. return serviceId_;
  54. }
  55. void ModifyServiceRequest::setServiceId(long serviceId)
  56. {
  57. serviceId_ = serviceId;
  58. setParameter("ServiceId", std::to_string(serviceId));
  59. }