/** * 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 { JobTemplate::JobTemplate() : m_nameHasBeenSet(false), m_idHasBeenSet(false), m_arnHasBeenSet(false), m_createdAtHasBeenSet(false), m_createdByHasBeenSet(false), m_tagsHasBeenSet(false), m_jobTemplateDataHasBeenSet(false), m_kmsKeyArnHasBeenSet(false), m_decryptionErrorHasBeenSet(false) { } JobTemplate::JobTemplate(JsonView jsonValue) : m_nameHasBeenSet(false), m_idHasBeenSet(false), m_arnHasBeenSet(false), m_createdAtHasBeenSet(false), m_createdByHasBeenSet(false), m_tagsHasBeenSet(false), m_jobTemplateDataHasBeenSet(false), m_kmsKeyArnHasBeenSet(false), m_decryptionErrorHasBeenSet(false) { *this = jsonValue; } JobTemplate& JobTemplate::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("createdAt")) { m_createdAt = jsonValue.GetString("createdAt"); m_createdAtHasBeenSet = true; } if(jsonValue.ValueExists("createdBy")) { m_createdBy = jsonValue.GetString("createdBy"); m_createdByHasBeenSet = 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("jobTemplateData")) { m_jobTemplateData = jsonValue.GetObject("jobTemplateData"); m_jobTemplateDataHasBeenSet = true; } if(jsonValue.ValueExists("kmsKeyArn")) { m_kmsKeyArn = jsonValue.GetString("kmsKeyArn"); m_kmsKeyArnHasBeenSet = true; } if(jsonValue.ValueExists("decryptionError")) { m_decryptionError = jsonValue.GetString("decryptionError"); m_decryptionErrorHasBeenSet = true; } return *this; } JsonValue JobTemplate::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_idHasBeenSet) { payload.WithString("id", m_id); } if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_createdAtHasBeenSet) { payload.WithString("createdAt", m_createdAt.ToGmtString(Aws::Utils::DateFormat::ISO_8601)); } if(m_createdByHasBeenSet) { payload.WithString("createdBy", m_createdBy); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("tags", std::move(tagsJsonMap)); } if(m_jobTemplateDataHasBeenSet) { payload.WithObject("jobTemplateData", m_jobTemplateData.Jsonize()); } if(m_kmsKeyArnHasBeenSet) { payload.WithString("kmsKeyArn", m_kmsKeyArn); } if(m_decryptionErrorHasBeenSet) { payload.WithString("decryptionError", m_decryptionError); } return payload; } } // namespace Model } // namespace EMRContainers } // namespace Aws