/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::CloudHSMV2::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateClusterRequest::CreateClusterRequest() : m_backupRetentionPolicyHasBeenSet(false), m_hsmTypeHasBeenSet(false), m_sourceBackupIdHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_tagListHasBeenSet(false) { } Aws::String CreateClusterRequest::SerializePayload() const { JsonValue payload; if(m_backupRetentionPolicyHasBeenSet) { payload.WithObject("BackupRetentionPolicy", m_backupRetentionPolicy.Jsonize()); } if(m_hsmTypeHasBeenSet) { payload.WithString("HsmType", m_hsmType); } if(m_sourceBackupIdHasBeenSet) { payload.WithString("SourceBackupId", m_sourceBackupId); } if(m_subnetIdsHasBeenSet) { Aws::Utils::Array subnetIdsJsonList(m_subnetIds.size()); for(unsigned subnetIdsIndex = 0; subnetIdsIndex < subnetIdsJsonList.GetLength(); ++subnetIdsIndex) { subnetIdsJsonList[subnetIdsIndex].AsString(m_subnetIds[subnetIdsIndex]); } payload.WithArray("SubnetIds", std::move(subnetIdsJsonList)); } if(m_tagListHasBeenSet) { Aws::Utils::Array tagListJsonList(m_tagList.size()); for(unsigned tagListIndex = 0; tagListIndex < tagListJsonList.GetLength(); ++tagListIndex) { tagListJsonList[tagListIndex].AsObject(m_tagList[tagListIndex].Jsonize()); } payload.WithArray("TagList", std::move(tagListJsonList)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateClusterRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "BaldrApiService.CreateCluster")); return headers; }