com.amazonaws.services.waf.model.LoggingConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-waf Show documentation
/*
* Copyright 2019-2024 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 Amazon Kinesis Data Firehose, RedactedFields
information, and the web ACL Amazon Resource Name
* (ARN).
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LoggingConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs
.
*
*/
private String resourceArn;
/**
*
* An array of Amazon Kinesis Data Firehose ARNs.
*
*/
private java.util.List logDestinationConfigs;
/**
*
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie field, the
* cookie field in the firehose will be xxx
.
*
*/
private java.util.List redactedFields;
/**
*
* The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs
.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the web ACL that you want to associate with
* LogDestinationConfigs
.
*/
public void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs
.
*
*
* @return The Amazon Resource Name (ARN) of the web ACL that you want to associate with
* LogDestinationConfigs
.
*/
public String getResourceArn() {
return this.resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs
.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the web ACL that you want to associate with
* LogDestinationConfigs
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoggingConfiguration withResourceArn(String resourceArn) {
setResourceArn(resourceArn);
return this;
}
/**
*
* An array of Amazon Kinesis Data Firehose ARNs.
*
*
* @return An array of Amazon Kinesis Data Firehose ARNs.
*/
public java.util.List getLogDestinationConfigs() {
return logDestinationConfigs;
}
/**
*
* An array of Amazon Kinesis Data Firehose ARNs.
*
*
* @param logDestinationConfigs
* An array of Amazon Kinesis Data Firehose ARNs.
*/
public void setLogDestinationConfigs(java.util.Collection logDestinationConfigs) {
if (logDestinationConfigs == null) {
this.logDestinationConfigs = null;
return;
}
this.logDestinationConfigs = new java.util.ArrayList(logDestinationConfigs);
}
/**
*
* An array of Amazon Kinesis Data Firehose ARNs.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLogDestinationConfigs(java.util.Collection)} or
* {@link #withLogDestinationConfigs(java.util.Collection)} if you want to override the existing values.
*
*
* @param logDestinationConfigs
* An array of Amazon Kinesis Data Firehose ARNs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoggingConfiguration withLogDestinationConfigs(String... logDestinationConfigs) {
if (this.logDestinationConfigs == null) {
setLogDestinationConfigs(new java.util.ArrayList(logDestinationConfigs.length));
}
for (String ele : logDestinationConfigs) {
this.logDestinationConfigs.add(ele);
}
return this;
}
/**
*
* An array of Amazon Kinesis Data Firehose ARNs.
*
*
* @param logDestinationConfigs
* An array of Amazon Kinesis Data Firehose ARNs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoggingConfiguration withLogDestinationConfigs(java.util.Collection logDestinationConfigs) {
setLogDestinationConfigs(logDestinationConfigs);
return this;
}
/**
*
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie field, the
* cookie field in the firehose will be xxx
.
*
*
* @return The parts of the request that you want redacted from the logs. For example, if you redact the cookie
* field, the cookie field in the firehose will be xxx
.
*/
public java.util.List getRedactedFields() {
return redactedFields;
}
/**
*
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie field, the
* cookie field in the firehose will be xxx
.
*
*
* @param redactedFields
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie
* field, the cookie field in the firehose will be xxx
.
*/
public void setRedactedFields(java.util.Collection redactedFields) {
if (redactedFields == null) {
this.redactedFields = null;
return;
}
this.redactedFields = new java.util.ArrayList(redactedFields);
}
/**
*
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie field, the
* cookie field in the firehose will be xxx
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRedactedFields(java.util.Collection)} or {@link #withRedactedFields(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param redactedFields
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie
* field, the cookie field in the firehose will be xxx
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoggingConfiguration withRedactedFields(FieldToMatch... redactedFields) {
if (this.redactedFields == null) {
setRedactedFields(new java.util.ArrayList(redactedFields.length));
}
for (FieldToMatch ele : redactedFields) {
this.redactedFields.add(ele);
}
return this;
}
/**
*
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie field, the
* cookie field in the firehose will be xxx
.
*
*
* @param redactedFields
* The parts of the request that you want redacted from the logs. For example, if you redact the cookie
* field, the cookie field in the firehose will be xxx
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoggingConfiguration withRedactedFields(java.util.Collection redactedFields) {
setRedactedFields(redactedFields);
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 (getResourceArn() != null)
sb.append("ResourceArn: ").append(getResourceArn()).append(",");
if (getLogDestinationConfigs() != null)
sb.append("LogDestinationConfigs: ").append(getLogDestinationConfigs()).append(",");
if (getRedactedFields() != null)
sb.append("RedactedFields: ").append(getRedactedFields());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LoggingConfiguration == false)
return false;
LoggingConfiguration other = (LoggingConfiguration) obj;
if (other.getResourceArn() == null ^ this.getResourceArn() == null)
return false;
if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false)
return false;
if (other.getLogDestinationConfigs() == null ^ this.getLogDestinationConfigs() == null)
return false;
if (other.getLogDestinationConfigs() != null && other.getLogDestinationConfigs().equals(this.getLogDestinationConfigs()) == false)
return false;
if (other.getRedactedFields() == null ^ this.getRedactedFields() == null)
return false;
if (other.getRedactedFields() != null && other.getRedactedFields().equals(this.getRedactedFields()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode());
hashCode = prime * hashCode + ((getLogDestinationConfigs() == null) ? 0 : getLogDestinationConfigs().hashCode());
hashCode = prime * hashCode + ((getRedactedFields() == null) ? 0 : getRedactedFields().hashCode());
return hashCode;
}
@Override
public LoggingConfiguration clone() {
try {
return (LoggingConfiguration) 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.LoggingConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}