1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/accessanalyzer/model/UpdateFindingsRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::AccessAnalyzer::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14 
UpdateFindingsRequest()15 UpdateFindingsRequest::UpdateFindingsRequest() :
16     m_analyzerArnHasBeenSet(false),
17     m_clientToken(Aws::Utils::UUID::RandomUUID()),
18     m_clientTokenHasBeenSet(true),
19     m_idsHasBeenSet(false),
20     m_resourceArnHasBeenSet(false),
21     m_status(FindingStatusUpdate::NOT_SET),
22     m_statusHasBeenSet(false)
23 {
24 }
25 
SerializePayload() const26 Aws::String UpdateFindingsRequest::SerializePayload() const
27 {
28   JsonValue payload;
29 
30   if(m_analyzerArnHasBeenSet)
31   {
32    payload.WithString("analyzerArn", m_analyzerArn);
33 
34   }
35 
36   if(m_clientTokenHasBeenSet)
37   {
38    payload.WithString("clientToken", m_clientToken);
39 
40   }
41 
42   if(m_idsHasBeenSet)
43   {
44    Array<JsonValue> idsJsonList(m_ids.size());
45    for(unsigned idsIndex = 0; idsIndex < idsJsonList.GetLength(); ++idsIndex)
46    {
47      idsJsonList[idsIndex].AsString(m_ids[idsIndex]);
48    }
49    payload.WithArray("ids", std::move(idsJsonList));
50 
51   }
52 
53   if(m_resourceArnHasBeenSet)
54   {
55    payload.WithString("resourceArn", m_resourceArn);
56 
57   }
58 
59   if(m_statusHasBeenSet)
60   {
61    payload.WithString("status", FindingStatusUpdateMapper::GetNameForFindingStatusUpdate(m_status));
62   }
63 
64   return payload.View().WriteReadable();
65 }
66 
67 
68 
69 
70