/** * 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::StorageGateway::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeWorkingStorageResult::DescribeWorkingStorageResult() : m_workingStorageUsedInBytes(0), m_workingStorageAllocatedInBytes(0) { } DescribeWorkingStorageResult::DescribeWorkingStorageResult(const Aws::AmazonWebServiceResult& result) : m_workingStorageUsedInBytes(0), m_workingStorageAllocatedInBytes(0) { *this = result; } DescribeWorkingStorageResult& DescribeWorkingStorageResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("GatewayARN")) { m_gatewayARN = jsonValue.GetString("GatewayARN"); } if(jsonValue.ValueExists("DiskIds")) { Aws::Utils::Array diskIdsJsonList = jsonValue.GetArray("DiskIds"); for(unsigned diskIdsIndex = 0; diskIdsIndex < diskIdsJsonList.GetLength(); ++diskIdsIndex) { m_diskIds.push_back(diskIdsJsonList[diskIdsIndex].AsString()); } } if(jsonValue.ValueExists("WorkingStorageUsedInBytes")) { m_workingStorageUsedInBytes = jsonValue.GetInt64("WorkingStorageUsedInBytes"); } if(jsonValue.ValueExists("WorkingStorageAllocatedInBytes")) { m_workingStorageAllocatedInBytes = jsonValue.GetInt64("WorkingStorageAllocatedInBytes"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }