1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/securityhub/model/AwsApiGatewayRestApiDetails.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 SecurityHub
17 {
18 namespace Model
19 {
20
AwsApiGatewayRestApiDetails()21 AwsApiGatewayRestApiDetails::AwsApiGatewayRestApiDetails() :
22 m_idHasBeenSet(false),
23 m_nameHasBeenSet(false),
24 m_descriptionHasBeenSet(false),
25 m_createdDateHasBeenSet(false),
26 m_versionHasBeenSet(false),
27 m_binaryMediaTypesHasBeenSet(false),
28 m_minimumCompressionSize(0),
29 m_minimumCompressionSizeHasBeenSet(false),
30 m_apiKeySourceHasBeenSet(false),
31 m_endpointConfigurationHasBeenSet(false)
32 {
33 }
34
AwsApiGatewayRestApiDetails(JsonView jsonValue)35 AwsApiGatewayRestApiDetails::AwsApiGatewayRestApiDetails(JsonView jsonValue) :
36 m_idHasBeenSet(false),
37 m_nameHasBeenSet(false),
38 m_descriptionHasBeenSet(false),
39 m_createdDateHasBeenSet(false),
40 m_versionHasBeenSet(false),
41 m_binaryMediaTypesHasBeenSet(false),
42 m_minimumCompressionSize(0),
43 m_minimumCompressionSizeHasBeenSet(false),
44 m_apiKeySourceHasBeenSet(false),
45 m_endpointConfigurationHasBeenSet(false)
46 {
47 *this = jsonValue;
48 }
49
operator =(JsonView jsonValue)50 AwsApiGatewayRestApiDetails& AwsApiGatewayRestApiDetails::operator =(JsonView jsonValue)
51 {
52 if(jsonValue.ValueExists("Id"))
53 {
54 m_id = jsonValue.GetString("Id");
55
56 m_idHasBeenSet = true;
57 }
58
59 if(jsonValue.ValueExists("Name"))
60 {
61 m_name = jsonValue.GetString("Name");
62
63 m_nameHasBeenSet = true;
64 }
65
66 if(jsonValue.ValueExists("Description"))
67 {
68 m_description = jsonValue.GetString("Description");
69
70 m_descriptionHasBeenSet = true;
71 }
72
73 if(jsonValue.ValueExists("CreatedDate"))
74 {
75 m_createdDate = jsonValue.GetString("CreatedDate");
76
77 m_createdDateHasBeenSet = true;
78 }
79
80 if(jsonValue.ValueExists("Version"))
81 {
82 m_version = jsonValue.GetString("Version");
83
84 m_versionHasBeenSet = true;
85 }
86
87 if(jsonValue.ValueExists("BinaryMediaTypes"))
88 {
89 Array<JsonView> binaryMediaTypesJsonList = jsonValue.GetArray("BinaryMediaTypes");
90 for(unsigned binaryMediaTypesIndex = 0; binaryMediaTypesIndex < binaryMediaTypesJsonList.GetLength(); ++binaryMediaTypesIndex)
91 {
92 m_binaryMediaTypes.push_back(binaryMediaTypesJsonList[binaryMediaTypesIndex].AsString());
93 }
94 m_binaryMediaTypesHasBeenSet = true;
95 }
96
97 if(jsonValue.ValueExists("MinimumCompressionSize"))
98 {
99 m_minimumCompressionSize = jsonValue.GetInteger("MinimumCompressionSize");
100
101 m_minimumCompressionSizeHasBeenSet = true;
102 }
103
104 if(jsonValue.ValueExists("ApiKeySource"))
105 {
106 m_apiKeySource = jsonValue.GetString("ApiKeySource");
107
108 m_apiKeySourceHasBeenSet = true;
109 }
110
111 if(jsonValue.ValueExists("EndpointConfiguration"))
112 {
113 m_endpointConfiguration = jsonValue.GetObject("EndpointConfiguration");
114
115 m_endpointConfigurationHasBeenSet = true;
116 }
117
118 return *this;
119 }
120
Jsonize() const121 JsonValue AwsApiGatewayRestApiDetails::Jsonize() const
122 {
123 JsonValue payload;
124
125 if(m_idHasBeenSet)
126 {
127 payload.WithString("Id", m_id);
128
129 }
130
131 if(m_nameHasBeenSet)
132 {
133 payload.WithString("Name", m_name);
134
135 }
136
137 if(m_descriptionHasBeenSet)
138 {
139 payload.WithString("Description", m_description);
140
141 }
142
143 if(m_createdDateHasBeenSet)
144 {
145 payload.WithString("CreatedDate", m_createdDate);
146
147 }
148
149 if(m_versionHasBeenSet)
150 {
151 payload.WithString("Version", m_version);
152
153 }
154
155 if(m_binaryMediaTypesHasBeenSet)
156 {
157 Array<JsonValue> binaryMediaTypesJsonList(m_binaryMediaTypes.size());
158 for(unsigned binaryMediaTypesIndex = 0; binaryMediaTypesIndex < binaryMediaTypesJsonList.GetLength(); ++binaryMediaTypesIndex)
159 {
160 binaryMediaTypesJsonList[binaryMediaTypesIndex].AsString(m_binaryMediaTypes[binaryMediaTypesIndex]);
161 }
162 payload.WithArray("BinaryMediaTypes", std::move(binaryMediaTypesJsonList));
163
164 }
165
166 if(m_minimumCompressionSizeHasBeenSet)
167 {
168 payload.WithInteger("MinimumCompressionSize", m_minimumCompressionSize);
169
170 }
171
172 if(m_apiKeySourceHasBeenSet)
173 {
174 payload.WithString("ApiKeySource", m_apiKeySource);
175
176 }
177
178 if(m_endpointConfigurationHasBeenSet)
179 {
180 payload.WithObject("EndpointConfiguration", m_endpointConfiguration.Jsonize());
181
182 }
183
184 return payload;
185 }
186
187 } // namespace Model
188 } // namespace SecurityHub
189 } // namespace Aws
190