/** * 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 LookoutforVision { namespace Model { ModelMetadata::ModelMetadata() : m_creationTimestampHasBeenSet(false), m_modelVersionHasBeenSet(false), m_modelArnHasBeenSet(false), m_descriptionHasBeenSet(false), m_status(ModelStatus::NOT_SET), m_statusHasBeenSet(false), m_statusMessageHasBeenSet(false), m_performanceHasBeenSet(false) { } ModelMetadata::ModelMetadata(JsonView jsonValue) : m_creationTimestampHasBeenSet(false), m_modelVersionHasBeenSet(false), m_modelArnHasBeenSet(false), m_descriptionHasBeenSet(false), m_status(ModelStatus::NOT_SET), m_statusHasBeenSet(false), m_statusMessageHasBeenSet(false), m_performanceHasBeenSet(false) { *this = jsonValue; } ModelMetadata& ModelMetadata::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("CreationTimestamp")) { m_creationTimestamp = jsonValue.GetDouble("CreationTimestamp"); m_creationTimestampHasBeenSet = true; } if(jsonValue.ValueExists("ModelVersion")) { m_modelVersion = jsonValue.GetString("ModelVersion"); m_modelVersionHasBeenSet = true; } if(jsonValue.ValueExists("ModelArn")) { m_modelArn = jsonValue.GetString("ModelArn"); m_modelArnHasBeenSet = true; } if(jsonValue.ValueExists("Description")) { m_description = jsonValue.GetString("Description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("Status")) { m_status = ModelStatusMapper::GetModelStatusForName(jsonValue.GetString("Status")); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("StatusMessage")) { m_statusMessage = jsonValue.GetString("StatusMessage"); m_statusMessageHasBeenSet = true; } if(jsonValue.ValueExists("Performance")) { m_performance = jsonValue.GetObject("Performance"); m_performanceHasBeenSet = true; } return *this; } JsonValue ModelMetadata::Jsonize() const { JsonValue payload; if(m_creationTimestampHasBeenSet) { payload.WithDouble("CreationTimestamp", m_creationTimestamp.SecondsWithMSPrecision()); } if(m_modelVersionHasBeenSet) { payload.WithString("ModelVersion", m_modelVersion); } if(m_modelArnHasBeenSet) { payload.WithString("ModelArn", m_modelArn); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_statusHasBeenSet) { payload.WithString("Status", ModelStatusMapper::GetNameForModelStatus(m_status)); } if(m_statusMessageHasBeenSet) { payload.WithString("StatusMessage", m_statusMessage); } if(m_performanceHasBeenSet) { payload.WithObject("Performance", m_performance.Jsonize()); } return payload; } } // namespace Model } // namespace LookoutforVision } // namespace Aws