DescribeDomainFileSizeProportionDataResult.cc 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/DescribeDomainFileSizeProportionDataResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Cdn;
  19. using namespace AlibabaCloud::Cdn::Model;
  20. DescribeDomainFileSizeProportionDataResult::DescribeDomainFileSizeProportionDataResult() :
  21. ServiceResult()
  22. {}
  23. DescribeDomainFileSizeProportionDataResult::DescribeDomainFileSizeProportionDataResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeDomainFileSizeProportionDataResult::~DescribeDomainFileSizeProportionDataResult()
  29. {}
  30. void DescribeDomainFileSizeProportionDataResult::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 allFileSizeProportionDataIntervalNode = value["FileSizeProportionDataInterval"]["UsageData"];
  37. for (auto valueFileSizeProportionDataIntervalUsageData : allFileSizeProportionDataIntervalNode)
  38. {
  39. UsageData fileSizeProportionDataIntervalObject;
  40. if(!valueFileSizeProportionDataIntervalUsageData["TimeStamp"].isNull())
  41. fileSizeProportionDataIntervalObject.timeStamp = valueFileSizeProportionDataIntervalUsageData["TimeStamp"].asString();
  42. auto allValueNode = allFileSizeProportionDataIntervalNode["Value"]["FileSizeProportionData"];
  43. for (auto allFileSizeProportionDataIntervalNodeValueFileSizeProportionData : allValueNode)
  44. {
  45. UsageData::FileSizeProportionData valueObject;
  46. if(!allFileSizeProportionDataIntervalNodeValueFileSizeProportionData["FileSize"].isNull())
  47. valueObject.fileSize = allFileSizeProportionDataIntervalNodeValueFileSizeProportionData["FileSize"].asString();
  48. if(!allFileSizeProportionDataIntervalNodeValueFileSizeProportionData["Proportion"].isNull())
  49. valueObject.proportion = allFileSizeProportionDataIntervalNodeValueFileSizeProportionData["Proportion"].asString();
  50. fileSizeProportionDataIntervalObject.value.push_back(valueObject);
  51. }
  52. fileSizeProportionDataInterval_.push_back(fileSizeProportionDataIntervalObject);
  53. }
  54. if(!value["DomainName"].isNull())
  55. domainName_ = value["DomainName"].asString();
  56. if(!value["DataInterval"].isNull())
  57. dataInterval_ = value["DataInterval"].asString();
  58. if(!value["StartTime"].isNull())
  59. startTime_ = value["StartTime"].asString();
  60. if(!value["EndTime"].isNull())
  61. endTime_ = value["EndTime"].asString();
  62. }
  63. std::vector<DescribeDomainFileSizeProportionDataResult::UsageData> DescribeDomainFileSizeProportionDataResult::getFileSizeProportionDataInterval()const
  64. {
  65. return fileSizeProportionDataInterval_;
  66. }
  67. std::string DescribeDomainFileSizeProportionDataResult::getEndTime()const
  68. {
  69. return endTime_;
  70. }
  71. std::string DescribeDomainFileSizeProportionDataResult::getDomainName()const
  72. {
  73. return domainName_;
  74. }
  75. std::string DescribeDomainFileSizeProportionDataResult::getDataInterval()const
  76. {
  77. return dataInterval_;
  78. }
  79. std::string DescribeDomainFileSizeProportionDataResult::getStartTime()const
  80. {
  81. return startTime_;
  82. }