/** * 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 Inspector2 { namespace Model { State::State() : m_errorCode(ErrorCode::NOT_SET), m_errorCodeHasBeenSet(false), m_errorMessageHasBeenSet(false), m_status(Status::NOT_SET), m_statusHasBeenSet(false) { } State::State(JsonView jsonValue) : m_errorCode(ErrorCode::NOT_SET), m_errorCodeHasBeenSet(false), m_errorMessageHasBeenSet(false), m_status(Status::NOT_SET), m_statusHasBeenSet(false) { *this = jsonValue; } State& State::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("errorCode")) { m_errorCode = ErrorCodeMapper::GetErrorCodeForName(jsonValue.GetString("errorCode")); m_errorCodeHasBeenSet = true; } if(jsonValue.ValueExists("errorMessage")) { m_errorMessage = jsonValue.GetString("errorMessage"); m_errorMessageHasBeenSet = true; } if(jsonValue.ValueExists("status")) { m_status = StatusMapper::GetStatusForName(jsonValue.GetString("status")); m_statusHasBeenSet = true; } return *this; } JsonValue State::Jsonize() const { JsonValue payload; if(m_errorCodeHasBeenSet) { payload.WithString("errorCode", ErrorCodeMapper::GetNameForErrorCode(m_errorCode)); } if(m_errorMessageHasBeenSet) { payload.WithString("errorMessage", m_errorMessage); } if(m_statusHasBeenSet) { payload.WithString("status", StatusMapper::GetNameForStatus(m_status)); } return payload; } } // namespace Model } // namespace Inspector2 } // namespace Aws