/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace MigrationHubRefactorSpaces { namespace Model { EnvironmentSummary::EnvironmentSummary() : m_arnHasBeenSet(false), m_createdTimeHasBeenSet(false), m_descriptionHasBeenSet(false), m_environmentIdHasBeenSet(false), m_errorHasBeenSet(false), m_lastUpdatedTimeHasBeenSet(false), m_nameHasBeenSet(false), m_networkFabricType(NetworkFabricType::NOT_SET), m_networkFabricTypeHasBeenSet(false), m_ownerAccountIdHasBeenSet(false), m_state(EnvironmentState::NOT_SET), m_stateHasBeenSet(false), m_tagsHasBeenSet(false), m_transitGatewayIdHasBeenSet(false) { } EnvironmentSummary::EnvironmentSummary(JsonView jsonValue) : m_arnHasBeenSet(false), m_createdTimeHasBeenSet(false), m_descriptionHasBeenSet(false), m_environmentIdHasBeenSet(false), m_errorHasBeenSet(false), m_lastUpdatedTimeHasBeenSet(false), m_nameHasBeenSet(false), m_networkFabricType(NetworkFabricType::NOT_SET), m_networkFabricTypeHasBeenSet(false), m_ownerAccountIdHasBeenSet(false), m_state(EnvironmentState::NOT_SET), m_stateHasBeenSet(false), m_tagsHasBeenSet(false), m_transitGatewayIdHasBeenSet(false) { *this = jsonValue; } EnvironmentSummary& EnvironmentSummary::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("CreatedTime")) { m_createdTime = jsonValue.GetDouble("CreatedTime"); m_createdTimeHasBeenSet = true; } if(jsonValue.ValueExists("Description")) { m_description = jsonValue.GetString("Description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("EnvironmentId")) { m_environmentId = jsonValue.GetString("EnvironmentId"); m_environmentIdHasBeenSet = true; } if(jsonValue.ValueExists("Error")) { m_error = jsonValue.GetObject("Error"); m_errorHasBeenSet = true; } if(jsonValue.ValueExists("LastUpdatedTime")) { m_lastUpdatedTime = jsonValue.GetDouble("LastUpdatedTime"); m_lastUpdatedTimeHasBeenSet = true; } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("NetworkFabricType")) { m_networkFabricType = NetworkFabricTypeMapper::GetNetworkFabricTypeForName(jsonValue.GetString("NetworkFabricType")); m_networkFabricTypeHasBeenSet = true; } if(jsonValue.ValueExists("OwnerAccountId")) { m_ownerAccountId = jsonValue.GetString("OwnerAccountId"); m_ownerAccountIdHasBeenSet = true; } if(jsonValue.ValueExists("State")) { m_state = EnvironmentStateMapper::GetEnvironmentStateForName(jsonValue.GetString("State")); m_stateHasBeenSet = true; } if(jsonValue.ValueExists("Tags")) { Aws::Map tagsJsonMap = jsonValue.GetObject("Tags").GetAllObjects(); for(auto& tagsItem : tagsJsonMap) { m_tags[tagsItem.first] = tagsItem.second.AsString(); } m_tagsHasBeenSet = true; } if(jsonValue.ValueExists("TransitGatewayId")) { m_transitGatewayId = jsonValue.GetString("TransitGatewayId"); m_transitGatewayIdHasBeenSet = true; } return *this; } JsonValue EnvironmentSummary::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("Arn", m_arn); } if(m_createdTimeHasBeenSet) { payload.WithDouble("CreatedTime", m_createdTime.SecondsWithMSPrecision()); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_environmentIdHasBeenSet) { payload.WithString("EnvironmentId", m_environmentId); } if(m_errorHasBeenSet) { payload.WithObject("Error", m_error.Jsonize()); } if(m_lastUpdatedTimeHasBeenSet) { payload.WithDouble("LastUpdatedTime", m_lastUpdatedTime.SecondsWithMSPrecision()); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_networkFabricTypeHasBeenSet) { payload.WithString("NetworkFabricType", NetworkFabricTypeMapper::GetNameForNetworkFabricType(m_networkFabricType)); } if(m_ownerAccountIdHasBeenSet) { payload.WithString("OwnerAccountId", m_ownerAccountId); } if(m_stateHasBeenSet) { payload.WithString("State", EnvironmentStateMapper::GetNameForEnvironmentState(m_state)); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("Tags", std::move(tagsJsonMap)); } if(m_transitGatewayIdHasBeenSet) { payload.WithString("TransitGatewayId", m_transitGatewayId); } return payload; } } // namespace Model } // namespace MigrationHubRefactorSpaces } // namespace Aws