1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/docdb/model/DBCluster.h>
7 #include <aws/core/utils/xml/XmlSerializer.h>
8 #include <aws/core/utils/StringUtils.h>
9 #include <aws/core/utils/memory/stl/AWSStringStream.h>
10
11 #include <utility>
12
13 using namespace Aws::Utils::Xml;
14 using namespace Aws::Utils;
15
16 namespace Aws
17 {
18 namespace DocDB
19 {
20 namespace Model
21 {
22
DBCluster()23 DBCluster::DBCluster() :
24 m_availabilityZonesHasBeenSet(false),
25 m_backupRetentionPeriod(0),
26 m_backupRetentionPeriodHasBeenSet(false),
27 m_dBClusterIdentifierHasBeenSet(false),
28 m_dBClusterParameterGroupHasBeenSet(false),
29 m_dBSubnetGroupHasBeenSet(false),
30 m_statusHasBeenSet(false),
31 m_percentProgressHasBeenSet(false),
32 m_earliestRestorableTimeHasBeenSet(false),
33 m_endpointHasBeenSet(false),
34 m_readerEndpointHasBeenSet(false),
35 m_multiAZ(false),
36 m_multiAZHasBeenSet(false),
37 m_engineHasBeenSet(false),
38 m_engineVersionHasBeenSet(false),
39 m_latestRestorableTimeHasBeenSet(false),
40 m_port(0),
41 m_portHasBeenSet(false),
42 m_masterUsernameHasBeenSet(false),
43 m_preferredBackupWindowHasBeenSet(false),
44 m_preferredMaintenanceWindowHasBeenSet(false),
45 m_replicationSourceIdentifierHasBeenSet(false),
46 m_readReplicaIdentifiersHasBeenSet(false),
47 m_dBClusterMembersHasBeenSet(false),
48 m_vpcSecurityGroupsHasBeenSet(false),
49 m_hostedZoneIdHasBeenSet(false),
50 m_storageEncrypted(false),
51 m_storageEncryptedHasBeenSet(false),
52 m_kmsKeyIdHasBeenSet(false),
53 m_dbClusterResourceIdHasBeenSet(false),
54 m_dBClusterArnHasBeenSet(false),
55 m_associatedRolesHasBeenSet(false),
56 m_clusterCreateTimeHasBeenSet(false),
57 m_enabledCloudwatchLogsExportsHasBeenSet(false),
58 m_deletionProtection(false),
59 m_deletionProtectionHasBeenSet(false)
60 {
61 }
62
DBCluster(const XmlNode & xmlNode)63 DBCluster::DBCluster(const XmlNode& xmlNode) :
64 m_availabilityZonesHasBeenSet(false),
65 m_backupRetentionPeriod(0),
66 m_backupRetentionPeriodHasBeenSet(false),
67 m_dBClusterIdentifierHasBeenSet(false),
68 m_dBClusterParameterGroupHasBeenSet(false),
69 m_dBSubnetGroupHasBeenSet(false),
70 m_statusHasBeenSet(false),
71 m_percentProgressHasBeenSet(false),
72 m_earliestRestorableTimeHasBeenSet(false),
73 m_endpointHasBeenSet(false),
74 m_readerEndpointHasBeenSet(false),
75 m_multiAZ(false),
76 m_multiAZHasBeenSet(false),
77 m_engineHasBeenSet(false),
78 m_engineVersionHasBeenSet(false),
79 m_latestRestorableTimeHasBeenSet(false),
80 m_port(0),
81 m_portHasBeenSet(false),
82 m_masterUsernameHasBeenSet(false),
83 m_preferredBackupWindowHasBeenSet(false),
84 m_preferredMaintenanceWindowHasBeenSet(false),
85 m_replicationSourceIdentifierHasBeenSet(false),
86 m_readReplicaIdentifiersHasBeenSet(false),
87 m_dBClusterMembersHasBeenSet(false),
88 m_vpcSecurityGroupsHasBeenSet(false),
89 m_hostedZoneIdHasBeenSet(false),
90 m_storageEncrypted(false),
91 m_storageEncryptedHasBeenSet(false),
92 m_kmsKeyIdHasBeenSet(false),
93 m_dbClusterResourceIdHasBeenSet(false),
94 m_dBClusterArnHasBeenSet(false),
95 m_associatedRolesHasBeenSet(false),
96 m_clusterCreateTimeHasBeenSet(false),
97 m_enabledCloudwatchLogsExportsHasBeenSet(false),
98 m_deletionProtection(false),
99 m_deletionProtectionHasBeenSet(false)
100 {
101 *this = xmlNode;
102 }
103
operator =(const XmlNode & xmlNode)104 DBCluster& DBCluster::operator =(const XmlNode& xmlNode)
105 {
106 XmlNode resultNode = xmlNode;
107
108 if(!resultNode.IsNull())
109 {
110 XmlNode availabilityZonesNode = resultNode.FirstChild("AvailabilityZones");
111 if(!availabilityZonesNode.IsNull())
112 {
113 XmlNode availabilityZonesMember = availabilityZonesNode.FirstChild("AvailabilityZone");
114 while(!availabilityZonesMember.IsNull())
115 {
116 m_availabilityZones.push_back(availabilityZonesMember.GetText());
117 availabilityZonesMember = availabilityZonesMember.NextNode("AvailabilityZone");
118 }
119
120 m_availabilityZonesHasBeenSet = true;
121 }
122 XmlNode backupRetentionPeriodNode = resultNode.FirstChild("BackupRetentionPeriod");
123 if(!backupRetentionPeriodNode.IsNull())
124 {
125 m_backupRetentionPeriod = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(backupRetentionPeriodNode.GetText()).c_str()).c_str());
126 m_backupRetentionPeriodHasBeenSet = true;
127 }
128 XmlNode dBClusterIdentifierNode = resultNode.FirstChild("DBClusterIdentifier");
129 if(!dBClusterIdentifierNode.IsNull())
130 {
131 m_dBClusterIdentifier = Aws::Utils::Xml::DecodeEscapedXmlText(dBClusterIdentifierNode.GetText());
132 m_dBClusterIdentifierHasBeenSet = true;
133 }
134 XmlNode dBClusterParameterGroupNode = resultNode.FirstChild("DBClusterParameterGroup");
135 if(!dBClusterParameterGroupNode.IsNull())
136 {
137 m_dBClusterParameterGroup = Aws::Utils::Xml::DecodeEscapedXmlText(dBClusterParameterGroupNode.GetText());
138 m_dBClusterParameterGroupHasBeenSet = true;
139 }
140 XmlNode dBSubnetGroupNode = resultNode.FirstChild("DBSubnetGroup");
141 if(!dBSubnetGroupNode.IsNull())
142 {
143 m_dBSubnetGroup = Aws::Utils::Xml::DecodeEscapedXmlText(dBSubnetGroupNode.GetText());
144 m_dBSubnetGroupHasBeenSet = true;
145 }
146 XmlNode statusNode = resultNode.FirstChild("Status");
147 if(!statusNode.IsNull())
148 {
149 m_status = Aws::Utils::Xml::DecodeEscapedXmlText(statusNode.GetText());
150 m_statusHasBeenSet = true;
151 }
152 XmlNode percentProgressNode = resultNode.FirstChild("PercentProgress");
153 if(!percentProgressNode.IsNull())
154 {
155 m_percentProgress = Aws::Utils::Xml::DecodeEscapedXmlText(percentProgressNode.GetText());
156 m_percentProgressHasBeenSet = true;
157 }
158 XmlNode earliestRestorableTimeNode = resultNode.FirstChild("EarliestRestorableTime");
159 if(!earliestRestorableTimeNode.IsNull())
160 {
161 m_earliestRestorableTime = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(earliestRestorableTimeNode.GetText()).c_str()).c_str(), DateFormat::ISO_8601);
162 m_earliestRestorableTimeHasBeenSet = true;
163 }
164 XmlNode endpointNode = resultNode.FirstChild("Endpoint");
165 if(!endpointNode.IsNull())
166 {
167 m_endpoint = Aws::Utils::Xml::DecodeEscapedXmlText(endpointNode.GetText());
168 m_endpointHasBeenSet = true;
169 }
170 XmlNode readerEndpointNode = resultNode.FirstChild("ReaderEndpoint");
171 if(!readerEndpointNode.IsNull())
172 {
173 m_readerEndpoint = Aws::Utils::Xml::DecodeEscapedXmlText(readerEndpointNode.GetText());
174 m_readerEndpointHasBeenSet = true;
175 }
176 XmlNode multiAZNode = resultNode.FirstChild("MultiAZ");
177 if(!multiAZNode.IsNull())
178 {
179 m_multiAZ = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(multiAZNode.GetText()).c_str()).c_str());
180 m_multiAZHasBeenSet = true;
181 }
182 XmlNode engineNode = resultNode.FirstChild("Engine");
183 if(!engineNode.IsNull())
184 {
185 m_engine = Aws::Utils::Xml::DecodeEscapedXmlText(engineNode.GetText());
186 m_engineHasBeenSet = true;
187 }
188 XmlNode engineVersionNode = resultNode.FirstChild("EngineVersion");
189 if(!engineVersionNode.IsNull())
190 {
191 m_engineVersion = Aws::Utils::Xml::DecodeEscapedXmlText(engineVersionNode.GetText());
192 m_engineVersionHasBeenSet = true;
193 }
194 XmlNode latestRestorableTimeNode = resultNode.FirstChild("LatestRestorableTime");
195 if(!latestRestorableTimeNode.IsNull())
196 {
197 m_latestRestorableTime = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(latestRestorableTimeNode.GetText()).c_str()).c_str(), DateFormat::ISO_8601);
198 m_latestRestorableTimeHasBeenSet = true;
199 }
200 XmlNode portNode = resultNode.FirstChild("Port");
201 if(!portNode.IsNull())
202 {
203 m_port = StringUtils::ConvertToInt32(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(portNode.GetText()).c_str()).c_str());
204 m_portHasBeenSet = true;
205 }
206 XmlNode masterUsernameNode = resultNode.FirstChild("MasterUsername");
207 if(!masterUsernameNode.IsNull())
208 {
209 m_masterUsername = Aws::Utils::Xml::DecodeEscapedXmlText(masterUsernameNode.GetText());
210 m_masterUsernameHasBeenSet = true;
211 }
212 XmlNode preferredBackupWindowNode = resultNode.FirstChild("PreferredBackupWindow");
213 if(!preferredBackupWindowNode.IsNull())
214 {
215 m_preferredBackupWindow = Aws::Utils::Xml::DecodeEscapedXmlText(preferredBackupWindowNode.GetText());
216 m_preferredBackupWindowHasBeenSet = true;
217 }
218 XmlNode preferredMaintenanceWindowNode = resultNode.FirstChild("PreferredMaintenanceWindow");
219 if(!preferredMaintenanceWindowNode.IsNull())
220 {
221 m_preferredMaintenanceWindow = Aws::Utils::Xml::DecodeEscapedXmlText(preferredMaintenanceWindowNode.GetText());
222 m_preferredMaintenanceWindowHasBeenSet = true;
223 }
224 XmlNode replicationSourceIdentifierNode = resultNode.FirstChild("ReplicationSourceIdentifier");
225 if(!replicationSourceIdentifierNode.IsNull())
226 {
227 m_replicationSourceIdentifier = Aws::Utils::Xml::DecodeEscapedXmlText(replicationSourceIdentifierNode.GetText());
228 m_replicationSourceIdentifierHasBeenSet = true;
229 }
230 XmlNode readReplicaIdentifiersNode = resultNode.FirstChild("ReadReplicaIdentifiers");
231 if(!readReplicaIdentifiersNode.IsNull())
232 {
233 XmlNode readReplicaIdentifiersMember = readReplicaIdentifiersNode.FirstChild("ReadReplicaIdentifier");
234 while(!readReplicaIdentifiersMember.IsNull())
235 {
236 m_readReplicaIdentifiers.push_back(readReplicaIdentifiersMember.GetText());
237 readReplicaIdentifiersMember = readReplicaIdentifiersMember.NextNode("ReadReplicaIdentifier");
238 }
239
240 m_readReplicaIdentifiersHasBeenSet = true;
241 }
242 XmlNode dBClusterMembersNode = resultNode.FirstChild("DBClusterMembers");
243 if(!dBClusterMembersNode.IsNull())
244 {
245 XmlNode dBClusterMembersMember = dBClusterMembersNode.FirstChild("DBClusterMember");
246 while(!dBClusterMembersMember.IsNull())
247 {
248 m_dBClusterMembers.push_back(dBClusterMembersMember);
249 dBClusterMembersMember = dBClusterMembersMember.NextNode("DBClusterMember");
250 }
251
252 m_dBClusterMembersHasBeenSet = true;
253 }
254 XmlNode vpcSecurityGroupsNode = resultNode.FirstChild("VpcSecurityGroups");
255 if(!vpcSecurityGroupsNode.IsNull())
256 {
257 XmlNode vpcSecurityGroupsMember = vpcSecurityGroupsNode.FirstChild("VpcSecurityGroupMembership");
258 while(!vpcSecurityGroupsMember.IsNull())
259 {
260 m_vpcSecurityGroups.push_back(vpcSecurityGroupsMember);
261 vpcSecurityGroupsMember = vpcSecurityGroupsMember.NextNode("VpcSecurityGroupMembership");
262 }
263
264 m_vpcSecurityGroupsHasBeenSet = true;
265 }
266 XmlNode hostedZoneIdNode = resultNode.FirstChild("HostedZoneId");
267 if(!hostedZoneIdNode.IsNull())
268 {
269 m_hostedZoneId = Aws::Utils::Xml::DecodeEscapedXmlText(hostedZoneIdNode.GetText());
270 m_hostedZoneIdHasBeenSet = true;
271 }
272 XmlNode storageEncryptedNode = resultNode.FirstChild("StorageEncrypted");
273 if(!storageEncryptedNode.IsNull())
274 {
275 m_storageEncrypted = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(storageEncryptedNode.GetText()).c_str()).c_str());
276 m_storageEncryptedHasBeenSet = true;
277 }
278 XmlNode kmsKeyIdNode = resultNode.FirstChild("KmsKeyId");
279 if(!kmsKeyIdNode.IsNull())
280 {
281 m_kmsKeyId = Aws::Utils::Xml::DecodeEscapedXmlText(kmsKeyIdNode.GetText());
282 m_kmsKeyIdHasBeenSet = true;
283 }
284 XmlNode dbClusterResourceIdNode = resultNode.FirstChild("DbClusterResourceId");
285 if(!dbClusterResourceIdNode.IsNull())
286 {
287 m_dbClusterResourceId = Aws::Utils::Xml::DecodeEscapedXmlText(dbClusterResourceIdNode.GetText());
288 m_dbClusterResourceIdHasBeenSet = true;
289 }
290 XmlNode dBClusterArnNode = resultNode.FirstChild("DBClusterArn");
291 if(!dBClusterArnNode.IsNull())
292 {
293 m_dBClusterArn = Aws::Utils::Xml::DecodeEscapedXmlText(dBClusterArnNode.GetText());
294 m_dBClusterArnHasBeenSet = true;
295 }
296 XmlNode associatedRolesNode = resultNode.FirstChild("AssociatedRoles");
297 if(!associatedRolesNode.IsNull())
298 {
299 XmlNode associatedRolesMember = associatedRolesNode.FirstChild("DBClusterRole");
300 while(!associatedRolesMember.IsNull())
301 {
302 m_associatedRoles.push_back(associatedRolesMember);
303 associatedRolesMember = associatedRolesMember.NextNode("DBClusterRole");
304 }
305
306 m_associatedRolesHasBeenSet = true;
307 }
308 XmlNode clusterCreateTimeNode = resultNode.FirstChild("ClusterCreateTime");
309 if(!clusterCreateTimeNode.IsNull())
310 {
311 m_clusterCreateTime = DateTime(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(clusterCreateTimeNode.GetText()).c_str()).c_str(), DateFormat::ISO_8601);
312 m_clusterCreateTimeHasBeenSet = true;
313 }
314 XmlNode enabledCloudwatchLogsExportsNode = resultNode.FirstChild("EnabledCloudwatchLogsExports");
315 if(!enabledCloudwatchLogsExportsNode.IsNull())
316 {
317 XmlNode enabledCloudwatchLogsExportsMember = enabledCloudwatchLogsExportsNode.FirstChild("member");
318 while(!enabledCloudwatchLogsExportsMember.IsNull())
319 {
320 m_enabledCloudwatchLogsExports.push_back(enabledCloudwatchLogsExportsMember.GetText());
321 enabledCloudwatchLogsExportsMember = enabledCloudwatchLogsExportsMember.NextNode("member");
322 }
323
324 m_enabledCloudwatchLogsExportsHasBeenSet = true;
325 }
326 XmlNode deletionProtectionNode = resultNode.FirstChild("DeletionProtection");
327 if(!deletionProtectionNode.IsNull())
328 {
329 m_deletionProtection = StringUtils::ConvertToBool(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(deletionProtectionNode.GetText()).c_str()).c_str());
330 m_deletionProtectionHasBeenSet = true;
331 }
332 }
333
334 return *this;
335 }
336
OutputToStream(Aws::OStream & oStream,const char * location,unsigned index,const char * locationValue) const337 void DBCluster::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
338 {
339 if(m_availabilityZonesHasBeenSet)
340 {
341 unsigned availabilityZonesIdx = 1;
342 for(auto& item : m_availabilityZones)
343 {
344 oStream << location << index << locationValue << ".AvailabilityZone." << availabilityZonesIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
345 }
346 }
347
348 if(m_backupRetentionPeriodHasBeenSet)
349 {
350 oStream << location << index << locationValue << ".BackupRetentionPeriod=" << m_backupRetentionPeriod << "&";
351 }
352
353 if(m_dBClusterIdentifierHasBeenSet)
354 {
355 oStream << location << index << locationValue << ".DBClusterIdentifier=" << StringUtils::URLEncode(m_dBClusterIdentifier.c_str()) << "&";
356 }
357
358 if(m_dBClusterParameterGroupHasBeenSet)
359 {
360 oStream << location << index << locationValue << ".DBClusterParameterGroup=" << StringUtils::URLEncode(m_dBClusterParameterGroup.c_str()) << "&";
361 }
362
363 if(m_dBSubnetGroupHasBeenSet)
364 {
365 oStream << location << index << locationValue << ".DBSubnetGroup=" << StringUtils::URLEncode(m_dBSubnetGroup.c_str()) << "&";
366 }
367
368 if(m_statusHasBeenSet)
369 {
370 oStream << location << index << locationValue << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&";
371 }
372
373 if(m_percentProgressHasBeenSet)
374 {
375 oStream << location << index << locationValue << ".PercentProgress=" << StringUtils::URLEncode(m_percentProgress.c_str()) << "&";
376 }
377
378 if(m_earliestRestorableTimeHasBeenSet)
379 {
380 oStream << location << index << locationValue << ".EarliestRestorableTime=" << StringUtils::URLEncode(m_earliestRestorableTime.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
381 }
382
383 if(m_endpointHasBeenSet)
384 {
385 oStream << location << index << locationValue << ".Endpoint=" << StringUtils::URLEncode(m_endpoint.c_str()) << "&";
386 }
387
388 if(m_readerEndpointHasBeenSet)
389 {
390 oStream << location << index << locationValue << ".ReaderEndpoint=" << StringUtils::URLEncode(m_readerEndpoint.c_str()) << "&";
391 }
392
393 if(m_multiAZHasBeenSet)
394 {
395 oStream << location << index << locationValue << ".MultiAZ=" << std::boolalpha << m_multiAZ << "&";
396 }
397
398 if(m_engineHasBeenSet)
399 {
400 oStream << location << index << locationValue << ".Engine=" << StringUtils::URLEncode(m_engine.c_str()) << "&";
401 }
402
403 if(m_engineVersionHasBeenSet)
404 {
405 oStream << location << index << locationValue << ".EngineVersion=" << StringUtils::URLEncode(m_engineVersion.c_str()) << "&";
406 }
407
408 if(m_latestRestorableTimeHasBeenSet)
409 {
410 oStream << location << index << locationValue << ".LatestRestorableTime=" << StringUtils::URLEncode(m_latestRestorableTime.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
411 }
412
413 if(m_portHasBeenSet)
414 {
415 oStream << location << index << locationValue << ".Port=" << m_port << "&";
416 }
417
418 if(m_masterUsernameHasBeenSet)
419 {
420 oStream << location << index << locationValue << ".MasterUsername=" << StringUtils::URLEncode(m_masterUsername.c_str()) << "&";
421 }
422
423 if(m_preferredBackupWindowHasBeenSet)
424 {
425 oStream << location << index << locationValue << ".PreferredBackupWindow=" << StringUtils::URLEncode(m_preferredBackupWindow.c_str()) << "&";
426 }
427
428 if(m_preferredMaintenanceWindowHasBeenSet)
429 {
430 oStream << location << index << locationValue << ".PreferredMaintenanceWindow=" << StringUtils::URLEncode(m_preferredMaintenanceWindow.c_str()) << "&";
431 }
432
433 if(m_replicationSourceIdentifierHasBeenSet)
434 {
435 oStream << location << index << locationValue << ".ReplicationSourceIdentifier=" << StringUtils::URLEncode(m_replicationSourceIdentifier.c_str()) << "&";
436 }
437
438 if(m_readReplicaIdentifiersHasBeenSet)
439 {
440 unsigned readReplicaIdentifiersIdx = 1;
441 for(auto& item : m_readReplicaIdentifiers)
442 {
443 oStream << location << index << locationValue << ".ReadReplicaIdentifier." << readReplicaIdentifiersIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
444 }
445 }
446
447 if(m_dBClusterMembersHasBeenSet)
448 {
449 unsigned dBClusterMembersIdx = 1;
450 for(auto& item : m_dBClusterMembers)
451 {
452 Aws::StringStream dBClusterMembersSs;
453 dBClusterMembersSs << location << index << locationValue << ".DBClusterMember." << dBClusterMembersIdx++;
454 item.OutputToStream(oStream, dBClusterMembersSs.str().c_str());
455 }
456 }
457
458 if(m_vpcSecurityGroupsHasBeenSet)
459 {
460 unsigned vpcSecurityGroupsIdx = 1;
461 for(auto& item : m_vpcSecurityGroups)
462 {
463 Aws::StringStream vpcSecurityGroupsSs;
464 vpcSecurityGroupsSs << location << index << locationValue << ".VpcSecurityGroupMembership." << vpcSecurityGroupsIdx++;
465 item.OutputToStream(oStream, vpcSecurityGroupsSs.str().c_str());
466 }
467 }
468
469 if(m_hostedZoneIdHasBeenSet)
470 {
471 oStream << location << index << locationValue << ".HostedZoneId=" << StringUtils::URLEncode(m_hostedZoneId.c_str()) << "&";
472 }
473
474 if(m_storageEncryptedHasBeenSet)
475 {
476 oStream << location << index << locationValue << ".StorageEncrypted=" << std::boolalpha << m_storageEncrypted << "&";
477 }
478
479 if(m_kmsKeyIdHasBeenSet)
480 {
481 oStream << location << index << locationValue << ".KmsKeyId=" << StringUtils::URLEncode(m_kmsKeyId.c_str()) << "&";
482 }
483
484 if(m_dbClusterResourceIdHasBeenSet)
485 {
486 oStream << location << index << locationValue << ".DbClusterResourceId=" << StringUtils::URLEncode(m_dbClusterResourceId.c_str()) << "&";
487 }
488
489 if(m_dBClusterArnHasBeenSet)
490 {
491 oStream << location << index << locationValue << ".DBClusterArn=" << StringUtils::URLEncode(m_dBClusterArn.c_str()) << "&";
492 }
493
494 if(m_associatedRolesHasBeenSet)
495 {
496 unsigned associatedRolesIdx = 1;
497 for(auto& item : m_associatedRoles)
498 {
499 Aws::StringStream associatedRolesSs;
500 associatedRolesSs << location << index << locationValue << ".DBClusterRole." << associatedRolesIdx++;
501 item.OutputToStream(oStream, associatedRolesSs.str().c_str());
502 }
503 }
504
505 if(m_clusterCreateTimeHasBeenSet)
506 {
507 oStream << location << index << locationValue << ".ClusterCreateTime=" << StringUtils::URLEncode(m_clusterCreateTime.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
508 }
509
510 if(m_enabledCloudwatchLogsExportsHasBeenSet)
511 {
512 unsigned enabledCloudwatchLogsExportsIdx = 1;
513 for(auto& item : m_enabledCloudwatchLogsExports)
514 {
515 oStream << location << index << locationValue << ".EnabledCloudwatchLogsExports.member." << enabledCloudwatchLogsExportsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
516 }
517 }
518
519 if(m_deletionProtectionHasBeenSet)
520 {
521 oStream << location << index << locationValue << ".DeletionProtection=" << std::boolalpha << m_deletionProtection << "&";
522 }
523
524 }
525
OutputToStream(Aws::OStream & oStream,const char * location) const526 void DBCluster::OutputToStream(Aws::OStream& oStream, const char* location) const
527 {
528 if(m_availabilityZonesHasBeenSet)
529 {
530 unsigned availabilityZonesIdx = 1;
531 for(auto& item : m_availabilityZones)
532 {
533 oStream << location << ".AvailabilityZone." << availabilityZonesIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
534 }
535 }
536 if(m_backupRetentionPeriodHasBeenSet)
537 {
538 oStream << location << ".BackupRetentionPeriod=" << m_backupRetentionPeriod << "&";
539 }
540 if(m_dBClusterIdentifierHasBeenSet)
541 {
542 oStream << location << ".DBClusterIdentifier=" << StringUtils::URLEncode(m_dBClusterIdentifier.c_str()) << "&";
543 }
544 if(m_dBClusterParameterGroupHasBeenSet)
545 {
546 oStream << location << ".DBClusterParameterGroup=" << StringUtils::URLEncode(m_dBClusterParameterGroup.c_str()) << "&";
547 }
548 if(m_dBSubnetGroupHasBeenSet)
549 {
550 oStream << location << ".DBSubnetGroup=" << StringUtils::URLEncode(m_dBSubnetGroup.c_str()) << "&";
551 }
552 if(m_statusHasBeenSet)
553 {
554 oStream << location << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&";
555 }
556 if(m_percentProgressHasBeenSet)
557 {
558 oStream << location << ".PercentProgress=" << StringUtils::URLEncode(m_percentProgress.c_str()) << "&";
559 }
560 if(m_earliestRestorableTimeHasBeenSet)
561 {
562 oStream << location << ".EarliestRestorableTime=" << StringUtils::URLEncode(m_earliestRestorableTime.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
563 }
564 if(m_endpointHasBeenSet)
565 {
566 oStream << location << ".Endpoint=" << StringUtils::URLEncode(m_endpoint.c_str()) << "&";
567 }
568 if(m_readerEndpointHasBeenSet)
569 {
570 oStream << location << ".ReaderEndpoint=" << StringUtils::URLEncode(m_readerEndpoint.c_str()) << "&";
571 }
572 if(m_multiAZHasBeenSet)
573 {
574 oStream << location << ".MultiAZ=" << std::boolalpha << m_multiAZ << "&";
575 }
576 if(m_engineHasBeenSet)
577 {
578 oStream << location << ".Engine=" << StringUtils::URLEncode(m_engine.c_str()) << "&";
579 }
580 if(m_engineVersionHasBeenSet)
581 {
582 oStream << location << ".EngineVersion=" << StringUtils::URLEncode(m_engineVersion.c_str()) << "&";
583 }
584 if(m_latestRestorableTimeHasBeenSet)
585 {
586 oStream << location << ".LatestRestorableTime=" << StringUtils::URLEncode(m_latestRestorableTime.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
587 }
588 if(m_portHasBeenSet)
589 {
590 oStream << location << ".Port=" << m_port << "&";
591 }
592 if(m_masterUsernameHasBeenSet)
593 {
594 oStream << location << ".MasterUsername=" << StringUtils::URLEncode(m_masterUsername.c_str()) << "&";
595 }
596 if(m_preferredBackupWindowHasBeenSet)
597 {
598 oStream << location << ".PreferredBackupWindow=" << StringUtils::URLEncode(m_preferredBackupWindow.c_str()) << "&";
599 }
600 if(m_preferredMaintenanceWindowHasBeenSet)
601 {
602 oStream << location << ".PreferredMaintenanceWindow=" << StringUtils::URLEncode(m_preferredMaintenanceWindow.c_str()) << "&";
603 }
604 if(m_replicationSourceIdentifierHasBeenSet)
605 {
606 oStream << location << ".ReplicationSourceIdentifier=" << StringUtils::URLEncode(m_replicationSourceIdentifier.c_str()) << "&";
607 }
608 if(m_readReplicaIdentifiersHasBeenSet)
609 {
610 unsigned readReplicaIdentifiersIdx = 1;
611 for(auto& item : m_readReplicaIdentifiers)
612 {
613 oStream << location << ".ReadReplicaIdentifier." << readReplicaIdentifiersIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
614 }
615 }
616 if(m_dBClusterMembersHasBeenSet)
617 {
618 unsigned dBClusterMembersIdx = 1;
619 for(auto& item : m_dBClusterMembers)
620 {
621 Aws::StringStream dBClusterMembersSs;
622 dBClusterMembersSs << location << ".DBClusterMember." << dBClusterMembersIdx++;
623 item.OutputToStream(oStream, dBClusterMembersSs.str().c_str());
624 }
625 }
626 if(m_vpcSecurityGroupsHasBeenSet)
627 {
628 unsigned vpcSecurityGroupsIdx = 1;
629 for(auto& item : m_vpcSecurityGroups)
630 {
631 Aws::StringStream vpcSecurityGroupsSs;
632 vpcSecurityGroupsSs << location << ".VpcSecurityGroupMembership." << vpcSecurityGroupsIdx++;
633 item.OutputToStream(oStream, vpcSecurityGroupsSs.str().c_str());
634 }
635 }
636 if(m_hostedZoneIdHasBeenSet)
637 {
638 oStream << location << ".HostedZoneId=" << StringUtils::URLEncode(m_hostedZoneId.c_str()) << "&";
639 }
640 if(m_storageEncryptedHasBeenSet)
641 {
642 oStream << location << ".StorageEncrypted=" << std::boolalpha << m_storageEncrypted << "&";
643 }
644 if(m_kmsKeyIdHasBeenSet)
645 {
646 oStream << location << ".KmsKeyId=" << StringUtils::URLEncode(m_kmsKeyId.c_str()) << "&";
647 }
648 if(m_dbClusterResourceIdHasBeenSet)
649 {
650 oStream << location << ".DbClusterResourceId=" << StringUtils::URLEncode(m_dbClusterResourceId.c_str()) << "&";
651 }
652 if(m_dBClusterArnHasBeenSet)
653 {
654 oStream << location << ".DBClusterArn=" << StringUtils::URLEncode(m_dBClusterArn.c_str()) << "&";
655 }
656 if(m_associatedRolesHasBeenSet)
657 {
658 unsigned associatedRolesIdx = 1;
659 for(auto& item : m_associatedRoles)
660 {
661 Aws::StringStream associatedRolesSs;
662 associatedRolesSs << location << ".DBClusterRole." << associatedRolesIdx++;
663 item.OutputToStream(oStream, associatedRolesSs.str().c_str());
664 }
665 }
666 if(m_clusterCreateTimeHasBeenSet)
667 {
668 oStream << location << ".ClusterCreateTime=" << StringUtils::URLEncode(m_clusterCreateTime.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
669 }
670 if(m_enabledCloudwatchLogsExportsHasBeenSet)
671 {
672 unsigned enabledCloudwatchLogsExportsIdx = 1;
673 for(auto& item : m_enabledCloudwatchLogsExports)
674 {
675 oStream << location << ".EnabledCloudwatchLogsExports.member." << enabledCloudwatchLogsExportsIdx++ << "=" << StringUtils::URLEncode(item.c_str()) << "&";
676 }
677 }
678 if(m_deletionProtectionHasBeenSet)
679 {
680 oStream << location << ".DeletionProtection=" << std::boolalpha << m_deletionProtection << "&";
681 }
682 }
683
684 } // namespace Model
685 } // namespace DocDB
686 } // namespace Aws
687