/** * 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 { CodeSnippetError::CodeSnippetError() : m_errorCode(CodeSnippetErrorCode::NOT_SET), m_errorCodeHasBeenSet(false), m_errorMessageHasBeenSet(false), m_findingArnHasBeenSet(false) { } CodeSnippetError::CodeSnippetError(JsonView jsonValue) : m_errorCode(CodeSnippetErrorCode::NOT_SET), m_errorCodeHasBeenSet(false), m_errorMessageHasBeenSet(false), m_findingArnHasBeenSet(false) { *this = jsonValue; } CodeSnippetError& CodeSnippetError::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("errorCode")) { m_errorCode = CodeSnippetErrorCodeMapper::GetCodeSnippetErrorCodeForName(jsonValue.GetString("errorCode")); m_errorCodeHasBeenSet = true; } if(jsonValue.ValueExists("errorMessage")) { m_errorMessage = jsonValue.GetString("errorMessage"); m_errorMessageHasBeenSet = true; } if(jsonValue.ValueExists("findingArn")) { m_findingArn = jsonValue.GetString("findingArn"); m_findingArnHasBeenSet = true; } return *this; } JsonValue CodeSnippetError::Jsonize() const { JsonValue payload; if(m_errorCodeHasBeenSet) { payload.WithString("errorCode", CodeSnippetErrorCodeMapper::GetNameForCodeSnippetErrorCode(m_errorCode)); } if(m_errorMessageHasBeenSet) { payload.WithString("errorMessage", m_errorMessage); } if(m_findingArnHasBeenSet) { payload.WithString("findingArn", m_findingArn); } return payload; } } // namespace Model } // namespace Inspector2 } // namespace Aws