/** * 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 EMRContainers { namespace Model { VirtualCluster::VirtualCluster() : m_idHasBeenSet(false), m_nameHasBeenSet(false), m_arnHasBeenSet(false), m_state(VirtualClusterState::NOT_SET), m_stateHasBeenSet(false), m_containerProviderHasBeenSet(false), m_createdAtHasBeenSet(false), m_tagsHasBeenSet(false) { } VirtualCluster::VirtualCluster(JsonView jsonValue) : m_idHasBeenSet(false), m_nameHasBeenSet(false), m_arnHasBeenSet(false), m_state(VirtualClusterState::NOT_SET), m_stateHasBeenSet(false), m_containerProviderHasBeenSet(false), m_createdAtHasBeenSet(false), m_tagsHasBeenSet(false) { *this = jsonValue; } VirtualCluster& VirtualCluster::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("state")) { m_state = VirtualClusterStateMapper::GetVirtualClusterStateForName(jsonValue.GetString("state")); m_stateHasBeenSet = true; } if(jsonValue.ValueExists("containerProvider")) { m_containerProvider = jsonValue.GetObject("containerProvider"); m_containerProviderHasBeenSet = true; } if(jsonValue.ValueExists("createdAt")) { m_createdAt = jsonValue.GetString("createdAt"); m_createdAtHasBeenSet = 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; } return *this; } JsonValue VirtualCluster::Jsonize() const { JsonValue payload; if(m_idHasBeenSet) { payload.WithString("id", m_id); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_stateHasBeenSet) { payload.WithString("state", VirtualClusterStateMapper::GetNameForVirtualClusterState(m_state)); } if(m_containerProviderHasBeenSet) { payload.WithObject("containerProvider", m_containerProvider.Jsonize()); } if(m_createdAtHasBeenSet) { payload.WithString("createdAt", m_createdAt.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("tags", std::move(tagsJsonMap)); } return payload; } } // namespace Model } // namespace EMRContainers } // namespace Aws