/** * 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 SESV2 { namespace Model { MetricDataError::MetricDataError() : m_idHasBeenSet(false), m_code(QueryErrorCode::NOT_SET), m_codeHasBeenSet(false), m_messageHasBeenSet(false) { } MetricDataError::MetricDataError(JsonView jsonValue) : m_idHasBeenSet(false), m_code(QueryErrorCode::NOT_SET), m_codeHasBeenSet(false), m_messageHasBeenSet(false) { *this = jsonValue; } MetricDataError& MetricDataError::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Id")) { m_id = jsonValue.GetString("Id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("Code")) { m_code = QueryErrorCodeMapper::GetQueryErrorCodeForName(jsonValue.GetString("Code")); m_codeHasBeenSet = true; } if(jsonValue.ValueExists("Message")) { m_message = jsonValue.GetString("Message"); m_messageHasBeenSet = true; } return *this; } JsonValue MetricDataError::Jsonize() const { JsonValue payload; if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_codeHasBeenSet) { payload.WithString("Code", QueryErrorCodeMapper::GetNameForQueryErrorCode(m_code)); } if(m_messageHasBeenSet) { payload.WithString("Message", m_message); } return payload; } } // namespace Model } // namespace SESV2 } // namespace Aws