CreateResourcePoolRequest.cc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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/emr/model/CreateResourcePoolRequest.h>
  17. using AlibabaCloud::Emr::Model::CreateResourcePoolRequest;
  18. CreateResourcePoolRequest::CreateResourcePoolRequest() :
  19. RpcServiceRequest("emr", "2016-04-08", "CreateResourcePool")
  20. {
  21. setMethod(HttpRequest::Method::Post);
  22. }
  23. CreateResourcePoolRequest::~CreateResourcePoolRequest()
  24. {}
  25. std::string CreateResourcePoolRequest::getNote()const
  26. {
  27. return note_;
  28. }
  29. void CreateResourcePoolRequest::setNote(const std::string& note)
  30. {
  31. note_ = note;
  32. setParameter("Note", note);
  33. }
  34. long CreateResourcePoolRequest::getResourceOwnerId()const
  35. {
  36. return resourceOwnerId_;
  37. }
  38. void CreateResourcePoolRequest::setResourceOwnerId(long resourceOwnerId)
  39. {
  40. resourceOwnerId_ = resourceOwnerId;
  41. setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
  42. }
  43. bool CreateResourcePoolRequest::getActive()const
  44. {
  45. return active_;
  46. }
  47. void CreateResourcePoolRequest::setActive(bool active)
  48. {
  49. active_ = active;
  50. setParameter("Active", active ? "true" : "false");
  51. }
  52. std::string CreateResourcePoolRequest::getClusterId()const
  53. {
  54. return clusterId_;
  55. }
  56. void CreateResourcePoolRequest::setClusterId(const std::string& clusterId)
  57. {
  58. clusterId_ = clusterId;
  59. setParameter("ClusterId", clusterId);
  60. }
  61. std::string CreateResourcePoolRequest::getYarnSiteConfig()const
  62. {
  63. return yarnSiteConfig_;
  64. }
  65. void CreateResourcePoolRequest::setYarnSiteConfig(const std::string& yarnSiteConfig)
  66. {
  67. yarnSiteConfig_ = yarnSiteConfig;
  68. setParameter("YarnSiteConfig", yarnSiteConfig);
  69. }
  70. std::string CreateResourcePoolRequest::getAccessKeyId()const
  71. {
  72. return accessKeyId_;
  73. }
  74. void CreateResourcePoolRequest::setAccessKeyId(const std::string& accessKeyId)
  75. {
  76. accessKeyId_ = accessKeyId;
  77. setParameter("AccessKeyId", accessKeyId);
  78. }
  79. std::string CreateResourcePoolRequest::getRegionId()const
  80. {
  81. return regionId_;
  82. }
  83. void CreateResourcePoolRequest::setRegionId(const std::string& regionId)
  84. {
  85. regionId_ = regionId;
  86. setParameter("RegionId", regionId);
  87. }
  88. std::string CreateResourcePoolRequest::getName()const
  89. {
  90. return name_;
  91. }
  92. void CreateResourcePoolRequest::setName(const std::string& name)
  93. {
  94. name_ = name;
  95. setParameter("Name", name);
  96. }
  97. std::vector<CreateResourcePoolRequest::Config> CreateResourcePoolRequest::getConfig()const
  98. {
  99. return config_;
  100. }
  101. void CreateResourcePoolRequest::setConfig(const std::vector<Config>& config)
  102. {
  103. config_ = config;
  104. for(int dep1 = 0; dep1!= config.size(); dep1++) {
  105. auto configObj = config.at(dep1);
  106. std::string configObjStr = "Config." + std::to_string(dep1 + 1);
  107. setParameter(configObjStr + ".ConfigKey", configObj.configKey);
  108. setParameter(configObjStr + ".Note", configObj.note);
  109. setParameter(configObjStr + ".ConfigType", configObj.configType);
  110. setParameter(configObjStr + ".TargetId", configObj.targetId);
  111. setParameter(configObjStr + ".ConfigValue", configObj.configValue);
  112. setParameter(configObjStr + ".Category", configObj.category);
  113. }
  114. }
  115. std::string CreateResourcePoolRequest::getPoolType()const
  116. {
  117. return poolType_;
  118. }
  119. void CreateResourcePoolRequest::setPoolType(const std::string& poolType)
  120. {
  121. poolType_ = poolType;
  122. setParameter("PoolType", poolType);
  123. }