/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::EBS::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; ListChangedBlocksResult::ListChangedBlocksResult() : m_volumeSize(0), m_blockSize(0) { } ListChangedBlocksResult::ListChangedBlocksResult(const Aws::AmazonWebServiceResult& result) : m_volumeSize(0), m_blockSize(0) { *this = result; } ListChangedBlocksResult& ListChangedBlocksResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("ChangedBlocks")) { Aws::Utils::Array changedBlocksJsonList = jsonValue.GetArray("ChangedBlocks"); for(unsigned changedBlocksIndex = 0; changedBlocksIndex < changedBlocksJsonList.GetLength(); ++changedBlocksIndex) { m_changedBlocks.push_back(changedBlocksJsonList[changedBlocksIndex].AsObject()); } } if(jsonValue.ValueExists("ExpiryTime")) { m_expiryTime = jsonValue.GetDouble("ExpiryTime"); } if(jsonValue.ValueExists("VolumeSize")) { m_volumeSize = jsonValue.GetInt64("VolumeSize"); } if(jsonValue.ValueExists("BlockSize")) { m_blockSize = jsonValue.GetInteger("BlockSize"); } if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }