/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace PrometheusService { namespace Model { RuleGroupsNamespaceDescription::RuleGroupsNamespaceDescription() : m_arnHasBeenSet(false), m_nameHasBeenSet(false), m_statusHasBeenSet(false), m_dataHasBeenSet(false), m_createdAtHasBeenSet(false), m_modifiedAtHasBeenSet(false), m_tagsHasBeenSet(false) { } RuleGroupsNamespaceDescription::RuleGroupsNamespaceDescription(JsonView jsonValue) : m_arnHasBeenSet(false), m_nameHasBeenSet(false), m_statusHasBeenSet(false), m_dataHasBeenSet(false), m_createdAtHasBeenSet(false), m_modifiedAtHasBeenSet(false), m_tagsHasBeenSet(false) { *this = jsonValue; } RuleGroupsNamespaceDescription& RuleGroupsNamespaceDescription::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("status")) { m_status = jsonValue.GetObject("status"); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("data")) { m_data = HashingUtils::Base64Decode(jsonValue.GetString("data")); m_dataHasBeenSet = true; } if(jsonValue.ValueExists("createdAt")) { m_createdAt = jsonValue.GetDouble("createdAt"); m_createdAtHasBeenSet = true; } if(jsonValue.ValueExists("modifiedAt")) { m_modifiedAt = jsonValue.GetDouble("modifiedAt"); m_modifiedAtHasBeenSet = 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 RuleGroupsNamespaceDescription::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_statusHasBeenSet) { payload.WithObject("status", m_status.Jsonize()); } if(m_dataHasBeenSet) { payload.WithString("data", HashingUtils::Base64Encode(m_data)); } if(m_createdAtHasBeenSet) { payload.WithDouble("createdAt", m_createdAt.SecondsWithMSPrecision()); } if(m_modifiedAtHasBeenSet) { payload.WithDouble("modifiedAt", m_modifiedAt.SecondsWithMSPrecision()); } 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 PrometheusService } // namespace Aws