DescribeNumberDistrictInfoStatusResult.cc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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/outboundbot/model/DescribeNumberDistrictInfoStatusResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::OutboundBot;
  19. using namespace AlibabaCloud::OutboundBot::Model;
  20. DescribeNumberDistrictInfoStatusResult::DescribeNumberDistrictInfoStatusResult() :
  21. ServiceResult()
  22. {}
  23. DescribeNumberDistrictInfoStatusResult::DescribeNumberDistrictInfoStatusResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeNumberDistrictInfoStatusResult::~DescribeNumberDistrictInfoStatusResult()
  29. {}
  30. void DescribeNumberDistrictInfoStatusResult::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 appliedVersionNode = value["AppliedVersion"];
  37. if(!appliedVersionNode["VersionId"].isNull())
  38. appliedVersion_.versionId = appliedVersionNode["VersionId"].asString();
  39. if(!appliedVersionNode["FileName"].isNull())
  40. appliedVersion_.fileName = appliedVersionNode["FileName"].asString();
  41. if(!appliedVersionNode["FileSize"].isNull())
  42. appliedVersion_.fileSize = std::stol(appliedVersionNode["FileSize"].asString());
  43. auto parsingVersionNode = value["ParsingVersion"];
  44. if(!parsingVersionNode["VersionId"].isNull())
  45. parsingVersion_.versionId = parsingVersionNode["VersionId"].asString();
  46. if(!parsingVersionNode["FileName"].isNull())
  47. parsingVersion_.fileName = parsingVersionNode["FileName"].asString();
  48. if(!parsingVersionNode["FileSize"].isNull())
  49. parsingVersion_.fileSize = std::stol(parsingVersionNode["FileSize"].asString());
  50. if(!parsingVersionNode["ParseProgress"].isNull())
  51. parsingVersion_.parseProgress = std::stol(parsingVersionNode["ParseProgress"].asString());
  52. if(!value["HttpStatusCode"].isNull())
  53. httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
  54. if(!value["Code"].isNull())
  55. code_ = value["Code"].asString();
  56. if(!value["Message"].isNull())
  57. message_ = value["Message"].asString();
  58. if(!value["Success"].isNull())
  59. success_ = value["Success"].asString() == "true";
  60. if(!value["Status"].isNull())
  61. status_ = value["Status"].asString();
  62. }
  63. std::string DescribeNumberDistrictInfoStatusResult::getStatus()const
  64. {
  65. return status_;
  66. }
  67. DescribeNumberDistrictInfoStatusResult::AppliedVersion DescribeNumberDistrictInfoStatusResult::getAppliedVersion()const
  68. {
  69. return appliedVersion_;
  70. }
  71. DescribeNumberDistrictInfoStatusResult::ParsingVersion DescribeNumberDistrictInfoStatusResult::getParsingVersion()const
  72. {
  73. return parsingVersion_;
  74. }
  75. std::string DescribeNumberDistrictInfoStatusResult::getMessage()const
  76. {
  77. return message_;
  78. }
  79. int DescribeNumberDistrictInfoStatusResult::getHttpStatusCode()const
  80. {
  81. return httpStatusCode_;
  82. }
  83. std::string DescribeNumberDistrictInfoStatusResult::getCode()const
  84. {
  85. return code_;
  86. }
  87. bool DescribeNumberDistrictInfoStatusResult::getSuccess()const
  88. {
  89. return success_;
  90. }