Files
aliyun-openapi-cpp-sdk/ecd/src/model/DescribeCloudDriveGroupsResult.cc
2023-05-05 19:59:19 +00:00

93 lines
3.4 KiB
C++

/*
* 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/ecd/model/DescribeCloudDriveGroupsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ecd;
using namespace AlibabaCloud::Ecd::Model;
DescribeCloudDriveGroupsResult::DescribeCloudDriveGroupsResult() :
ServiceResult()
{}
DescribeCloudDriveGroupsResult::DescribeCloudDriveGroupsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeCloudDriveGroupsResult::~DescribeCloudDriveGroupsResult()
{}
void DescribeCloudDriveGroupsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allCloudDriveGroupsNode = value["CloudDriveGroups"]["CloudDriveGroup"];
for (auto valueCloudDriveGroupsCloudDriveGroup : allCloudDriveGroupsNode)
{
CloudDriveGroup cloudDriveGroupsObject;
if(!valueCloudDriveGroupsCloudDriveGroup["Status"].isNull())
cloudDriveGroupsObject.status = valueCloudDriveGroupsCloudDriveGroup["Status"].asString();
if(!valueCloudDriveGroupsCloudDriveGroup["GroupId"].isNull())
cloudDriveGroupsObject.groupId = valueCloudDriveGroupsCloudDriveGroup["GroupId"].asString();
if(!valueCloudDriveGroupsCloudDriveGroup["GroupName"].isNull())
cloudDriveGroupsObject.groupName = valueCloudDriveGroupsCloudDriveGroup["GroupName"].asString();
if(!valueCloudDriveGroupsCloudDriveGroup["DirectoryId"].isNull())
cloudDriveGroupsObject.directoryId = valueCloudDriveGroupsCloudDriveGroup["DirectoryId"].asString();
if(!valueCloudDriveGroupsCloudDriveGroup["DriveId"].isNull())
cloudDriveGroupsObject.driveId = valueCloudDriveGroupsCloudDriveGroup["DriveId"].asString();
if(!valueCloudDriveGroupsCloudDriveGroup["CreateTime"].isNull())
cloudDriveGroupsObject.createTime = valueCloudDriveGroupsCloudDriveGroup["CreateTime"].asString();
if(!valueCloudDriveGroupsCloudDriveGroup["TotalSize"].isNull())
cloudDriveGroupsObject.totalSize = std::stol(valueCloudDriveGroupsCloudDriveGroup["TotalSize"].asString());
if(!valueCloudDriveGroupsCloudDriveGroup["UsedSize"].isNull())
cloudDriveGroupsObject.usedSize = valueCloudDriveGroupsCloudDriveGroup["UsedSize"].asString();
cloudDriveGroups_.push_back(cloudDriveGroupsObject);
}
if(!value["NextToken"].isNull())
nextToken_ = value["NextToken"].asString();
if(!value["Count"].isNull())
count_ = std::stol(value["Count"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string DescribeCloudDriveGroupsResult::getNextToken()const
{
return nextToken_;
}
long DescribeCloudDriveGroupsResult::getCount()const
{
return count_;
}
std::vector<DescribeCloudDriveGroupsResult::CloudDriveGroup> DescribeCloudDriveGroupsResult::getCloudDriveGroups()const
{
return cloudDriveGroups_;
}
bool DescribeCloudDriveGroupsResult::getSuccess()const
{
return success_;
}