DescribeSignedEventActionsResult.cc 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/rds/model/DescribeSignedEventActionsResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Rds;
  19. using namespace AlibabaCloud::Rds::Model;
  20. DescribeSignedEventActionsResult::DescribeSignedEventActionsResult() :
  21. ServiceResult()
  22. {}
  23. DescribeSignedEventActionsResult::DescribeSignedEventActionsResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeSignedEventActionsResult::~DescribeSignedEventActionsResult()
  29. {}
  30. void DescribeSignedEventActionsResult::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 allEventItemsNode = value["EventItems"]["EventItemsItem"];
  37. for (auto valueEventItemsEventItemsItem : allEventItemsNode)
  38. {
  39. EventItemsItem eventItemsObject;
  40. if(!valueEventItemsEventItemsItem["EventId"].isNull())
  41. eventItemsObject.eventId = std::stoi(valueEventItemsEventItemsItem["EventId"].asString());
  42. if(!valueEventItemsEventItemsItem["EventContent"].isNull())
  43. eventItemsObject.eventContent = valueEventItemsEventItemsItem["EventContent"].asString();
  44. if(!valueEventItemsEventItemsItem["EventSig"].isNull())
  45. eventItemsObject.eventSig = valueEventItemsEventItemsItem["EventSig"].asString();
  46. if(!valueEventItemsEventItemsItem["EventRcpt"].isNull())
  47. eventItemsObject.eventRcpt = valueEventItemsEventItemsItem["EventRcpt"].asString();
  48. eventItems_.push_back(eventItemsObject);
  49. }
  50. if(!value["NextPageEventId"].isNull())
  51. nextPageEventId_ = std::stoi(value["NextPageEventId"].asString());
  52. if(!value["PageRecordCount"].isNull())
  53. pageRecordCount_ = std::stoi(value["PageRecordCount"].asString());
  54. if(!value["FromBegin"].isNull())
  55. fromBegin_ = value["FromBegin"].asString() == "true";
  56. if(!value["ToEnd"].isNull())
  57. toEnd_ = value["ToEnd"].asString() == "true";
  58. }
  59. std::vector<DescribeSignedEventActionsResult::EventItemsItem> DescribeSignedEventActionsResult::getEventItems()const
  60. {
  61. return eventItems_;
  62. }
  63. int DescribeSignedEventActionsResult::getPageRecordCount()const
  64. {
  65. return pageRecordCount_;
  66. }
  67. bool DescribeSignedEventActionsResult::getToEnd()const
  68. {
  69. return toEnd_;
  70. }
  71. bool DescribeSignedEventActionsResult::getFromBegin()const
  72. {
  73. return fromBegin_;
  74. }
  75. int DescribeSignedEventActionsResult::getNextPageEventId()const
  76. {
  77. return nextPageEventId_;
  78. }