/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/docdb-elastic/DocDBElastic_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/docdb-elastic/model/ValidationExceptionReason.h> #include <aws/docdb-elastic/model/ValidationExceptionField.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace DocDBElastic { namespace Model { /** * <p>A structure defining a validation exception.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/ValidationException">AWS * API Reference</a></p> */ class ValidationException { public: AWS_DOCDBELASTIC_API ValidationException(); AWS_DOCDBELASTIC_API ValidationException(Aws::Utils::Json::JsonView jsonValue); AWS_DOCDBELASTIC_API ValidationException& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_DOCDBELASTIC_API Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline const Aws::Vector<ValidationExceptionField>& GetFieldList() const{ return m_fieldList; } /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline bool FieldListHasBeenSet() const { return m_fieldListHasBeenSet; } /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline void SetFieldList(const Aws::Vector<ValidationExceptionField>& value) { m_fieldListHasBeenSet = true; m_fieldList = value; } /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline void SetFieldList(Aws::Vector<ValidationExceptionField>&& value) { m_fieldListHasBeenSet = true; m_fieldList = std::move(value); } /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline ValidationException& WithFieldList(const Aws::Vector<ValidationExceptionField>& value) { SetFieldList(value); return *this;} /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline ValidationException& WithFieldList(Aws::Vector<ValidationExceptionField>&& value) { SetFieldList(std::move(value)); return *this;} /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline ValidationException& AddFieldList(const ValidationExceptionField& value) { m_fieldListHasBeenSet = true; m_fieldList.push_back(value); return *this; } /** * <p>A list of the fields in which the validation exception occurred.</p> */ inline ValidationException& AddFieldList(ValidationExceptionField&& value) { m_fieldListHasBeenSet = true; m_fieldList.push_back(std::move(value)); return *this; } /** * <p>An error message describing the validation exception.</p> */ inline const Aws::String& GetMessage() const{ return m_message; } /** * <p>An error message describing the validation exception.</p> */ inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; } /** * <p>An error message describing the validation exception.</p> */ inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; } /** * <p>An error message describing the validation exception.</p> */ inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); } /** * <p>An error message describing the validation exception.</p> */ inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); } /** * <p>An error message describing the validation exception.</p> */ inline ValidationException& WithMessage(const Aws::String& value) { SetMessage(value); return *this;} /** * <p>An error message describing the validation exception.</p> */ inline ValidationException& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;} /** * <p>An error message describing the validation exception.</p> */ inline ValidationException& WithMessage(const char* value) { SetMessage(value); return *this;} /** * <p>The reason why the validation exception occurred (one of * <code>unknownOperation</code>, <code>cannotParse</code>, * <code>fieldValidationFailed</code>, or <code>other</code>).</p> */ inline const ValidationExceptionReason& GetReason() const{ return m_reason; } /** * <p>The reason why the validation exception occurred (one of * <code>unknownOperation</code>, <code>cannotParse</code>, * <code>fieldValidationFailed</code>, or <code>other</code>).</p> */ inline bool ReasonHasBeenSet() const { return m_reasonHasBeenSet; } /** * <p>The reason why the validation exception occurred (one of * <code>unknownOperation</code>, <code>cannotParse</code>, * <code>fieldValidationFailed</code>, or <code>other</code>).</p> */ inline void SetReason(const ValidationExceptionReason& value) { m_reasonHasBeenSet = true; m_reason = value; } /** * <p>The reason why the validation exception occurred (one of * <code>unknownOperation</code>, <code>cannotParse</code>, * <code>fieldValidationFailed</code>, or <code>other</code>).</p> */ inline void SetReason(ValidationExceptionReason&& value) { m_reasonHasBeenSet = true; m_reason = std::move(value); } /** * <p>The reason why the validation exception occurred (one of * <code>unknownOperation</code>, <code>cannotParse</code>, * <code>fieldValidationFailed</code>, or <code>other</code>).</p> */ inline ValidationException& WithReason(const ValidationExceptionReason& value) { SetReason(value); return *this;} /** * <p>The reason why the validation exception occurred (one of * <code>unknownOperation</code>, <code>cannotParse</code>, * <code>fieldValidationFailed</code>, or <code>other</code>).</p> */ inline ValidationException& WithReason(ValidationExceptionReason&& value) { SetReason(std::move(value)); return *this;} private: Aws::Vector<ValidationExceptionField> m_fieldList; bool m_fieldListHasBeenSet = false; Aws::String m_message; bool m_messageHasBeenSet = false; ValidationExceptionReason m_reason; bool m_reasonHasBeenSet = false; }; } // namespace Model } // namespace DocDBElastic } // namespace Aws