com.amazonaws.services.networkfirewall.model.CustomAction Maven / Gradle / Ivy
Show all versions of aws-java-sdk-networkfirewall 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.networkfirewall.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An optional, non-standard action to use for stateless packet handling. You can define this in addition to the
* standard action that you must specify.
*
*
* You define and name the custom actions that you want to be able to use, and then you reference them by name in your
* actions settings.
*
*
* You can use custom actions in the following places:
*
*
* -
*
* In a rule group's StatelessRulesAndCustomActions specification. The custom actions are available for use by
* name inside the StatelessRulesAndCustomActions
where you define them. You can use them for your
* stateless rule actions to specify what to do with a packet that matches the rule's match attributes.
*
*
* -
*
* In a FirewallPolicy specification, in StatelessCustomActions
. The custom actions are available
* for use inside the policy where you define them. You can use them for the policy's default stateless actions settings
* to specify what to do with packets that don't match any of the policy's stateless rules.
*
*
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CustomAction implements Serializable, Cloneable, StructuredPojo {
/**
*
* The descriptive name of the custom action. You can't change the name of a custom action after you create it.
*
*/
private String actionName;
/**
*
* The custom action associated with the action name.
*
*/
private ActionDefinition actionDefinition;
/**
*
* The descriptive name of the custom action. You can't change the name of a custom action after you create it.
*
*
* @param actionName
* The descriptive name of the custom action. You can't change the name of a custom action after you create
* it.
*/
public void setActionName(String actionName) {
this.actionName = actionName;
}
/**
*
* The descriptive name of the custom action. You can't change the name of a custom action after you create it.
*
*
* @return The descriptive name of the custom action. You can't change the name of a custom action after you create
* it.
*/
public String getActionName() {
return this.actionName;
}
/**
*
* The descriptive name of the custom action. You can't change the name of a custom action after you create it.
*
*
* @param actionName
* The descriptive name of the custom action. You can't change the name of a custom action after you create
* it.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomAction withActionName(String actionName) {
setActionName(actionName);
return this;
}
/**
*
* The custom action associated with the action name.
*
*
* @param actionDefinition
* The custom action associated with the action name.
*/
public void setActionDefinition(ActionDefinition actionDefinition) {
this.actionDefinition = actionDefinition;
}
/**
*
* The custom action associated with the action name.
*
*
* @return The custom action associated with the action name.
*/
public ActionDefinition getActionDefinition() {
return this.actionDefinition;
}
/**
*
* The custom action associated with the action name.
*
*
* @param actionDefinition
* The custom action associated with the action name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomAction withActionDefinition(ActionDefinition actionDefinition) {
setActionDefinition(actionDefinition);
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 (getActionName() != null)
sb.append("ActionName: ").append(getActionName()).append(",");
if (getActionDefinition() != null)
sb.append("ActionDefinition: ").append(getActionDefinition());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CustomAction == false)
return false;
CustomAction other = (CustomAction) obj;
if (other.getActionName() == null ^ this.getActionName() == null)
return false;
if (other.getActionName() != null && other.getActionName().equals(this.getActionName()) == false)
return false;
if (other.getActionDefinition() == null ^ this.getActionDefinition() == null)
return false;
if (other.getActionDefinition() != null && other.getActionDefinition().equals(this.getActionDefinition()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getActionName() == null) ? 0 : getActionName().hashCode());
hashCode = prime * hashCode + ((getActionDefinition() == null) ? 0 : getActionDefinition().hashCode());
return hashCode;
}
@Override
public CustomAction clone() {
try {
return (CustomAction) 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.networkfirewall.model.transform.CustomActionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}