DescribeScdnDomainDetailResult.cc 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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/DescribeScdnDomainDetailResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Scdn;
  19. using namespace AlibabaCloud::Scdn::Model;
  20. DescribeScdnDomainDetailResult::DescribeScdnDomainDetailResult() :
  21. ServiceResult()
  22. {}
  23. DescribeScdnDomainDetailResult::DescribeScdnDomainDetailResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. DescribeScdnDomainDetailResult::~DescribeScdnDomainDetailResult()
  29. {}
  30. void DescribeScdnDomainDetailResult::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 domainDetailNode = value["DomainDetail"];
  37. if(!domainDetailNode["GmtCreated"].isNull())
  38. domainDetail_.gmtCreated = domainDetailNode["GmtCreated"].asString();
  39. if(!domainDetailNode["GmtModified"].isNull())
  40. domainDetail_.gmtModified = domainDetailNode["GmtModified"].asString();
  41. if(!domainDetailNode["DomainStatus"].isNull())
  42. domainDetail_.domainStatus = domainDetailNode["DomainStatus"].asString();
  43. if(!domainDetailNode["Cname"].isNull())
  44. domainDetail_.cname = domainDetailNode["Cname"].asString();
  45. if(!domainDetailNode["DomainName"].isNull())
  46. domainDetail_.domainName = domainDetailNode["DomainName"].asString();
  47. if(!domainDetailNode["Description"].isNull())
  48. domainDetail_.description = domainDetailNode["Description"].asString();
  49. if(!domainDetailNode["SSLProtocol"].isNull())
  50. domainDetail_.sSLProtocol = domainDetailNode["SSLProtocol"].asString();
  51. if(!domainDetailNode["SSLPub"].isNull())
  52. domainDetail_.sSLPub = domainDetailNode["SSLPub"].asString();
  53. if(!domainDetailNode["Scope"].isNull())
  54. domainDetail_.scope = domainDetailNode["Scope"].asString();
  55. if(!domainDetailNode["CertName"].isNull())
  56. domainDetail_.certName = domainDetailNode["CertName"].asString();
  57. if(!domainDetailNode["ResourceGroupId"].isNull())
  58. domainDetail_.resourceGroupId = domainDetailNode["ResourceGroupId"].asString();
  59. auto allSourcesNode = domainDetailNode["Sources"]["Source"];
  60. for (auto domainDetailNodeSourcesSource : allSourcesNode)
  61. {
  62. DomainDetail::Source sourceObject;
  63. if(!domainDetailNodeSourcesSource["Content"].isNull())
  64. sourceObject.content = domainDetailNodeSourcesSource["Content"].asString();
  65. if(!domainDetailNodeSourcesSource["Type"].isNull())
  66. sourceObject.type = domainDetailNodeSourcesSource["Type"].asString();
  67. if(!domainDetailNodeSourcesSource["Port"].isNull())
  68. sourceObject.port = std::stoi(domainDetailNodeSourcesSource["Port"].asString());
  69. if(!domainDetailNodeSourcesSource["Enabled"].isNull())
  70. sourceObject.enabled = domainDetailNodeSourcesSource["Enabled"].asString();
  71. if(!domainDetailNodeSourcesSource["Priority"].isNull())
  72. sourceObject.priority = domainDetailNodeSourcesSource["Priority"].asString();
  73. domainDetail_.sources.push_back(sourceObject);
  74. }
  75. }
  76. DescribeScdnDomainDetailResult::DomainDetail DescribeScdnDomainDetailResult::getDomainDetail()const
  77. {
  78. return domainDetail_;
  79. }