BatchEnrollAccountsRequest.cc 2.8 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/governance/model/BatchEnrollAccountsRequest.h>
  17. using AlibabaCloud::Governance::Model::BatchEnrollAccountsRequest;
  18. BatchEnrollAccountsRequest::BatchEnrollAccountsRequest()
  19. : RpcServiceRequest("governance", "2021-01-20", "BatchEnrollAccounts") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. BatchEnrollAccountsRequest::~BatchEnrollAccountsRequest() {}
  23. std::string BatchEnrollAccountsRequest::getRegionId() const {
  24. return regionId_;
  25. }
  26. void BatchEnrollAccountsRequest::setRegionId(const std::string &regionId) {
  27. regionId_ = regionId;
  28. setParameter(std::string("RegionId"), regionId);
  29. }
  30. std::string BatchEnrollAccountsRequest::getBaselineId() const {
  31. return baselineId_;
  32. }
  33. void BatchEnrollAccountsRequest::setBaselineId(const std::string &baselineId) {
  34. baselineId_ = baselineId;
  35. setParameter(std::string("BaselineId"), baselineId);
  36. }
  37. std::vector<BatchEnrollAccountsRequest::BaselineItems> BatchEnrollAccountsRequest::getBaselineItems() const {
  38. return baselineItems_;
  39. }
  40. void BatchEnrollAccountsRequest::setBaselineItems(const std::vector<BatchEnrollAccountsRequest::BaselineItems> &baselineItems) {
  41. baselineItems_ = baselineItems;
  42. for(int dep1 = 0; dep1 != baselineItems.size(); dep1++) {
  43. setParameter(std::string("BaselineItems") + "." + std::to_string(dep1 + 1) + ".Name", baselineItems[dep1].name);
  44. setParameter(std::string("BaselineItems") + "." + std::to_string(dep1 + 1) + ".Skip", baselineItems[dep1].skip ? "true" : "false");
  45. setParameter(std::string("BaselineItems") + "." + std::to_string(dep1 + 1) + ".Config", baselineItems[dep1].config);
  46. setParameter(std::string("BaselineItems") + "." + std::to_string(dep1 + 1) + ".Version", baselineItems[dep1].version);
  47. }
  48. }
  49. std::vector<BatchEnrollAccountsRequest::Accounts> BatchEnrollAccountsRequest::getAccounts() const {
  50. return accounts_;
  51. }
  52. void BatchEnrollAccountsRequest::setAccounts(const std::vector<BatchEnrollAccountsRequest::Accounts> &accounts) {
  53. accounts_ = accounts;
  54. for(int dep1 = 0; dep1 != accounts.size(); dep1++) {
  55. setParameter(std::string("Accounts") + "." + std::to_string(dep1 + 1) + ".AccountUid", std::to_string(accounts[dep1].accountUid));
  56. }
  57. }