| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 |
- /*
- * Copyright 2009-2017 Alibaba Cloud All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- #include <alibabacloud/sgw/model/DescribeGatewayResult.h>
- #include <json/json.h>
- using namespace AlibabaCloud::Sgw;
- using namespace AlibabaCloud::Sgw::Model;
- DescribeGatewayResult::DescribeGatewayResult() :
- ServiceResult()
- {}
- DescribeGatewayResult::DescribeGatewayResult(const std::string &payload) :
- ServiceResult()
- {
- parse(payload);
- }
- DescribeGatewayResult::~DescribeGatewayResult()
- {}
- void DescribeGatewayResult::parse(const std::string &payload)
- {
- Json::Reader reader;
- Json::Value value;
- reader.parse(payload, value);
- setRequestId(value["RequestId"].asString());
- auto allElasticNodes = value["ElasticNodes"]["ElasticNode"];
- for (const auto &item : allElasticNodes)
- elasticNodes_.push_back(item.asString());
- if(!value["Success"].isNull())
- success_ = value["Success"].asString() == "true";
- if(!value["Code"].isNull())
- code_ = value["Code"].asString();
- if(!value["Message"].isNull())
- message_ = value["Message"].asString();
- if(!value["GatewayId"].isNull())
- gatewayId_ = value["GatewayId"].asString();
- if(!value["StorageBundleId"].isNull())
- storageBundleId_ = value["StorageBundleId"].asString();
- if(!value["Name"].isNull())
- name_ = value["Name"].asString();
- if(!value["Description"].isNull())
- description_ = value["Description"].asString();
- if(!value["Location"].isNull())
- location_ = value["Location"].asString();
- if(!value["Category"].isNull())
- category_ = value["Category"].asString();
- if(!value["Type"].isNull())
- type_ = value["Type"].asString();
- if(!value["GatewayClass"].isNull())
- gatewayClass_ = value["GatewayClass"].asString();
- if(!value["Model"].isNull())
- model_ = value["Model"].asString();
- if(!value["SerialNumber"].isNull())
- serialNumber_ = value["SerialNumber"].asString();
- if(!value["Status"].isNull())
- status_ = value["Status"].asString();
- if(!value["EcsInstanceId"].isNull())
- ecsInstanceId_ = value["EcsInstanceId"].asString();
- if(!value["VpcId"].isNull())
- vpcId_ = value["VpcId"].asString();
- if(!value["VSwitchId"].isNull())
- vSwitchId_ = value["VSwitchId"].asString();
- if(!value["Ip"].isNull())
- ip_ = value["Ip"].asString();
- if(!value["InnerIp"].isNull())
- innerIp_ = value["InnerIp"].asString();
- if(!value["CreatedTime"].isNull())
- createdTime_ = std::stol(value["CreatedTime"].asString());
- if(!value["ActivatedTime"].isNull())
- activatedTime_ = std::stol(value["ActivatedTime"].asString());
- if(!value["TaskId"].isNull())
- taskId_ = value["TaskId"].asString();
- if(!value["GatewayVersion"].isNull())
- gatewayVersion_ = value["GatewayVersion"].asString();
- if(!value["BuyURL"].isNull())
- buyURL_ = value["BuyURL"].asString();
- if(!value["RenewURL"].isNull())
- renewURL_ = value["RenewURL"].asString();
- if(!value["IsPostPaid"].isNull())
- isPostPaid_ = value["IsPostPaid"].asString() == "true";
- if(!value["IsReleaseAfterExpiration"].isNull())
- isReleaseAfterExpiration_ = value["IsReleaseAfterExpiration"].asString() == "true";
- if(!value["ExpiredTime"].isNull())
- expiredTime_ = std::stol(value["ExpiredTime"].asString());
- if(!value["ExpireStatus"].isNull())
- expireStatus_ = std::stoi(value["ExpireStatus"].asString());
- if(!value["CommonBuyInstanceId"].isNull())
- commonBuyInstanceId_ = value["CommonBuyInstanceId"].asString();
- if(!value["PublicNetworkBandwidth"].isNull())
- publicNetworkBandwidth_ = std::stoi(value["PublicNetworkBandwidth"].asString());
- if(!value["GatewayType"].isNull())
- gatewayType_ = value["GatewayType"].asString();
- if(!value["ElasticGateway"].isNull())
- elasticGateway_ = value["ElasticGateway"].asString() == "true";
- if(!value["MaxThroughput"].isNull())
- maxThroughput_ = std::stoi(value["MaxThroughput"].asString());
- if(!value["Capacity"].isNull())
- capacity_ = std::stoi(value["Capacity"].asString());
- if(!value["DataLoadType"].isNull())
- dataLoadType_ = value["DataLoadType"].asString();
- if(!value["DataLoadInterval"].isNull())
- dataLoadInterval_ = std::stoi(value["DataLoadInterval"].asString());
- if(!value["LastErrorKey"].isNull())
- lastErrorKey_ = value["LastErrorKey"].asString();
- }
- std::string DescribeGatewayResult::getDescription()const
- {
- return description_;
- }
- std::string DescribeGatewayResult::getCategory()const
- {
- return category_;
- }
- long DescribeGatewayResult::getCreatedTime()const
- {
- return createdTime_;
- }
- std::string DescribeGatewayResult::getTaskId()const
- {
- return taskId_;
- }
- int DescribeGatewayResult::getPublicNetworkBandwidth()const
- {
- return publicNetworkBandwidth_;
- }
- std::string DescribeGatewayResult::getDataLoadType()const
- {
- return dataLoadType_;
- }
- std::string DescribeGatewayResult::getMessage()const
- {
- return message_;
- }
- std::string DescribeGatewayResult::getIp()const
- {
- return ip_;
- }
- int DescribeGatewayResult::getExpireStatus()const
- {
- return expireStatus_;
- }
- std::string DescribeGatewayResult::getStorageBundleId()const
- {
- return storageBundleId_;
- }
- std::string DescribeGatewayResult::getGatewayType()const
- {
- return gatewayType_;
- }
- std::string DescribeGatewayResult::getGatewayClass()const
- {
- return gatewayClass_;
- }
- bool DescribeGatewayResult::getSuccess()const
- {
- return success_;
- }
- std::string DescribeGatewayResult::getName()const
- {
- return name_;
- }
- bool DescribeGatewayResult::getIsPostPaid()const
- {
- return isPostPaid_;
- }
- int DescribeGatewayResult::getCapacity()const
- {
- return capacity_;
- }
- long DescribeGatewayResult::getExpiredTime()const
- {
- return expiredTime_;
- }
- std::string DescribeGatewayResult::getGatewayVersion()const
- {
- return gatewayVersion_;
- }
- bool DescribeGatewayResult::getIsReleaseAfterExpiration()const
- {
- return isReleaseAfterExpiration_;
- }
- std::string DescribeGatewayResult::getStatus()const
- {
- return status_;
- }
- std::string DescribeGatewayResult::getBuyURL()const
- {
- return buyURL_;
- }
- int DescribeGatewayResult::getMaxThroughput()const
- {
- return maxThroughput_;
- }
- int DescribeGatewayResult::getDataLoadInterval()const
- {
- return dataLoadInterval_;
- }
- std::string DescribeGatewayResult::getInnerIp()const
- {
- return innerIp_;
- }
- std::string DescribeGatewayResult::getVSwitchId()const
- {
- return vSwitchId_;
- }
- std::vector<std::string> DescribeGatewayResult::getElasticNodes()const
- {
- return elasticNodes_;
- }
- std::string DescribeGatewayResult::getGatewayId()const
- {
- return gatewayId_;
- }
- std::string DescribeGatewayResult::getCode()const
- {
- return code_;
- }
- std::string DescribeGatewayResult::getEcsInstanceId()const
- {
- return ecsInstanceId_;
- }
- std::string DescribeGatewayResult::getType()const
- {
- return type_;
- }
- std::string DescribeGatewayResult::getRenewURL()const
- {
- return renewURL_;
- }
- std::string DescribeGatewayResult::getSerialNumber()const
- {
- return serialNumber_;
- }
- std::string DescribeGatewayResult::getVpcId()const
- {
- return vpcId_;
- }
- long DescribeGatewayResult::getActivatedTime()const
- {
- return activatedTime_;
- }
- bool DescribeGatewayResult::getElasticGateway()const
- {
- return elasticGateway_;
- }
- std::string DescribeGatewayResult::getCommonBuyInstanceId()const
- {
- return commonBuyInstanceId_;
- }
- std::string DescribeGatewayResult::getModel()const
- {
- return model_;
- }
- std::string DescribeGatewayResult::getLastErrorKey()const
- {
- return lastErrorKey_;
- }
- std::string DescribeGatewayResult::getLocation()const
- {
- return location_;
- }
|