/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::imagebuilder::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; ImportVmImageRequest::ImportVmImageRequest() : m_nameHasBeenSet(false), m_semanticVersionHasBeenSet(false), m_descriptionHasBeenSet(false), m_platform(Platform::NOT_SET), m_platformHasBeenSet(false), m_osVersionHasBeenSet(false), m_vmImportTaskIdHasBeenSet(false), m_tagsHasBeenSet(false), m_clientToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientTokenHasBeenSet(true) { } Aws::String ImportVmImageRequest::SerializePayload() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_semanticVersionHasBeenSet) { payload.WithString("semanticVersion", m_semanticVersion); } if(m_descriptionHasBeenSet) { payload.WithString("description", m_description); } if(m_platformHasBeenSet) { payload.WithString("platform", PlatformMapper::GetNameForPlatform(m_platform)); } if(m_osVersionHasBeenSet) { payload.WithString("osVersion", m_osVersion); } if(m_vmImportTaskIdHasBeenSet) { payload.WithString("vmImportTaskId", m_vmImportTaskId); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("tags", std::move(tagsJsonMap)); } if(m_clientTokenHasBeenSet) { payload.WithString("clientToken", m_clientToken); } return payload.View().WriteReadable(); }