1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/glue/model/LongColumnStatisticsData.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 Glue
17 {
18 namespace Model
19 {
20 
LongColumnStatisticsData()21 LongColumnStatisticsData::LongColumnStatisticsData() :
22     m_minimumValue(0),
23     m_minimumValueHasBeenSet(false),
24     m_maximumValue(0),
25     m_maximumValueHasBeenSet(false),
26     m_numberOfNulls(0),
27     m_numberOfNullsHasBeenSet(false),
28     m_numberOfDistinctValues(0),
29     m_numberOfDistinctValuesHasBeenSet(false)
30 {
31 }
32 
LongColumnStatisticsData(JsonView jsonValue)33 LongColumnStatisticsData::LongColumnStatisticsData(JsonView jsonValue) :
34     m_minimumValue(0),
35     m_minimumValueHasBeenSet(false),
36     m_maximumValue(0),
37     m_maximumValueHasBeenSet(false),
38     m_numberOfNulls(0),
39     m_numberOfNullsHasBeenSet(false),
40     m_numberOfDistinctValues(0),
41     m_numberOfDistinctValuesHasBeenSet(false)
42 {
43   *this = jsonValue;
44 }
45 
operator =(JsonView jsonValue)46 LongColumnStatisticsData& LongColumnStatisticsData::operator =(JsonView jsonValue)
47 {
48   if(jsonValue.ValueExists("MinimumValue"))
49   {
50     m_minimumValue = jsonValue.GetInt64("MinimumValue");
51 
52     m_minimumValueHasBeenSet = true;
53   }
54 
55   if(jsonValue.ValueExists("MaximumValue"))
56   {
57     m_maximumValue = jsonValue.GetInt64("MaximumValue");
58 
59     m_maximumValueHasBeenSet = true;
60   }
61 
62   if(jsonValue.ValueExists("NumberOfNulls"))
63   {
64     m_numberOfNulls = jsonValue.GetInt64("NumberOfNulls");
65 
66     m_numberOfNullsHasBeenSet = true;
67   }
68 
69   if(jsonValue.ValueExists("NumberOfDistinctValues"))
70   {
71     m_numberOfDistinctValues = jsonValue.GetInt64("NumberOfDistinctValues");
72 
73     m_numberOfDistinctValuesHasBeenSet = true;
74   }
75 
76   return *this;
77 }
78 
Jsonize() const79 JsonValue LongColumnStatisticsData::Jsonize() const
80 {
81   JsonValue payload;
82 
83   if(m_minimumValueHasBeenSet)
84   {
85    payload.WithInt64("MinimumValue", m_minimumValue);
86 
87   }
88 
89   if(m_maximumValueHasBeenSet)
90   {
91    payload.WithInt64("MaximumValue", m_maximumValue);
92 
93   }
94 
95   if(m_numberOfNullsHasBeenSet)
96   {
97    payload.WithInt64("NumberOfNulls", m_numberOfNulls);
98 
99   }
100 
101   if(m_numberOfDistinctValuesHasBeenSet)
102   {
103    payload.WithInt64("NumberOfDistinctValues", m_numberOfDistinctValues);
104 
105   }
106 
107   return payload;
108 }
109 
110 } // namespace Model
111 } // namespace Glue
112 } // namespace Aws
113