| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- /*
- * 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/cloudapi/model/DescribeApiGroupsResult.h>
- #include <json/json.h>
- using namespace AlibabaCloud::CloudAPI;
- using namespace AlibabaCloud::CloudAPI::Model;
- DescribeApiGroupsResult::DescribeApiGroupsResult() :
- ServiceResult()
- {}
- DescribeApiGroupsResult::DescribeApiGroupsResult(const std::string &payload) :
- ServiceResult()
- {
- parse(payload);
- }
- DescribeApiGroupsResult::~DescribeApiGroupsResult()
- {}
- void DescribeApiGroupsResult::parse(const std::string &payload)
- {
- Json::Reader reader;
- Json::Value value;
- reader.parse(payload, value);
- setRequestId(value["RequestId"].asString());
- auto allApiGroupAttributesNode = value["ApiGroupAttributes"]["ApiGroupAttribute"];
- for (auto valueApiGroupAttributesApiGroupAttribute : allApiGroupAttributesNode)
- {
- ApiGroupAttribute apiGroupAttributesObject;
- if(!valueApiGroupAttributesApiGroupAttribute["GroupId"].isNull())
- apiGroupAttributesObject.groupId = valueApiGroupAttributesApiGroupAttribute["GroupId"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["GroupName"].isNull())
- apiGroupAttributesObject.groupName = valueApiGroupAttributesApiGroupAttribute["GroupName"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["SubDomain"].isNull())
- apiGroupAttributesObject.subDomain = valueApiGroupAttributesApiGroupAttribute["SubDomain"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["Description"].isNull())
- apiGroupAttributesObject.description = valueApiGroupAttributesApiGroupAttribute["Description"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["CreatedTime"].isNull())
- apiGroupAttributesObject.createdTime = valueApiGroupAttributesApiGroupAttribute["CreatedTime"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["ModifiedTime"].isNull())
- apiGroupAttributesObject.modifiedTime = valueApiGroupAttributesApiGroupAttribute["ModifiedTime"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["RegionId"].isNull())
- apiGroupAttributesObject.regionId = valueApiGroupAttributesApiGroupAttribute["RegionId"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["TrafficLimit"].isNull())
- apiGroupAttributesObject.trafficLimit = std::stoi(valueApiGroupAttributesApiGroupAttribute["TrafficLimit"].asString());
- if(!valueApiGroupAttributesApiGroupAttribute["BillingStatus"].isNull())
- apiGroupAttributesObject.billingStatus = valueApiGroupAttributesApiGroupAttribute["BillingStatus"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["IllegalStatus"].isNull())
- apiGroupAttributesObject.illegalStatus = valueApiGroupAttributesApiGroupAttribute["IllegalStatus"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["InstanceId"].isNull())
- apiGroupAttributesObject.instanceId = valueApiGroupAttributesApiGroupAttribute["InstanceId"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["InstanceType"].isNull())
- apiGroupAttributesObject.instanceType = valueApiGroupAttributesApiGroupAttribute["InstanceType"].asString();
- if(!valueApiGroupAttributesApiGroupAttribute["HttpsPolicy"].isNull())
- apiGroupAttributesObject.httpsPolicy = valueApiGroupAttributesApiGroupAttribute["HttpsPolicy"].asString();
- apiGroupAttributes_.push_back(apiGroupAttributesObject);
- }
- if(!value["TotalCount"].isNull())
- totalCount_ = std::stoi(value["TotalCount"].asString());
- if(!value["PageSize"].isNull())
- pageSize_ = std::stoi(value["PageSize"].asString());
- if(!value["PageNumber"].isNull())
- pageNumber_ = std::stoi(value["PageNumber"].asString());
- }
- int DescribeApiGroupsResult::getTotalCount()const
- {
- return totalCount_;
- }
- int DescribeApiGroupsResult::getPageSize()const
- {
- return pageSize_;
- }
- int DescribeApiGroupsResult::getPageNumber()const
- {
- return pageNumber_;
- }
- std::vector<DescribeApiGroupsResult::ApiGroupAttribute> DescribeApiGroupsResult::getApiGroupAttributes()const
- {
- return apiGroupAttributes_;
- }
|