1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/codeguru-reviewer/model/AssociateRepositoryRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8
9 #include <utility>
10
11 using namespace Aws::CodeGuruReviewer::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14
AssociateRepositoryRequest()15 AssociateRepositoryRequest::AssociateRepositoryRequest() :
16 m_repositoryHasBeenSet(false),
17 m_clientRequestToken(Aws::Utils::UUID::RandomUUID()),
18 m_clientRequestTokenHasBeenSet(true),
19 m_tagsHasBeenSet(false),
20 m_kMSKeyDetailsHasBeenSet(false)
21 {
22 }
23
SerializePayload() const24 Aws::String AssociateRepositoryRequest::SerializePayload() const
25 {
26 JsonValue payload;
27
28 if(m_repositoryHasBeenSet)
29 {
30 payload.WithObject("Repository", m_repository.Jsonize());
31
32 }
33
34 if(m_clientRequestTokenHasBeenSet)
35 {
36 payload.WithString("ClientRequestToken", m_clientRequestToken);
37
38 }
39
40 if(m_tagsHasBeenSet)
41 {
42 JsonValue tagsJsonMap;
43 for(auto& tagsItem : m_tags)
44 {
45 tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
46 }
47 payload.WithObject("Tags", std::move(tagsJsonMap));
48
49 }
50
51 if(m_kMSKeyDetailsHasBeenSet)
52 {
53 payload.WithObject("KMSKeyDetails", m_kMSKeyDetails.Jsonize());
54
55 }
56
57 return payload.View().WriteReadable();
58 }
59
60
61
62
63