com.amazonaws.services.waf.model.SampledHTTPRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-waf Show documentation
/*
* Copyright 2017-2022 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.
*/
package com.amazonaws.services.waf.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
*
* This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the
* developer guide.
*
*
* For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the
* latest version, AWS WAF has a single set of endpoints for regional and global use.
*
*
*
* The response from a GetSampledRequests request includes a SampledHTTPRequests
complex type that
* appears as SampledRequests
in the response syntax. SampledHTTPRequests
contains one
* SampledHTTPRequest
object for each web request that is returned by GetSampledRequests
.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SampledHTTPRequest implements Serializable, Cloneable, StructuredPojo {
/**
*
* A complex type that contains detailed information about the request.
*
*/
private HTTPRequest request;
/**
*
* A value that indicates how one result in the response relates proportionally to other results in the response. A
* result that has a weight of 2
represents roughly twice as many CloudFront web requests as a result
* that has a weight of 1
.
*
*/
private Long weight;
/**
*
* The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
*
*/
private java.util.Date timestamp;
/**
*
* The action for the Rule
that the request matched: ALLOW
, BLOCK
, or
* COUNT
.
*
*/
private String action;
/**
*
* This value is returned if the GetSampledRequests
request specifies the ID of a
* RuleGroup
rather than the ID of an individual rule. RuleWithinRuleGroup
is the rule
* within the specified RuleGroup
that matched the request listed in the response.
*
*/
private String ruleWithinRuleGroup;
/**
*
* A complex type that contains detailed information about the request.
*
*
* @param request
* A complex type that contains detailed information about the request.
*/
public void setRequest(HTTPRequest request) {
this.request = request;
}
/**
*
* A complex type that contains detailed information about the request.
*
*
* @return A complex type that contains detailed information about the request.
*/
public HTTPRequest getRequest() {
return this.request;
}
/**
*
* A complex type that contains detailed information about the request.
*
*
* @param request
* A complex type that contains detailed information about the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SampledHTTPRequest withRequest(HTTPRequest request) {
setRequest(request);
return this;
}
/**
*
* A value that indicates how one result in the response relates proportionally to other results in the response. A
* result that has a weight of 2
represents roughly twice as many CloudFront web requests as a result
* that has a weight of 1
.
*
*
* @param weight
* A value that indicates how one result in the response relates proportionally to other results in the
* response. A result that has a weight of 2
represents roughly twice as many CloudFront web
* requests as a result that has a weight of 1
.
*/
public void setWeight(Long weight) {
this.weight = weight;
}
/**
*
* A value that indicates how one result in the response relates proportionally to other results in the response. A
* result that has a weight of 2
represents roughly twice as many CloudFront web requests as a result
* that has a weight of 1
.
*
*
* @return A value that indicates how one result in the response relates proportionally to other results in the
* response. A result that has a weight of 2
represents roughly twice as many CloudFront web
* requests as a result that has a weight of 1
.
*/
public Long getWeight() {
return this.weight;
}
/**
*
* A value that indicates how one result in the response relates proportionally to other results in the response. A
* result that has a weight of 2
represents roughly twice as many CloudFront web requests as a result
* that has a weight of 1
.
*
*
* @param weight
* A value that indicates how one result in the response relates proportionally to other results in the
* response. A result that has a weight of 2
represents roughly twice as many CloudFront web
* requests as a result that has a weight of 1
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SampledHTTPRequest withWeight(Long weight) {
setWeight(weight);
return this;
}
/**
*
* The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
*
*
* @param timestamp
* The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
*/
public void setTimestamp(java.util.Date timestamp) {
this.timestamp = timestamp;
}
/**
*
* The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
*
*
* @return The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
*/
public java.util.Date getTimestamp() {
return this.timestamp;
}
/**
*
* The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
*
*
* @param timestamp
* The time at which AWS WAF received the request from your AWS resource, in Unix time format (in seconds).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SampledHTTPRequest withTimestamp(java.util.Date timestamp) {
setTimestamp(timestamp);
return this;
}
/**
*
* The action for the Rule
that the request matched: ALLOW
, BLOCK
, or
* COUNT
.
*
*
* @param action
* The action for the Rule
that the request matched: ALLOW
, BLOCK
, or
* COUNT
.
*/
public void setAction(String action) {
this.action = action;
}
/**
*
* The action for the Rule
that the request matched: ALLOW
, BLOCK
, or
* COUNT
.
*
*
* @return The action for the Rule
that the request matched: ALLOW
, BLOCK
, or
* COUNT
.
*/
public String getAction() {
return this.action;
}
/**
*
* The action for the Rule
that the request matched: ALLOW
, BLOCK
, or
* COUNT
.
*
*
* @param action
* The action for the Rule
that the request matched: ALLOW
, BLOCK
, or
* COUNT
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SampledHTTPRequest withAction(String action) {
setAction(action);
return this;
}
/**
*
* This value is returned if the GetSampledRequests
request specifies the ID of a
* RuleGroup
rather than the ID of an individual rule. RuleWithinRuleGroup
is the rule
* within the specified RuleGroup
that matched the request listed in the response.
*
*
* @param ruleWithinRuleGroup
* This value is returned if the GetSampledRequests
request specifies the ID of a
* RuleGroup
rather than the ID of an individual rule. RuleWithinRuleGroup
is the
* rule within the specified RuleGroup
that matched the request listed in the response.
*/
public void setRuleWithinRuleGroup(String ruleWithinRuleGroup) {
this.ruleWithinRuleGroup = ruleWithinRuleGroup;
}
/**
*
* This value is returned if the GetSampledRequests
request specifies the ID of a
* RuleGroup
rather than the ID of an individual rule. RuleWithinRuleGroup
is the rule
* within the specified RuleGroup
that matched the request listed in the response.
*
*
* @return This value is returned if the GetSampledRequests
request specifies the ID of a
* RuleGroup
rather than the ID of an individual rule. RuleWithinRuleGroup
is the
* rule within the specified RuleGroup
that matched the request listed in the response.
*/
public String getRuleWithinRuleGroup() {
return this.ruleWithinRuleGroup;
}
/**
*
* This value is returned if the GetSampledRequests
request specifies the ID of a
* RuleGroup
rather than the ID of an individual rule. RuleWithinRuleGroup
is the rule
* within the specified RuleGroup
that matched the request listed in the response.
*
*
* @param ruleWithinRuleGroup
* This value is returned if the GetSampledRequests
request specifies the ID of a
* RuleGroup
rather than the ID of an individual rule. RuleWithinRuleGroup
is the
* rule within the specified RuleGroup
that matched the request listed in the response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SampledHTTPRequest withRuleWithinRuleGroup(String ruleWithinRuleGroup) {
setRuleWithinRuleGroup(ruleWithinRuleGroup);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getRequest() != null)
sb.append("Request: ").append(getRequest()).append(",");
if (getWeight() != null)
sb.append("Weight: ").append(getWeight()).append(",");
if (getTimestamp() != null)
sb.append("Timestamp: ").append(getTimestamp()).append(",");
if (getAction() != null)
sb.append("Action: ").append(getAction()).append(",");
if (getRuleWithinRuleGroup() != null)
sb.append("RuleWithinRuleGroup: ").append(getRuleWithinRuleGroup());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SampledHTTPRequest == false)
return false;
SampledHTTPRequest other = (SampledHTTPRequest) obj;
if (other.getRequest() == null ^ this.getRequest() == null)
return false;
if (other.getRequest() != null && other.getRequest().equals(this.getRequest()) == false)
return false;
if (other.getWeight() == null ^ this.getWeight() == null)
return false;
if (other.getWeight() != null && other.getWeight().equals(this.getWeight()) == false)
return false;
if (other.getTimestamp() == null ^ this.getTimestamp() == null)
return false;
if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false)
return false;
if (other.getAction() == null ^ this.getAction() == null)
return false;
if (other.getAction() != null && other.getAction().equals(this.getAction()) == false)
return false;
if (other.getRuleWithinRuleGroup() == null ^ this.getRuleWithinRuleGroup() == null)
return false;
if (other.getRuleWithinRuleGroup() != null && other.getRuleWithinRuleGroup().equals(this.getRuleWithinRuleGroup()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRequest() == null) ? 0 : getRequest().hashCode());
hashCode = prime * hashCode + ((getWeight() == null) ? 0 : getWeight().hashCode());
hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode());
hashCode = prime * hashCode + ((getAction() == null) ? 0 : getAction().hashCode());
hashCode = prime * hashCode + ((getRuleWithinRuleGroup() == null) ? 0 : getRuleWithinRuleGroup().hashCode());
return hashCode;
}
@Override
public SampledHTTPRequest clone() {
try {
return (SampledHTTPRequest) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.waf.model.waf_regional.transform.SampledHTTPRequestMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}