AssociateResourceShareRequest.cc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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/resourcesharing/model/AssociateResourceShareRequest.h>
  17. using AlibabaCloud::ResourceSharing::Model::AssociateResourceShareRequest;
  18. AssociateResourceShareRequest::AssociateResourceShareRequest()
  19. : RpcServiceRequest("resourcesharing", "2020-01-10", "AssociateResourceShare") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. AssociateResourceShareRequest::~AssociateResourceShareRequest() {}
  23. std::vector<AssociateResourceShareRequest::Resources> AssociateResourceShareRequest::getResources() const {
  24. return resources_;
  25. }
  26. void AssociateResourceShareRequest::setResources(const std::vector<AssociateResourceShareRequest::Resources> &resources) {
  27. resources_ = resources;
  28. for(int dep1 = 0; dep1 != resources.size(); dep1++) {
  29. auto resourcesObj = resources.at(dep1);
  30. std::string resourcesObjStr = std::string("Resources") + "." + std::to_string(dep1 + 1);
  31. setParameter(resourcesObjStr + ".ResourceId", resourcesObj.resourceId);
  32. setParameter(resourcesObjStr + ".ResourceType", resourcesObj.resourceType);
  33. }
  34. }
  35. std::vector<std::string> AssociateResourceShareRequest::getTargets() const {
  36. return targets_;
  37. }
  38. void AssociateResourceShareRequest::setTargets(const std::vector<std::string> &targets) {
  39. targets_ = targets;
  40. }
  41. std::string AssociateResourceShareRequest::getResourceShareId() const {
  42. return resourceShareId_;
  43. }
  44. void AssociateResourceShareRequest::setResourceShareId(const std::string &resourceShareId) {
  45. resourceShareId_ = resourceShareId;
  46. setParameter(std::string("ResourceShareId"), resourceShareId);
  47. }
  48. std::vector<std::string> AssociateResourceShareRequest::getPermissionNames() const {
  49. return permissionNames_;
  50. }
  51. void AssociateResourceShareRequest::setPermissionNames(const std::vector<std::string> &permissionNames) {
  52. permissionNames_ = permissionNames;
  53. }
  54. std::vector<AssociateResourceShareRequest::TargetProperties> AssociateResourceShareRequest::getTargetProperties() const {
  55. return targetProperties_;
  56. }
  57. void AssociateResourceShareRequest::setTargetProperties(const std::vector<AssociateResourceShareRequest::TargetProperties> &targetProperties) {
  58. targetProperties_ = targetProperties;
  59. for(int dep1 = 0; dep1 != targetProperties.size(); dep1++) {
  60. setParameter(std::string("TargetProperties") + "." + std::to_string(dep1 + 1) + ".TargetId", targetProperties[dep1].targetId);
  61. setParameter(std::string("TargetProperties") + "." + std::to_string(dep1 + 1) + ".Property", targetProperties[dep1].property);
  62. }
  63. }