/** * 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::Lightsail::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetAutoSnapshotsResult::GetAutoSnapshotsResult() : m_resourceType(ResourceType::NOT_SET) { } GetAutoSnapshotsResult::GetAutoSnapshotsResult(const Aws::AmazonWebServiceResult& result) : m_resourceType(ResourceType::NOT_SET) { *this = result; } GetAutoSnapshotsResult& GetAutoSnapshotsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("resourceName")) { m_resourceName = jsonValue.GetString("resourceName"); } if(jsonValue.ValueExists("resourceType")) { m_resourceType = ResourceTypeMapper::GetResourceTypeForName(jsonValue.GetString("resourceType")); } if(jsonValue.ValueExists("autoSnapshots")) { Aws::Utils::Array autoSnapshotsJsonList = jsonValue.GetArray("autoSnapshots"); for(unsigned autoSnapshotsIndex = 0; autoSnapshotsIndex < autoSnapshotsJsonList.GetLength(); ++autoSnapshotsIndex) { m_autoSnapshots.push_back(autoSnapshotsJsonList[autoSnapshotsIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }