/** * 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 GlueDataBrew { namespace Model { Dataset::Dataset() : m_accountIdHasBeenSet(false), m_createdByHasBeenSet(false), m_createDateHasBeenSet(false), m_nameHasBeenSet(false), m_format(InputFormat::NOT_SET), m_formatHasBeenSet(false), m_formatOptionsHasBeenSet(false), m_inputHasBeenSet(false), m_lastModifiedDateHasBeenSet(false), m_lastModifiedByHasBeenSet(false), m_source(Source::NOT_SET), m_sourceHasBeenSet(false), m_pathOptionsHasBeenSet(false), m_tagsHasBeenSet(false), m_resourceArnHasBeenSet(false) { } Dataset::Dataset(JsonView jsonValue) : m_accountIdHasBeenSet(false), m_createdByHasBeenSet(false), m_createDateHasBeenSet(false), m_nameHasBeenSet(false), m_format(InputFormat::NOT_SET), m_formatHasBeenSet(false), m_formatOptionsHasBeenSet(false), m_inputHasBeenSet(false), m_lastModifiedDateHasBeenSet(false), m_lastModifiedByHasBeenSet(false), m_source(Source::NOT_SET), m_sourceHasBeenSet(false), m_pathOptionsHasBeenSet(false), m_tagsHasBeenSet(false), m_resourceArnHasBeenSet(false) { *this = jsonValue; } Dataset& Dataset::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("AccountId")) { m_accountId = jsonValue.GetString("AccountId"); m_accountIdHasBeenSet = true; } if(jsonValue.ValueExists("CreatedBy")) { m_createdBy = jsonValue.GetString("CreatedBy"); m_createdByHasBeenSet = true; } if(jsonValue.ValueExists("CreateDate")) { m_createDate = jsonValue.GetDouble("CreateDate"); m_createDateHasBeenSet = true; } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("Format")) { m_format = InputFormatMapper::GetInputFormatForName(jsonValue.GetString("Format")); m_formatHasBeenSet = true; } if(jsonValue.ValueExists("FormatOptions")) { m_formatOptions = jsonValue.GetObject("FormatOptions"); m_formatOptionsHasBeenSet = true; } if(jsonValue.ValueExists("Input")) { m_input = jsonValue.GetObject("Input"); m_inputHasBeenSet = true; } if(jsonValue.ValueExists("LastModifiedDate")) { m_lastModifiedDate = jsonValue.GetDouble("LastModifiedDate"); m_lastModifiedDateHasBeenSet = true; } if(jsonValue.ValueExists("LastModifiedBy")) { m_lastModifiedBy = jsonValue.GetString("LastModifiedBy"); m_lastModifiedByHasBeenSet = true; } if(jsonValue.ValueExists("Source")) { m_source = SourceMapper::GetSourceForName(jsonValue.GetString("Source")); m_sourceHasBeenSet = true; } if(jsonValue.ValueExists("PathOptions")) { m_pathOptions = jsonValue.GetObject("PathOptions"); m_pathOptionsHasBeenSet = 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("ResourceArn")) { m_resourceArn = jsonValue.GetString("ResourceArn"); m_resourceArnHasBeenSet = true; } return *this; } JsonValue Dataset::Jsonize() const { JsonValue payload; if(m_accountIdHasBeenSet) { payload.WithString("AccountId", m_accountId); } if(m_createdByHasBeenSet) { payload.WithString("CreatedBy", m_createdBy); } if(m_createDateHasBeenSet) { payload.WithDouble("CreateDate", m_createDate.SecondsWithMSPrecision()); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_formatHasBeenSet) { payload.WithString("Format", InputFormatMapper::GetNameForInputFormat(m_format)); } if(m_formatOptionsHasBeenSet) { payload.WithObject("FormatOptions", m_formatOptions.Jsonize()); } if(m_inputHasBeenSet) { payload.WithObject("Input", m_input.Jsonize()); } if(m_lastModifiedDateHasBeenSet) { payload.WithDouble("LastModifiedDate", m_lastModifiedDate.SecondsWithMSPrecision()); } if(m_lastModifiedByHasBeenSet) { payload.WithString("LastModifiedBy", m_lastModifiedBy); } if(m_sourceHasBeenSet) { payload.WithString("Source", SourceMapper::GetNameForSource(m_source)); } if(m_pathOptionsHasBeenSet) { payload.WithObject("PathOptions", m_pathOptions.Jsonize()); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("Tags", std::move(tagsJsonMap)); } if(m_resourceArnHasBeenSet) { payload.WithString("ResourceArn", m_resourceArn); } return payload; } } // namespace Model } // namespace GlueDataBrew } // namespace Aws