TagResourcesRequest.cc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/cloudapi/model/TagResourcesRequest.h>
  17. using AlibabaCloud::CloudAPI::Model::TagResourcesRequest;
  18. TagResourcesRequest::TagResourcesRequest() :
  19. RpcServiceRequest("cloudapi", "2016-07-14", "TagResources")
  20. {}
  21. TagResourcesRequest::~TagResourcesRequest()
  22. {}
  23. std::vector<std::string> TagResourcesRequest::getResourceId()const
  24. {
  25. return resourceId_;
  26. }
  27. void TagResourcesRequest::setResourceId(const std::vector<std::string>& resourceId)
  28. {
  29. resourceId_ = resourceId;
  30. for(int i = 0; i!= resourceId.size(); i++)
  31. setCoreParameter("ResourceId."+ std::to_string(i), resourceId.at(i));
  32. }
  33. std::string TagResourcesRequest::getResourceType()const
  34. {
  35. return resourceType_;
  36. }
  37. void TagResourcesRequest::setResourceType(const std::string& resourceType)
  38. {
  39. resourceType_ = resourceType;
  40. setCoreParameter("ResourceType", resourceType);
  41. }
  42. std::string TagResourcesRequest::getAccessKeyId()const
  43. {
  44. return accessKeyId_;
  45. }
  46. void TagResourcesRequest::setAccessKeyId(const std::string& accessKeyId)
  47. {
  48. accessKeyId_ = accessKeyId;
  49. setCoreParameter("AccessKeyId", accessKeyId);
  50. }
  51. std::string TagResourcesRequest::getSecurityToken()const
  52. {
  53. return securityToken_;
  54. }
  55. void TagResourcesRequest::setSecurityToken(const std::string& securityToken)
  56. {
  57. securityToken_ = securityToken;
  58. setCoreParameter("SecurityToken", securityToken);
  59. }
  60. std::vector<TagResourcesRequest::Tag> TagResourcesRequest::getTag()const
  61. {
  62. return tag_;
  63. }
  64. void TagResourcesRequest::setTag(const std::vector<Tag>& tag)
  65. {
  66. tag_ = tag;
  67. int i = 0;
  68. for(int i = 0; i!= tag.size(); i++) {
  69. auto obj = tag.at(i);
  70. std::string str ="Tag."+ std::to_string(i);
  71. setCoreParameter(str + ".Value", obj.value);
  72. setCoreParameter(str + ".Key", obj.key);
  73. }
  74. }