1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/servicecatalog/model/ProvisioningArtifactParameter.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 ServiceCatalog
17 {
18 namespace Model
19 {
20 
ProvisioningArtifactParameter()21 ProvisioningArtifactParameter::ProvisioningArtifactParameter() :
22     m_parameterKeyHasBeenSet(false),
23     m_defaultValueHasBeenSet(false),
24     m_parameterTypeHasBeenSet(false),
25     m_isNoEcho(false),
26     m_isNoEchoHasBeenSet(false),
27     m_descriptionHasBeenSet(false),
28     m_parameterConstraintsHasBeenSet(false)
29 {
30 }
31 
ProvisioningArtifactParameter(JsonView jsonValue)32 ProvisioningArtifactParameter::ProvisioningArtifactParameter(JsonView jsonValue) :
33     m_parameterKeyHasBeenSet(false),
34     m_defaultValueHasBeenSet(false),
35     m_parameterTypeHasBeenSet(false),
36     m_isNoEcho(false),
37     m_isNoEchoHasBeenSet(false),
38     m_descriptionHasBeenSet(false),
39     m_parameterConstraintsHasBeenSet(false)
40 {
41   *this = jsonValue;
42 }
43 
operator =(JsonView jsonValue)44 ProvisioningArtifactParameter& ProvisioningArtifactParameter::operator =(JsonView jsonValue)
45 {
46   if(jsonValue.ValueExists("ParameterKey"))
47   {
48     m_parameterKey = jsonValue.GetString("ParameterKey");
49 
50     m_parameterKeyHasBeenSet = true;
51   }
52 
53   if(jsonValue.ValueExists("DefaultValue"))
54   {
55     m_defaultValue = jsonValue.GetString("DefaultValue");
56 
57     m_defaultValueHasBeenSet = true;
58   }
59 
60   if(jsonValue.ValueExists("ParameterType"))
61   {
62     m_parameterType = jsonValue.GetString("ParameterType");
63 
64     m_parameterTypeHasBeenSet = true;
65   }
66 
67   if(jsonValue.ValueExists("IsNoEcho"))
68   {
69     m_isNoEcho = jsonValue.GetBool("IsNoEcho");
70 
71     m_isNoEchoHasBeenSet = true;
72   }
73 
74   if(jsonValue.ValueExists("Description"))
75   {
76     m_description = jsonValue.GetString("Description");
77 
78     m_descriptionHasBeenSet = true;
79   }
80 
81   if(jsonValue.ValueExists("ParameterConstraints"))
82   {
83     m_parameterConstraints = jsonValue.GetObject("ParameterConstraints");
84 
85     m_parameterConstraintsHasBeenSet = true;
86   }
87 
88   return *this;
89 }
90 
Jsonize() const91 JsonValue ProvisioningArtifactParameter::Jsonize() const
92 {
93   JsonValue payload;
94 
95   if(m_parameterKeyHasBeenSet)
96   {
97    payload.WithString("ParameterKey", m_parameterKey);
98 
99   }
100 
101   if(m_defaultValueHasBeenSet)
102   {
103    payload.WithString("DefaultValue", m_defaultValue);
104 
105   }
106 
107   if(m_parameterTypeHasBeenSet)
108   {
109    payload.WithString("ParameterType", m_parameterType);
110 
111   }
112 
113   if(m_isNoEchoHasBeenSet)
114   {
115    payload.WithBool("IsNoEcho", m_isNoEcho);
116 
117   }
118 
119   if(m_descriptionHasBeenSet)
120   {
121    payload.WithString("Description", m_description);
122 
123   }
124 
125   if(m_parameterConstraintsHasBeenSet)
126   {
127    payload.WithObject("ParameterConstraints", m_parameterConstraints.Jsonize());
128 
129   }
130 
131   return payload;
132 }
133 
134 } // namespace Model
135 } // namespace ServiceCatalog
136 } // namespace Aws
137