/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include using namespace Aws::LocationService::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws::Http; SearchPlaceIndexForPositionRequest::SearchPlaceIndexForPositionRequest() : m_indexNameHasBeenSet(false), m_keyHasBeenSet(false), m_languageHasBeenSet(false), m_maxResults(0), m_maxResultsHasBeenSet(false), m_positionHasBeenSet(false) { } Aws::String SearchPlaceIndexForPositionRequest::SerializePayload() const { JsonValue payload; 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.View().WriteReadable(); } void SearchPlaceIndexForPositionRequest::AddQueryStringParameters(URI& uri) const { Aws::StringStream ss; if(m_keyHasBeenSet) { ss << m_key; uri.AddQueryStringParameter("key", ss.str()); ss.str(""); } }