/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace LocationService { namespace Model { SearchPlaceIndexForPositionSummary::SearchPlaceIndexForPositionSummary() : m_dataSourceHasBeenSet(false), m_languageHasBeenSet(false), m_maxResults(0), m_maxResultsHasBeenSet(false), m_positionHasBeenSet(false) { } SearchPlaceIndexForPositionSummary::SearchPlaceIndexForPositionSummary(JsonView jsonValue) : m_dataSourceHasBeenSet(false), m_languageHasBeenSet(false), m_maxResults(0), m_maxResultsHasBeenSet(false), m_positionHasBeenSet(false) { *this = jsonValue; } SearchPlaceIndexForPositionSummary& SearchPlaceIndexForPositionSummary::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("DataSource")) { m_dataSource = jsonValue.GetString("DataSource"); m_dataSourceHasBeenSet = true; } if(jsonValue.ValueExists("Language")) { m_language = jsonValue.GetString("Language"); m_languageHasBeenSet = true; } if(jsonValue.ValueExists("MaxResults")) { m_maxResults = jsonValue.GetInteger("MaxResults"); m_maxResultsHasBeenSet = true; } if(jsonValue.ValueExists("Position")) { Aws::Utils::Array positionJsonList = jsonValue.GetArray("Position"); for(unsigned positionIndex = 0; positionIndex < positionJsonList.GetLength(); ++positionIndex) { m_position.push_back(positionJsonList[positionIndex].AsDouble()); } m_positionHasBeenSet = true; } return *this; } JsonValue SearchPlaceIndexForPositionSummary::Jsonize() const { JsonValue payload; if(m_dataSourceHasBeenSet) { payload.WithString("DataSource", m_dataSource); } if(m_languageHasBeenSet) { payload.WithString("Language", m_language); } if(m_maxResultsHasBeenSet) { payload.WithInteger("MaxResults", m_maxResults); } if(m_positionHasBeenSet) { Aws::Utils::Array positionJsonList(m_position.size()); for(unsigned positionIndex = 0; positionIndex < positionJsonList.GetLength(); ++positionIndex) { positionJsonList[positionIndex].AsDouble(m_position[positionIndex]); } payload.WithArray("Position", std::move(positionJsonList)); } return payload; } } // namespace Model } // namespace LocationService } // namespace Aws