/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the wafv2-2019-07-29.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.WAFV2.Model { /// /// A custom response to send to the client. You can define a custom response for rule /// actions and default web ACL actions that are set to BlockAction. /// /// /// /// For information about customizing web requests and responses, see Customizing /// web requests and responses in WAF in the WAF Developer Guide. /// /// public partial class CustomResponse { private string _customResponseBodyKey; private int? _responseCode; private List _responseHeaders = new List(); /// /// Gets and sets the property CustomResponseBodyKey. /// /// References the response body that you want WAF to return to the web request client. /// You can define a custom response for a rule action or a default web ACL action that /// is set to block. To do this, you first define the response body key and value in the /// CustomResponseBodies setting for the WebACL or RuleGroup /// where you want to use it. Then, in the rule action or web ACL default action BlockAction /// setting, you reference the response body using this key. /// /// [AWSProperty(Min=1, Max=128)] public string CustomResponseBodyKey { get { return this._customResponseBodyKey; } set { this._customResponseBodyKey = value; } } // Check to see if CustomResponseBodyKey property is set internal bool IsSetCustomResponseBodyKey() { return this._customResponseBodyKey != null; } /// /// Gets and sets the property ResponseCode. /// /// The HTTP status code to return to the client. /// /// /// /// For a list of status codes that you can use in your custom responses, see Supported /// status codes for custom response in the WAF Developer Guide. /// /// [AWSProperty(Required=true, Min=200, Max=599)] public int ResponseCode { get { return this._responseCode.GetValueOrDefault(); } set { this._responseCode = value; } } // Check to see if ResponseCode property is set internal bool IsSetResponseCode() { return this._responseCode.HasValue; } /// /// Gets and sets the property ResponseHeaders. /// /// The HTTP headers to use in the response. Duplicate header names are not allowed. /// /// /// /// For information about the limits on count and size for custom request and response /// settings, see WAF /// quotas in the WAF Developer Guide. /// /// [AWSProperty(Min=1)] public List ResponseHeaders { get { return this._responseHeaders; } set { this._responseHeaders = value; } } // Check to see if ResponseHeaders property is set internal bool IsSetResponseHeaders() { return this._responseHeaders != null && this._responseHeaders.Count > 0; } } }