1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/codeguruprofiler/model/FindingsReportSummary.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8
9 #include <utility>
10
11 using namespace Aws::Utils::Json;
12 using namespace Aws::Utils;
13
14 namespace Aws
15 {
16 namespace CodeGuruProfiler
17 {
18 namespace Model
19 {
20
FindingsReportSummary()21 FindingsReportSummary::FindingsReportSummary() :
22 m_idHasBeenSet(false),
23 m_profileEndTimeHasBeenSet(false),
24 m_profileStartTimeHasBeenSet(false),
25 m_profilingGroupNameHasBeenSet(false),
26 m_totalNumberOfFindings(0),
27 m_totalNumberOfFindingsHasBeenSet(false)
28 {
29 }
30
FindingsReportSummary(JsonView jsonValue)31 FindingsReportSummary::FindingsReportSummary(JsonView jsonValue) :
32 m_idHasBeenSet(false),
33 m_profileEndTimeHasBeenSet(false),
34 m_profileStartTimeHasBeenSet(false),
35 m_profilingGroupNameHasBeenSet(false),
36 m_totalNumberOfFindings(0),
37 m_totalNumberOfFindingsHasBeenSet(false)
38 {
39 *this = jsonValue;
40 }
41
operator =(JsonView jsonValue)42 FindingsReportSummary& FindingsReportSummary::operator =(JsonView jsonValue)
43 {
44 if(jsonValue.ValueExists("id"))
45 {
46 m_id = jsonValue.GetString("id");
47
48 m_idHasBeenSet = true;
49 }
50
51 if(jsonValue.ValueExists("profileEndTime"))
52 {
53 m_profileEndTime = jsonValue.GetString("profileEndTime");
54
55 m_profileEndTimeHasBeenSet = true;
56 }
57
58 if(jsonValue.ValueExists("profileStartTime"))
59 {
60 m_profileStartTime = jsonValue.GetString("profileStartTime");
61
62 m_profileStartTimeHasBeenSet = true;
63 }
64
65 if(jsonValue.ValueExists("profilingGroupName"))
66 {
67 m_profilingGroupName = jsonValue.GetString("profilingGroupName");
68
69 m_profilingGroupNameHasBeenSet = true;
70 }
71
72 if(jsonValue.ValueExists("totalNumberOfFindings"))
73 {
74 m_totalNumberOfFindings = jsonValue.GetInteger("totalNumberOfFindings");
75
76 m_totalNumberOfFindingsHasBeenSet = true;
77 }
78
79 return *this;
80 }
81
Jsonize() const82 JsonValue FindingsReportSummary::Jsonize() const
83 {
84 JsonValue payload;
85
86 if(m_idHasBeenSet)
87 {
88 payload.WithString("id", m_id);
89
90 }
91
92 if(m_profileEndTimeHasBeenSet)
93 {
94 payload.WithString("profileEndTime", m_profileEndTime.ToGmtString(DateFormat::ISO_8601));
95 }
96
97 if(m_profileStartTimeHasBeenSet)
98 {
99 payload.WithString("profileStartTime", m_profileStartTime.ToGmtString(DateFormat::ISO_8601));
100 }
101
102 if(m_profilingGroupNameHasBeenSet)
103 {
104 payload.WithString("profilingGroupName", m_profilingGroupName);
105
106 }
107
108 if(m_totalNumberOfFindingsHasBeenSet)
109 {
110 payload.WithInteger("totalNumberOfFindings", m_totalNumberOfFindings);
111
112 }
113
114 return payload;
115 }
116
117 } // namespace Model
118 } // namespace CodeGuruProfiler
119 } // namespace Aws
120