1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/waf/WAF_EXPORTS.h> 8 #include <aws/waf/model/ParameterExceptionField.h> 9 #include <aws/core/utils/memory/stl/AWSString.h> 10 #include <aws/waf/model/ParameterExceptionReason.h> 11 #include <utility> 12 13 namespace Aws 14 { 15 namespace Utils 16 { 17 namespace Json 18 { 19 class JsonValue; 20 class JsonView; 21 } // namespace Json 22 } // namespace Utils 23 namespace WAF 24 { 25 namespace Model 26 { 27 28 /** 29 * <p>The operation failed because AWS WAF didn't recognize a parameter in the 30 * request. For example:</p> <ul> <li> <p>You specified an invalid parameter 31 * name.</p> </li> <li> <p>You specified an invalid value.</p> </li> <li> <p>You 32 * tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, 33 * <code>Rule</code>, or <code>WebACL</code>) using an action other than 34 * <code>INSERT</code> or <code>DELETE</code>.</p> </li> <li> <p>You tried to 35 * create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code> 36 * other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.</p> 37 * </li> <li> <p>You tried to create a <code>RateBasedRule</code> with a 38 * <code>RateKey</code> value other than <code>IP</code>.</p> </li> <li> <p>You 39 * tried to update a <code>WebACL</code> with a <code>WafAction</code> 40 * <code>Type</code> other than <code>ALLOW</code>, <code>BLOCK</code>, or 41 * <code>COUNT</code>.</p> </li> <li> <p>You tried to update a 42 * <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code> 43 * other than HEADER, METHOD, QUERY_STRING, URI, or BODY.</p> </li> <li> <p>You 44 * tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of 45 * <code>HEADER</code> but no value for <code>Data</code>.</p> </li> <li> <p>Your 46 * request references an ARN that is malformed, or corresponds to a resource with 47 * which a web ACL cannot be associated.</p> </li> </ul><p><h3>See Also:</h3> <a 48 * href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/WAFInvalidParameterException">AWS 49 * API Reference</a></p> 50 */ 51 class AWS_WAF_API WAFInvalidParameterException 52 { 53 public: 54 WAFInvalidParameterException(); 55 WAFInvalidParameterException(Aws::Utils::Json::JsonView jsonValue); 56 WAFInvalidParameterException& operator=(Aws::Utils::Json::JsonView jsonValue); 57 Aws::Utils::Json::JsonValue Jsonize() const; 58 59 60 GetField()61 inline const ParameterExceptionField& GetField() const{ return m_field; } 62 63 FieldHasBeenSet()64 inline bool FieldHasBeenSet() const { return m_fieldHasBeenSet; } 65 66 SetField(const ParameterExceptionField & value)67 inline void SetField(const ParameterExceptionField& value) { m_fieldHasBeenSet = true; m_field = value; } 68 69 SetField(ParameterExceptionField && value)70 inline void SetField(ParameterExceptionField&& value) { m_fieldHasBeenSet = true; m_field = std::move(value); } 71 72 WithField(const ParameterExceptionField & value)73 inline WAFInvalidParameterException& WithField(const ParameterExceptionField& value) { SetField(value); return *this;} 74 75 WithField(ParameterExceptionField && value)76 inline WAFInvalidParameterException& WithField(ParameterExceptionField&& value) { SetField(std::move(value)); return *this;} 77 78 79 GetParameter()80 inline const Aws::String& GetParameter() const{ return m_parameter; } 81 82 ParameterHasBeenSet()83 inline bool ParameterHasBeenSet() const { return m_parameterHasBeenSet; } 84 85 SetParameter(const Aws::String & value)86 inline void SetParameter(const Aws::String& value) { m_parameterHasBeenSet = true; m_parameter = value; } 87 88 SetParameter(Aws::String && value)89 inline void SetParameter(Aws::String&& value) { m_parameterHasBeenSet = true; m_parameter = std::move(value); } 90 91 SetParameter(const char * value)92 inline void SetParameter(const char* value) { m_parameterHasBeenSet = true; m_parameter.assign(value); } 93 94 WithParameter(const Aws::String & value)95 inline WAFInvalidParameterException& WithParameter(const Aws::String& value) { SetParameter(value); return *this;} 96 97 WithParameter(Aws::String && value)98 inline WAFInvalidParameterException& WithParameter(Aws::String&& value) { SetParameter(std::move(value)); return *this;} 99 100 WithParameter(const char * value)101 inline WAFInvalidParameterException& WithParameter(const char* value) { SetParameter(value); return *this;} 102 103 104 GetReason()105 inline const ParameterExceptionReason& GetReason() const{ return m_reason; } 106 107 ReasonHasBeenSet()108 inline bool ReasonHasBeenSet() const { return m_reasonHasBeenSet; } 109 110 SetReason(const ParameterExceptionReason & value)111 inline void SetReason(const ParameterExceptionReason& value) { m_reasonHasBeenSet = true; m_reason = value; } 112 113 SetReason(ParameterExceptionReason && value)114 inline void SetReason(ParameterExceptionReason&& value) { m_reasonHasBeenSet = true; m_reason = std::move(value); } 115 116 WithReason(const ParameterExceptionReason & value)117 inline WAFInvalidParameterException& WithReason(const ParameterExceptionReason& value) { SetReason(value); return *this;} 118 119 WithReason(ParameterExceptionReason && value)120 inline WAFInvalidParameterException& WithReason(ParameterExceptionReason&& value) { SetReason(std::move(value)); return *this;} 121 122 private: 123 124 ParameterExceptionField m_field; 125 bool m_fieldHasBeenSet; 126 127 Aws::String m_parameter; 128 bool m_parameterHasBeenSet; 129 130 ParameterExceptionReason m_reason; 131 bool m_reasonHasBeenSet; 132 }; 133 134 } // namespace Model 135 } // namespace WAF 136 } // namespace Aws 137