1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/memorydb/model/EngineVersionInfo.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 MemoryDB
17 {
18 namespace Model
19 {
20 
EngineVersionInfo()21 EngineVersionInfo::EngineVersionInfo() :
22     m_engineVersionHasBeenSet(false),
23     m_enginePatchVersionHasBeenSet(false),
24     m_parameterGroupFamilyHasBeenSet(false)
25 {
26 }
27 
EngineVersionInfo(JsonView jsonValue)28 EngineVersionInfo::EngineVersionInfo(JsonView jsonValue) :
29     m_engineVersionHasBeenSet(false),
30     m_enginePatchVersionHasBeenSet(false),
31     m_parameterGroupFamilyHasBeenSet(false)
32 {
33   *this = jsonValue;
34 }
35 
operator =(JsonView jsonValue)36 EngineVersionInfo& EngineVersionInfo::operator =(JsonView jsonValue)
37 {
38   if(jsonValue.ValueExists("EngineVersion"))
39   {
40     m_engineVersion = jsonValue.GetString("EngineVersion");
41 
42     m_engineVersionHasBeenSet = true;
43   }
44 
45   if(jsonValue.ValueExists("EnginePatchVersion"))
46   {
47     m_enginePatchVersion = jsonValue.GetString("EnginePatchVersion");
48 
49     m_enginePatchVersionHasBeenSet = true;
50   }
51 
52   if(jsonValue.ValueExists("ParameterGroupFamily"))
53   {
54     m_parameterGroupFamily = jsonValue.GetString("ParameterGroupFamily");
55 
56     m_parameterGroupFamilyHasBeenSet = true;
57   }
58 
59   return *this;
60 }
61 
Jsonize() const62 JsonValue EngineVersionInfo::Jsonize() const
63 {
64   JsonValue payload;
65 
66   if(m_engineVersionHasBeenSet)
67   {
68    payload.WithString("EngineVersion", m_engineVersion);
69 
70   }
71 
72   if(m_enginePatchVersionHasBeenSet)
73   {
74    payload.WithString("EnginePatchVersion", m_enginePatchVersion);
75 
76   }
77 
78   if(m_parameterGroupFamilyHasBeenSet)
79   {
80    payload.WithString("ParameterGroupFamily", m_parameterGroupFamily);
81 
82   }
83 
84   return payload;
85 }
86 
87 } // namespace Model
88 } // namespace MemoryDB
89 } // namespace Aws
90