1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/dlm/model/Parameters.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 DLM
17 {
18 namespace Model
19 {
20 
Parameters()21 Parameters::Parameters() :
22     m_excludeBootVolume(false),
23     m_excludeBootVolumeHasBeenSet(false),
24     m_noReboot(false),
25     m_noRebootHasBeenSet(false)
26 {
27 }
28 
Parameters(JsonView jsonValue)29 Parameters::Parameters(JsonView jsonValue) :
30     m_excludeBootVolume(false),
31     m_excludeBootVolumeHasBeenSet(false),
32     m_noReboot(false),
33     m_noRebootHasBeenSet(false)
34 {
35   *this = jsonValue;
36 }
37 
operator =(JsonView jsonValue)38 Parameters& Parameters::operator =(JsonView jsonValue)
39 {
40   if(jsonValue.ValueExists("ExcludeBootVolume"))
41   {
42     m_excludeBootVolume = jsonValue.GetBool("ExcludeBootVolume");
43 
44     m_excludeBootVolumeHasBeenSet = true;
45   }
46 
47   if(jsonValue.ValueExists("NoReboot"))
48   {
49     m_noReboot = jsonValue.GetBool("NoReboot");
50 
51     m_noRebootHasBeenSet = true;
52   }
53 
54   return *this;
55 }
56 
Jsonize() const57 JsonValue Parameters::Jsonize() const
58 {
59   JsonValue payload;
60 
61   if(m_excludeBootVolumeHasBeenSet)
62   {
63    payload.WithBool("ExcludeBootVolume", m_excludeBootVolume);
64 
65   }
66 
67   if(m_noRebootHasBeenSet)
68   {
69    payload.WithBool("NoReboot", m_noReboot);
70 
71   }
72 
73   return payload;
74 }
75 
76 } // namespace Model
77 } // namespace DLM
78 } // namespace Aws
79