1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/discovery/model/ListServerNeighborsRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::ApplicationDiscoveryService::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14 
ListServerNeighborsRequest()15 ListServerNeighborsRequest::ListServerNeighborsRequest() :
16     m_configurationIdHasBeenSet(false),
17     m_portInformationNeeded(false),
18     m_portInformationNeededHasBeenSet(false),
19     m_neighborConfigurationIdsHasBeenSet(false),
20     m_maxResults(0),
21     m_maxResultsHasBeenSet(false),
22     m_nextTokenHasBeenSet(false)
23 {
24 }
25 
SerializePayload() const26 Aws::String ListServerNeighborsRequest::SerializePayload() const
27 {
28   JsonValue payload;
29 
30   if(m_configurationIdHasBeenSet)
31   {
32    payload.WithString("configurationId", m_configurationId);
33 
34   }
35 
36   if(m_portInformationNeededHasBeenSet)
37   {
38    payload.WithBool("portInformationNeeded", m_portInformationNeeded);
39 
40   }
41 
42   if(m_neighborConfigurationIdsHasBeenSet)
43   {
44    Array<JsonValue> neighborConfigurationIdsJsonList(m_neighborConfigurationIds.size());
45    for(unsigned neighborConfigurationIdsIndex = 0; neighborConfigurationIdsIndex < neighborConfigurationIdsJsonList.GetLength(); ++neighborConfigurationIdsIndex)
46    {
47      neighborConfigurationIdsJsonList[neighborConfigurationIdsIndex].AsString(m_neighborConfigurationIds[neighborConfigurationIdsIndex]);
48    }
49    payload.WithArray("neighborConfigurationIds", std::move(neighborConfigurationIdsJsonList));
50 
51   }
52 
53   if(m_maxResultsHasBeenSet)
54   {
55    payload.WithInteger("maxResults", m_maxResults);
56 
57   }
58 
59   if(m_nextTokenHasBeenSet)
60   {
61    payload.WithString("nextToken", m_nextToken);
62 
63   }
64 
65   return payload.View().WriteReadable();
66 }
67 
GetRequestSpecificHeaders() const68 Aws::Http::HeaderValueCollection ListServerNeighborsRequest::GetRequestSpecificHeaders() const
69 {
70   Aws::Http::HeaderValueCollection headers;
71   headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSPoseidonService_V2015_11_01.ListServerNeighbors"));
72   return headers;
73 
74 }
75 
76 
77 
78 
79