DescribeAccessPointsResult.cc 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/ecs/model/DescribeAccessPointsResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Ecs;
  19. using namespace AlibabaCloud::Ecs::Model;
  20. DescribeAccessPointsResult::DescribeAccessPointsResult() :
  21. ServiceResult()
  22. {}
  23. DescribeAccessPointsResult::DescribeAccessPointsResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeAccessPointsResult::~DescribeAccessPointsResult()
  29. {}
  30. void DescribeAccessPointsResult::parse(const std::string &payload)
  31. {
  32. Json::Reader reader;
  33. Json::Value value;
  34. reader.parse(payload, value);
  35. setRequestId(value["RequestId"].asString());
  36. auto allAccessPointSetNode = value["AccessPointSet"]["AccessPointType"];
  37. for (auto valueAccessPointSetAccessPointType : allAccessPointSetNode)
  38. {
  39. AccessPointType accessPointSetObject;
  40. if(!valueAccessPointSetAccessPointType["AccessPointId"].isNull())
  41. accessPointSetObject.accessPointId = valueAccessPointSetAccessPointType["AccessPointId"].asString();
  42. if(!valueAccessPointSetAccessPointType["Status"].isNull())
  43. accessPointSetObject.status = valueAccessPointSetAccessPointType["Status"].asString();
  44. if(!valueAccessPointSetAccessPointType["Type"].isNull())
  45. accessPointSetObject.type = valueAccessPointSetAccessPointType["Type"].asString();
  46. if(!valueAccessPointSetAccessPointType["AttachedRegionNo"].isNull())
  47. accessPointSetObject.attachedRegionNo = valueAccessPointSetAccessPointType["AttachedRegionNo"].asString();
  48. if(!valueAccessPointSetAccessPointType["Location"].isNull())
  49. accessPointSetObject.location = valueAccessPointSetAccessPointType["Location"].asString();
  50. if(!valueAccessPointSetAccessPointType["HostOperator"].isNull())
  51. accessPointSetObject.hostOperator = valueAccessPointSetAccessPointType["HostOperator"].asString();
  52. if(!valueAccessPointSetAccessPointType["Name"].isNull())
  53. accessPointSetObject.name = valueAccessPointSetAccessPointType["Name"].asString();
  54. if(!valueAccessPointSetAccessPointType["Description"].isNull())
  55. accessPointSetObject.description = valueAccessPointSetAccessPointType["Description"].asString();
  56. accessPointSet_.push_back(accessPointSetObject);
  57. }
  58. if(!value["PageNumber"].isNull())
  59. pageNumber_ = std::stoi(value["PageNumber"].asString());
  60. if(!value["PageSize"].isNull())
  61. pageSize_ = std::stoi(value["PageSize"].asString());
  62. if(!value["TotalCount"].isNull())
  63. totalCount_ = std::stoi(value["TotalCount"].asString());
  64. }
  65. std::vector<DescribeAccessPointsResult::AccessPointType> DescribeAccessPointsResult::getAccessPointSet()const
  66. {
  67. return accessPointSet_;
  68. }
  69. int DescribeAccessPointsResult::getTotalCount()const
  70. {
  71. return totalCount_;
  72. }
  73. int DescribeAccessPointsResult::getPageSize()const
  74. {
  75. return pageSize_;
  76. }
  77. int DescribeAccessPointsResult::getPageNumber()const
  78. {
  79. return pageNumber_;
  80. }