/** * 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; GetInstancePortStatesResult::GetInstancePortStatesResult() { } GetInstancePortStatesResult::GetInstancePortStatesResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetInstancePortStatesResult& GetInstancePortStatesResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("portStates")) { Aws::Utils::Array portStatesJsonList = jsonValue.GetArray("portStates"); for(unsigned portStatesIndex = 0; portStatesIndex < portStatesJsonList.GetLength(); ++portStatesIndex) { m_portStates.push_back(portStatesJsonList[portStatesIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }