/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include using namespace Aws::IoTThingsGraph::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; SearchThingsResult::SearchThingsResult() { } SearchThingsResult::SearchThingsResult(const Aws::AmazonWebServiceResult& result) { *this = result; } SearchThingsResult& SearchThingsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("things")) { Array thingsJsonList = jsonValue.GetArray("things"); for(unsigned thingsIndex = 0; thingsIndex < thingsJsonList.GetLength(); ++thingsIndex) { m_things.push_back(thingsJsonList[thingsIndex].AsObject()); } } if(jsonValue.ValueExists("nextToken")) { m_nextToken = jsonValue.GetString("nextToken"); } return *this; }