com.amazonaws.services.fms.model.AwsVPCSecurityGroupViolation Maven / Gradle / Ivy
Show all versions of aws-java-sdk-fms 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.fms.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Violation detail for the rule violation in a security group when compared to the primary security group of the
* Firewall Manager policy.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsVPCSecurityGroupViolation implements Serializable, Cloneable, StructuredPojo {
/**
*
* The security group rule that is being evaluated.
*
*/
private String violationTarget;
/**
*
* A description of the security group that violates the policy.
*
*/
private String violationTargetDescription;
/**
*
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
*
*/
private java.util.List partialMatches;
/**
*
* Remediation options for the rule specified in the ViolationTarget
.
*
*/
private java.util.List possibleSecurityGroupRemediationActions;
/**
*
* The security group rule that is being evaluated.
*
*
* @param violationTarget
* The security group rule that is being evaluated.
*/
public void setViolationTarget(String violationTarget) {
this.violationTarget = violationTarget;
}
/**
*
* The security group rule that is being evaluated.
*
*
* @return The security group rule that is being evaluated.
*/
public String getViolationTarget() {
return this.violationTarget;
}
/**
*
* The security group rule that is being evaluated.
*
*
* @param violationTarget
* The security group rule that is being evaluated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsVPCSecurityGroupViolation withViolationTarget(String violationTarget) {
setViolationTarget(violationTarget);
return this;
}
/**
*
* A description of the security group that violates the policy.
*
*
* @param violationTargetDescription
* A description of the security group that violates the policy.
*/
public void setViolationTargetDescription(String violationTargetDescription) {
this.violationTargetDescription = violationTargetDescription;
}
/**
*
* A description of the security group that violates the policy.
*
*
* @return A description of the security group that violates the policy.
*/
public String getViolationTargetDescription() {
return this.violationTargetDescription;
}
/**
*
* A description of the security group that violates the policy.
*
*
* @param violationTargetDescription
* A description of the security group that violates the policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsVPCSecurityGroupViolation withViolationTargetDescription(String violationTargetDescription) {
setViolationTargetDescription(violationTargetDescription);
return this;
}
/**
*
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
*
*
* @return List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
*/
public java.util.List getPartialMatches() {
return partialMatches;
}
/**
*
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
*
*
* @param partialMatches
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
*/
public void setPartialMatches(java.util.Collection partialMatches) {
if (partialMatches == null) {
this.partialMatches = null;
return;
}
this.partialMatches = new java.util.ArrayList(partialMatches);
}
/**
*
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPartialMatches(java.util.Collection)} or {@link #withPartialMatches(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param partialMatches
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsVPCSecurityGroupViolation withPartialMatches(PartialMatch... partialMatches) {
if (this.partialMatches == null) {
setPartialMatches(new java.util.ArrayList(partialMatches.length));
}
for (PartialMatch ele : partialMatches) {
this.partialMatches.add(ele);
}
return this;
}
/**
*
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
*
*
* @param partialMatches
* List of rules specified in the security group of the Firewall Manager policy that partially match the
* ViolationTarget
rule.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsVPCSecurityGroupViolation withPartialMatches(java.util.Collection partialMatches) {
setPartialMatches(partialMatches);
return this;
}
/**
*
* Remediation options for the rule specified in the ViolationTarget
.
*
*
* @return Remediation options for the rule specified in the ViolationTarget
.
*/
public java.util.List getPossibleSecurityGroupRemediationActions() {
return possibleSecurityGroupRemediationActions;
}
/**
*
* Remediation options for the rule specified in the ViolationTarget
.
*
*
* @param possibleSecurityGroupRemediationActions
* Remediation options for the rule specified in the ViolationTarget
.
*/
public void setPossibleSecurityGroupRemediationActions(java.util.Collection possibleSecurityGroupRemediationActions) {
if (possibleSecurityGroupRemediationActions == null) {
this.possibleSecurityGroupRemediationActions = null;
return;
}
this.possibleSecurityGroupRemediationActions = new java.util.ArrayList(possibleSecurityGroupRemediationActions);
}
/**
*
* Remediation options for the rule specified in the ViolationTarget
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPossibleSecurityGroupRemediationActions(java.util.Collection)} or
* {@link #withPossibleSecurityGroupRemediationActions(java.util.Collection)} if you want to override the existing
* values.
*
*
* @param possibleSecurityGroupRemediationActions
* Remediation options for the rule specified in the ViolationTarget
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsVPCSecurityGroupViolation withPossibleSecurityGroupRemediationActions(SecurityGroupRemediationAction... possibleSecurityGroupRemediationActions) {
if (this.possibleSecurityGroupRemediationActions == null) {
setPossibleSecurityGroupRemediationActions(new java.util.ArrayList(possibleSecurityGroupRemediationActions.length));
}
for (SecurityGroupRemediationAction ele : possibleSecurityGroupRemediationActions) {
this.possibleSecurityGroupRemediationActions.add(ele);
}
return this;
}
/**
*
* Remediation options for the rule specified in the ViolationTarget
.
*
*
* @param possibleSecurityGroupRemediationActions
* Remediation options for the rule specified in the ViolationTarget
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsVPCSecurityGroupViolation withPossibleSecurityGroupRemediationActions(
java.util.Collection possibleSecurityGroupRemediationActions) {
setPossibleSecurityGroupRemediationActions(possibleSecurityGroupRemediationActions);
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 (getViolationTarget() != null)
sb.append("ViolationTarget: ").append(getViolationTarget()).append(",");
if (getViolationTargetDescription() != null)
sb.append("ViolationTargetDescription: ").append(getViolationTargetDescription()).append(",");
if (getPartialMatches() != null)
sb.append("PartialMatches: ").append(getPartialMatches()).append(",");
if (getPossibleSecurityGroupRemediationActions() != null)
sb.append("PossibleSecurityGroupRemediationActions: ").append(getPossibleSecurityGroupRemediationActions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsVPCSecurityGroupViolation == false)
return false;
AwsVPCSecurityGroupViolation other = (AwsVPCSecurityGroupViolation) obj;
if (other.getViolationTarget() == null ^ this.getViolationTarget() == null)
return false;
if (other.getViolationTarget() != null && other.getViolationTarget().equals(this.getViolationTarget()) == false)
return false;
if (other.getViolationTargetDescription() == null ^ this.getViolationTargetDescription() == null)
return false;
if (other.getViolationTargetDescription() != null && other.getViolationTargetDescription().equals(this.getViolationTargetDescription()) == false)
return false;
if (other.getPartialMatches() == null ^ this.getPartialMatches() == null)
return false;
if (other.getPartialMatches() != null && other.getPartialMatches().equals(this.getPartialMatches()) == false)
return false;
if (other.getPossibleSecurityGroupRemediationActions() == null ^ this.getPossibleSecurityGroupRemediationActions() == null)
return false;
if (other.getPossibleSecurityGroupRemediationActions() != null
&& other.getPossibleSecurityGroupRemediationActions().equals(this.getPossibleSecurityGroupRemediationActions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getViolationTarget() == null) ? 0 : getViolationTarget().hashCode());
hashCode = prime * hashCode + ((getViolationTargetDescription() == null) ? 0 : getViolationTargetDescription().hashCode());
hashCode = prime * hashCode + ((getPartialMatches() == null) ? 0 : getPartialMatches().hashCode());
hashCode = prime * hashCode + ((getPossibleSecurityGroupRemediationActions() == null) ? 0 : getPossibleSecurityGroupRemediationActions().hashCode());
return hashCode;
}
@Override
public AwsVPCSecurityGroupViolation clone() {
try {
return (AwsVPCSecurityGroupViolation) 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.fms.model.transform.AwsVPCSecurityGroupViolationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}