DescribeDomainQpsDataByLayerResult.cc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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/cdn/model/DescribeDomainQpsDataByLayerResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Cdn;
  19. using namespace AlibabaCloud::Cdn::Model;
  20. DescribeDomainQpsDataByLayerResult::DescribeDomainQpsDataByLayerResult() :
  21. ServiceResult()
  22. {}
  23. DescribeDomainQpsDataByLayerResult::DescribeDomainQpsDataByLayerResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeDomainQpsDataByLayerResult::~DescribeDomainQpsDataByLayerResult()
  29. {}
  30. void DescribeDomainQpsDataByLayerResult::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 allQpsDataIntervalNode = value["QpsDataInterval"]["DataModule"];
  37. for (auto valueQpsDataIntervalDataModule : allQpsDataIntervalNode)
  38. {
  39. DataModule qpsDataIntervalObject;
  40. if(!valueQpsDataIntervalDataModule["Value"].isNull())
  41. qpsDataIntervalObject.value = valueQpsDataIntervalDataModule["Value"].asString();
  42. if(!valueQpsDataIntervalDataModule["AccValue"].isNull())
  43. qpsDataIntervalObject.accValue = valueQpsDataIntervalDataModule["AccValue"].asString();
  44. if(!valueQpsDataIntervalDataModule["AccDomesticValue"].isNull())
  45. qpsDataIntervalObject.accDomesticValue = valueQpsDataIntervalDataModule["AccDomesticValue"].asString();
  46. if(!valueQpsDataIntervalDataModule["OverseasValue"].isNull())
  47. qpsDataIntervalObject.overseasValue = valueQpsDataIntervalDataModule["OverseasValue"].asString();
  48. if(!valueQpsDataIntervalDataModule["AccOverseasValue"].isNull())
  49. qpsDataIntervalObject.accOverseasValue = valueQpsDataIntervalDataModule["AccOverseasValue"].asString();
  50. if(!valueQpsDataIntervalDataModule["TimeStamp"].isNull())
  51. qpsDataIntervalObject.timeStamp = valueQpsDataIntervalDataModule["TimeStamp"].asString();
  52. if(!valueQpsDataIntervalDataModule["DomesticValue"].isNull())
  53. qpsDataIntervalObject.domesticValue = valueQpsDataIntervalDataModule["DomesticValue"].asString();
  54. qpsDataInterval_.push_back(qpsDataIntervalObject);
  55. }
  56. if(!value["EndTime"].isNull())
  57. endTime_ = value["EndTime"].asString();
  58. if(!value["StartTime"].isNull())
  59. startTime_ = value["StartTime"].asString();
  60. if(!value["Layer"].isNull())
  61. layer_ = value["Layer"].asString();
  62. if(!value["DomainName"].isNull())
  63. domainName_ = value["DomainName"].asString();
  64. if(!value["DataInterval"].isNull())
  65. dataInterval_ = value["DataInterval"].asString();
  66. }
  67. std::string DescribeDomainQpsDataByLayerResult::getEndTime()const
  68. {
  69. return endTime_;
  70. }
  71. std::string DescribeDomainQpsDataByLayerResult::getDomainName()const
  72. {
  73. return domainName_;
  74. }
  75. std::string DescribeDomainQpsDataByLayerResult::getStartTime()const
  76. {
  77. return startTime_;
  78. }
  79. std::string DescribeDomainQpsDataByLayerResult::getDataInterval()const
  80. {
  81. return dataInterval_;
  82. }
  83. std::vector<DescribeDomainQpsDataByLayerResult::DataModule> DescribeDomainQpsDataByLayerResult::getQpsDataInterval()const
  84. {
  85. return qpsDataInterval_;
  86. }
  87. std::string DescribeDomainQpsDataByLayerResult::getLayer()const
  88. {
  89. return layer_;
  90. }