1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/opsworks/model/RaidArray.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 OpsWorks
17 {
18 namespace Model
19 {
20 
RaidArray()21 RaidArray::RaidArray() :
22     m_raidArrayIdHasBeenSet(false),
23     m_instanceIdHasBeenSet(false),
24     m_nameHasBeenSet(false),
25     m_raidLevel(0),
26     m_raidLevelHasBeenSet(false),
27     m_numberOfDisks(0),
28     m_numberOfDisksHasBeenSet(false),
29     m_size(0),
30     m_sizeHasBeenSet(false),
31     m_deviceHasBeenSet(false),
32     m_mountPointHasBeenSet(false),
33     m_availabilityZoneHasBeenSet(false),
34     m_createdAtHasBeenSet(false),
35     m_stackIdHasBeenSet(false),
36     m_volumeTypeHasBeenSet(false),
37     m_iops(0),
38     m_iopsHasBeenSet(false)
39 {
40 }
41 
RaidArray(JsonView jsonValue)42 RaidArray::RaidArray(JsonView jsonValue) :
43     m_raidArrayIdHasBeenSet(false),
44     m_instanceIdHasBeenSet(false),
45     m_nameHasBeenSet(false),
46     m_raidLevel(0),
47     m_raidLevelHasBeenSet(false),
48     m_numberOfDisks(0),
49     m_numberOfDisksHasBeenSet(false),
50     m_size(0),
51     m_sizeHasBeenSet(false),
52     m_deviceHasBeenSet(false),
53     m_mountPointHasBeenSet(false),
54     m_availabilityZoneHasBeenSet(false),
55     m_createdAtHasBeenSet(false),
56     m_stackIdHasBeenSet(false),
57     m_volumeTypeHasBeenSet(false),
58     m_iops(0),
59     m_iopsHasBeenSet(false)
60 {
61   *this = jsonValue;
62 }
63 
operator =(JsonView jsonValue)64 RaidArray& RaidArray::operator =(JsonView jsonValue)
65 {
66   if(jsonValue.ValueExists("RaidArrayId"))
67   {
68     m_raidArrayId = jsonValue.GetString("RaidArrayId");
69 
70     m_raidArrayIdHasBeenSet = true;
71   }
72 
73   if(jsonValue.ValueExists("InstanceId"))
74   {
75     m_instanceId = jsonValue.GetString("InstanceId");
76 
77     m_instanceIdHasBeenSet = true;
78   }
79 
80   if(jsonValue.ValueExists("Name"))
81   {
82     m_name = jsonValue.GetString("Name");
83 
84     m_nameHasBeenSet = true;
85   }
86 
87   if(jsonValue.ValueExists("RaidLevel"))
88   {
89     m_raidLevel = jsonValue.GetInteger("RaidLevel");
90 
91     m_raidLevelHasBeenSet = true;
92   }
93 
94   if(jsonValue.ValueExists("NumberOfDisks"))
95   {
96     m_numberOfDisks = jsonValue.GetInteger("NumberOfDisks");
97 
98     m_numberOfDisksHasBeenSet = true;
99   }
100 
101   if(jsonValue.ValueExists("Size"))
102   {
103     m_size = jsonValue.GetInteger("Size");
104 
105     m_sizeHasBeenSet = true;
106   }
107 
108   if(jsonValue.ValueExists("Device"))
109   {
110     m_device = jsonValue.GetString("Device");
111 
112     m_deviceHasBeenSet = true;
113   }
114 
115   if(jsonValue.ValueExists("MountPoint"))
116   {
117     m_mountPoint = jsonValue.GetString("MountPoint");
118 
119     m_mountPointHasBeenSet = true;
120   }
121 
122   if(jsonValue.ValueExists("AvailabilityZone"))
123   {
124     m_availabilityZone = jsonValue.GetString("AvailabilityZone");
125 
126     m_availabilityZoneHasBeenSet = true;
127   }
128 
129   if(jsonValue.ValueExists("CreatedAt"))
130   {
131     m_createdAt = jsonValue.GetString("CreatedAt");
132 
133     m_createdAtHasBeenSet = true;
134   }
135 
136   if(jsonValue.ValueExists("StackId"))
137   {
138     m_stackId = jsonValue.GetString("StackId");
139 
140     m_stackIdHasBeenSet = true;
141   }
142 
143   if(jsonValue.ValueExists("VolumeType"))
144   {
145     m_volumeType = jsonValue.GetString("VolumeType");
146 
147     m_volumeTypeHasBeenSet = true;
148   }
149 
150   if(jsonValue.ValueExists("Iops"))
151   {
152     m_iops = jsonValue.GetInteger("Iops");
153 
154     m_iopsHasBeenSet = true;
155   }
156 
157   return *this;
158 }
159 
Jsonize() const160 JsonValue RaidArray::Jsonize() const
161 {
162   JsonValue payload;
163 
164   if(m_raidArrayIdHasBeenSet)
165   {
166    payload.WithString("RaidArrayId", m_raidArrayId);
167 
168   }
169 
170   if(m_instanceIdHasBeenSet)
171   {
172    payload.WithString("InstanceId", m_instanceId);
173 
174   }
175 
176   if(m_nameHasBeenSet)
177   {
178    payload.WithString("Name", m_name);
179 
180   }
181 
182   if(m_raidLevelHasBeenSet)
183   {
184    payload.WithInteger("RaidLevel", m_raidLevel);
185 
186   }
187 
188   if(m_numberOfDisksHasBeenSet)
189   {
190    payload.WithInteger("NumberOfDisks", m_numberOfDisks);
191 
192   }
193 
194   if(m_sizeHasBeenSet)
195   {
196    payload.WithInteger("Size", m_size);
197 
198   }
199 
200   if(m_deviceHasBeenSet)
201   {
202    payload.WithString("Device", m_device);
203 
204   }
205 
206   if(m_mountPointHasBeenSet)
207   {
208    payload.WithString("MountPoint", m_mountPoint);
209 
210   }
211 
212   if(m_availabilityZoneHasBeenSet)
213   {
214    payload.WithString("AvailabilityZone", m_availabilityZone);
215 
216   }
217 
218   if(m_createdAtHasBeenSet)
219   {
220    payload.WithString("CreatedAt", m_createdAt);
221 
222   }
223 
224   if(m_stackIdHasBeenSet)
225   {
226    payload.WithString("StackId", m_stackId);
227 
228   }
229 
230   if(m_volumeTypeHasBeenSet)
231   {
232    payload.WithString("VolumeType", m_volumeType);
233 
234   }
235 
236   if(m_iopsHasBeenSet)
237   {
238    payload.WithInteger("Iops", m_iops);
239 
240   }
241 
242   return payload;
243 }
244 
245 } // namespace Model
246 } // namespace OpsWorks
247 } // namespace Aws
248