/** * 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::Glacier::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeVaultResult::DescribeVaultResult() : m_numberOfArchives(0), m_sizeInBytes(0) { } DescribeVaultResult::DescribeVaultResult(const Aws::AmazonWebServiceResult& result) : m_numberOfArchives(0), m_sizeInBytes(0) { *this = result; } DescribeVaultResult& DescribeVaultResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("VaultARN")) { m_vaultARN = jsonValue.GetString("VaultARN"); } if(jsonValue.ValueExists("VaultName")) { m_vaultName = jsonValue.GetString("VaultName"); } if(jsonValue.ValueExists("CreationDate")) { m_creationDate = jsonValue.GetString("CreationDate"); } if(jsonValue.ValueExists("LastInventoryDate")) { m_lastInventoryDate = jsonValue.GetString("LastInventoryDate"); } if(jsonValue.ValueExists("NumberOfArchives")) { m_numberOfArchives = jsonValue.GetInt64("NumberOfArchives"); } if(jsonValue.ValueExists("SizeInBytes")) { m_sizeInBytes = jsonValue.GetInt64("SizeInBytes"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }