DescribeScdnDomainQpsDataResult.cc 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/scdn/model/DescribeScdnDomainQpsDataResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Scdn;
  19. using namespace AlibabaCloud::Scdn::Model;
  20. DescribeScdnDomainQpsDataResult::DescribeScdnDomainQpsDataResult() :
  21. ServiceResult()
  22. {}
  23. DescribeScdnDomainQpsDataResult::DescribeScdnDomainQpsDataResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeScdnDomainQpsDataResult::~DescribeScdnDomainQpsDataResult()
  29. {}
  30. void DescribeScdnDomainQpsDataResult::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 allQpsDataPerInterval = value["QpsDataPerInterval"]["DataModule"];
  37. for (auto value : allQpsDataPerInterval)
  38. {
  39. DataModule qpsDataPerIntervalObject;
  40. if(!value["TimeStamp"].isNull())
  41. qpsDataPerIntervalObject.timeStamp = value["TimeStamp"].asString();
  42. if(!value["QpsValue"].isNull())
  43. qpsDataPerIntervalObject.qpsValue = value["QpsValue"].asString();
  44. if(!value["HttpQpsValue"].isNull())
  45. qpsDataPerIntervalObject.httpQpsValue = value["HttpQpsValue"].asString();
  46. if(!value["HttpsQpsValue"].isNull())
  47. qpsDataPerIntervalObject.httpsQpsValue = value["HttpsQpsValue"].asString();
  48. if(!value["AccValue"].isNull())
  49. qpsDataPerIntervalObject.accValue = value["AccValue"].asString();
  50. if(!value["HttpAccValue"].isNull())
  51. qpsDataPerIntervalObject.httpAccValue = value["HttpAccValue"].asString();
  52. if(!value["HttpsAccValue"].isNull())
  53. qpsDataPerIntervalObject.httpsAccValue = value["HttpsAccValue"].asString();
  54. qpsDataPerInterval_.push_back(qpsDataPerIntervalObject);
  55. }
  56. if(!value["DomainName"].isNull())
  57. domainName_ = value["DomainName"].asString();
  58. if(!value["StartTime"].isNull())
  59. startTime_ = value["StartTime"].asString();
  60. if(!value["EndTime"].isNull())
  61. endTime_ = value["EndTime"].asString();
  62. if(!value["DataInterval"].isNull())
  63. dataInterval_ = value["DataInterval"].asString();
  64. }
  65. std::vector<DescribeScdnDomainQpsDataResult::DataModule> DescribeScdnDomainQpsDataResult::getQpsDataPerInterval()const
  66. {
  67. return qpsDataPerInterval_;
  68. }
  69. std::string DescribeScdnDomainQpsDataResult::getEndTime()const
  70. {
  71. return endTime_;
  72. }
  73. std::string DescribeScdnDomainQpsDataResult::getDomainName()const
  74. {
  75. return domainName_;
  76. }
  77. std::string DescribeScdnDomainQpsDataResult::getStartTime()const
  78. {
  79. return startTime_;
  80. }
  81. std::string DescribeScdnDomainQpsDataResult::getDataInterval()const
  82. {
  83. return dataInterval_;
  84. }