GetSecretValueResult.cc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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/kms/model/GetSecretValueResult.h>
  17. #include <json/json.h>
  18. using namespace AlibabaCloud::Kms;
  19. using namespace AlibabaCloud::Kms::Model;
  20. GetSecretValueResult::GetSecretValueResult() :
  21. ServiceResult()
  22. {}
  23. GetSecretValueResult::GetSecretValueResult(const std::string &payload) :
  24. ServiceResult()
  25. {
  26. parse(payload);
  27. }
  28. GetSecretValueResult::~GetSecretValueResult()
  29. {}
  30. void GetSecretValueResult::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 allVersionStages = value["VersionStages"]["VersionStage"];
  37. for (const auto &item : allVersionStages)
  38. versionStages_.push_back(item.asString());
  39. if(!value["SecretName"].isNull())
  40. secretName_ = value["SecretName"].asString();
  41. if(!value["VersionId"].isNull())
  42. versionId_ = value["VersionId"].asString();
  43. if(!value["CreateTime"].isNull())
  44. createTime_ = value["CreateTime"].asString();
  45. if(!value["SecretData"].isNull())
  46. secretData_ = value["SecretData"].asString();
  47. if(!value["SecretDataType"].isNull())
  48. secretDataType_ = value["SecretDataType"].asString();
  49. if(!value["AutomaticRotation"].isNull())
  50. automaticRotation_ = value["AutomaticRotation"].asString();
  51. if(!value["RotationInterval"].isNull())
  52. rotationInterval_ = value["RotationInterval"].asString();
  53. if(!value["NextRotationDate"].isNull())
  54. nextRotationDate_ = value["NextRotationDate"].asString();
  55. if(!value["ExtendedConfig"].isNull())
  56. extendedConfig_ = value["ExtendedConfig"].asString();
  57. if(!value["LastRotationDate"].isNull())
  58. lastRotationDate_ = value["LastRotationDate"].asString();
  59. if(!value["SecretType"].isNull())
  60. secretType_ = value["SecretType"].asString();
  61. }
  62. std::string GetSecretValueResult::getSecretName()const
  63. {
  64. return secretName_;
  65. }
  66. std::string GetSecretValueResult::getVersionId()const
  67. {
  68. return versionId_;
  69. }
  70. std::string GetSecretValueResult::getNextRotationDate()const
  71. {
  72. return nextRotationDate_;
  73. }
  74. std::string GetSecretValueResult::getRotationInterval()const
  75. {
  76. return rotationInterval_;
  77. }
  78. std::string GetSecretValueResult::getLastRotationDate()const
  79. {
  80. return lastRotationDate_;
  81. }
  82. std::string GetSecretValueResult::getSecretType()const
  83. {
  84. return secretType_;
  85. }
  86. std::string GetSecretValueResult::getCreateTime()const
  87. {
  88. return createTime_;
  89. }
  90. std::string GetSecretValueResult::getSecretDataType()const
  91. {
  92. return secretDataType_;
  93. }
  94. std::string GetSecretValueResult::getExtendedConfig()const
  95. {
  96. return extendedConfig_;
  97. }
  98. std::string GetSecretValueResult::getSecretData()const
  99. {
  100. return secretData_;
  101. }
  102. std::vector<std::string> GetSecretValueResult::getVersionStages()const
  103. {
  104. return versionStages_;
  105. }
  106. std::string GetSecretValueResult::getAutomaticRotation()const
  107. {
  108. return automaticRotation_;
  109. }