DescribeScdnDomainOriginBpsDataResult.cc 2.9 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/scdn/model/DescribeScdnDomainOriginBpsDataResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Scdn;
  19. using namespace AlibabaCloud::Scdn::Model;
  20. DescribeScdnDomainOriginBpsDataResult::DescribeScdnDomainOriginBpsDataResult() :
  21. ServiceResult()
  22. {}
  23. DescribeScdnDomainOriginBpsDataResult::DescribeScdnDomainOriginBpsDataResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeScdnDomainOriginBpsDataResult::~DescribeScdnDomainOriginBpsDataResult()
  29. {}
  30. void DescribeScdnDomainOriginBpsDataResult::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 allOriginBpsDataPerInterval = value["OriginBpsDataPerInterval"]["DataModule"];
  37. for (auto value : allOriginBpsDataPerInterval)
  38. {
  39. DataModule originBpsDataPerIntervalObject;
  40. if(!value["TimeStamp"].isNull())
  41. originBpsDataPerIntervalObject.timeStamp = value["TimeStamp"].asString();
  42. if(!value["OriginBpsValue"].isNull())
  43. originBpsDataPerIntervalObject.originBpsValue = value["OriginBpsValue"].asString();
  44. if(!value["HttpOriginBpsValue"].isNull())
  45. originBpsDataPerIntervalObject.httpOriginBpsValue = value["HttpOriginBpsValue"].asString();
  46. if(!value["HttpsOriginBpsValue"].isNull())
  47. originBpsDataPerIntervalObject.httpsOriginBpsValue = value["HttpsOriginBpsValue"].asString();
  48. originBpsDataPerInterval_.push_back(originBpsDataPerIntervalObject);
  49. }
  50. if(!value["DomainName"].isNull())
  51. domainName_ = value["DomainName"].asString();
  52. if(!value["StartTime"].isNull())
  53. startTime_ = value["StartTime"].asString();
  54. if(!value["EndTime"].isNull())
  55. endTime_ = value["EndTime"].asString();
  56. if(!value["DataInterval"].isNull())
  57. dataInterval_ = value["DataInterval"].asString();
  58. }
  59. std::string DescribeScdnDomainOriginBpsDataResult::getEndTime()const
  60. {
  61. return endTime_;
  62. }
  63. std::string DescribeScdnDomainOriginBpsDataResult::getDomainName()const
  64. {
  65. return domainName_;
  66. }
  67. std::string DescribeScdnDomainOriginBpsDataResult::getStartTime()const
  68. {
  69. return startTime_;
  70. }
  71. std::string DescribeScdnDomainOriginBpsDataResult::getDataInterval()const
  72. {
  73. return dataInterval_;
  74. }
  75. std::vector<DescribeScdnDomainOriginBpsDataResult::DataModule> DescribeScdnDomainOriginBpsDataResult::getOriginBpsDataPerInterval()const
  76. {
  77. return originBpsDataPerInterval_;
  78. }