com.amazonaws.services.route53resolver.model.FirewallConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-route53resolver Show documentation
/*
* Copyright 2016-2021 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.route53resolver.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Configuration of the firewall behavior provided by DNS Firewall for a single VPC from Amazon Virtual Private Cloud
* (Amazon VPC).
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FirewallConfig implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of the firewall configuration.
*
*/
private String id;
/**
*
* The ID of the VPC that this firewall configuration applies to.
*
*/
private String resourceId;
/**
*
* The AWS account ID of the owner of the VPC that this firewall configuration applies to.
*
*/
private String ownerId;
/**
*
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS Firewall
* fails to receive a reply.
*
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security over
* availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
*
*/
private String firewallFailOpen;
/**
*
* The ID of the firewall configuration.
*
*
* @param id
* The ID of the firewall configuration.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The ID of the firewall configuration.
*
*
* @return The ID of the firewall configuration.
*/
public String getId() {
return this.id;
}
/**
*
* The ID of the firewall configuration.
*
*
* @param id
* The ID of the firewall configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FirewallConfig withId(String id) {
setId(id);
return this;
}
/**
*
* The ID of the VPC that this firewall configuration applies to.
*
*
* @param resourceId
* The ID of the VPC that this firewall configuration applies to.
*/
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
/**
*
* The ID of the VPC that this firewall configuration applies to.
*
*
* @return The ID of the VPC that this firewall configuration applies to.
*/
public String getResourceId() {
return this.resourceId;
}
/**
*
* The ID of the VPC that this firewall configuration applies to.
*
*
* @param resourceId
* The ID of the VPC that this firewall configuration applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FirewallConfig withResourceId(String resourceId) {
setResourceId(resourceId);
return this;
}
/**
*
* The AWS account ID of the owner of the VPC that this firewall configuration applies to.
*
*
* @param ownerId
* The AWS account ID of the owner of the VPC that this firewall configuration applies to.
*/
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
/**
*
* The AWS account ID of the owner of the VPC that this firewall configuration applies to.
*
*
* @return The AWS account ID of the owner of the VPC that this firewall configuration applies to.
*/
public String getOwnerId() {
return this.ownerId;
}
/**
*
* The AWS account ID of the owner of the VPC that this firewall configuration applies to.
*
*
* @param ownerId
* The AWS account ID of the owner of the VPC that this firewall configuration applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FirewallConfig withOwnerId(String ownerId) {
setOwnerId(ownerId);
return this;
}
/**
*
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS Firewall
* fails to receive a reply.
*
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security over
* availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
*
*
* @param firewallFailOpen
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS
* Firewall fails to receive a reply.
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security
* over availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
* @see FirewallFailOpenStatus
*/
public void setFirewallFailOpen(String firewallFailOpen) {
this.firewallFailOpen = firewallFailOpen;
}
/**
*
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS Firewall
* fails to receive a reply.
*
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security over
* availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
*
*
* @return Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS
* Firewall fails to receive a reply.
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security
* over availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
* @see FirewallFailOpenStatus
*/
public String getFirewallFailOpen() {
return this.firewallFailOpen;
}
/**
*
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS Firewall
* fails to receive a reply.
*
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security over
* availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
*
*
* @param firewallFailOpen
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS
* Firewall fails to receive a reply.
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security
* over availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FirewallFailOpenStatus
*/
public FirewallConfig withFirewallFailOpen(String firewallFailOpen) {
setFirewallFailOpen(firewallFailOpen);
return this;
}
/**
*
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS Firewall
* fails to receive a reply.
*
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security over
* availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
*
*
* @param firewallFailOpen
* Determines how DNS Firewall operates during failures, for example when all traffic that is sent to DNS
* Firewall fails to receive a reply.
*
* -
*
* By default, fail open is disabled, which means the failure mode is closed. This approach favors security
* over availability. DNS Firewall returns a failure error when it is unable to properly evaluate a query.
*
*
* -
*
* If you enable this option, the failure mode is open. This approach favors availability over security. DNS
* Firewall allows queries to proceed if it is unable to properly evaluate them.
*
*
*
*
* This behavior is only enforced for VPCs that have at least one DNS Firewall rule group association.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FirewallFailOpenStatus
*/
public FirewallConfig withFirewallFailOpen(FirewallFailOpenStatus firewallFailOpen) {
this.firewallFailOpen = firewallFailOpen.toString();
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 (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getResourceId() != null)
sb.append("ResourceId: ").append(getResourceId()).append(",");
if (getOwnerId() != null)
sb.append("OwnerId: ").append(getOwnerId()).append(",");
if (getFirewallFailOpen() != null)
sb.append("FirewallFailOpen: ").append(getFirewallFailOpen());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FirewallConfig == false)
return false;
FirewallConfig other = (FirewallConfig) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getResourceId() == null ^ this.getResourceId() == null)
return false;
if (other.getResourceId() != null && other.getResourceId().equals(this.getResourceId()) == false)
return false;
if (other.getOwnerId() == null ^ this.getOwnerId() == null)
return false;
if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == false)
return false;
if (other.getFirewallFailOpen() == null ^ this.getFirewallFailOpen() == null)
return false;
if (other.getFirewallFailOpen() != null && other.getFirewallFailOpen().equals(this.getFirewallFailOpen()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getResourceId() == null) ? 0 : getResourceId().hashCode());
hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode());
hashCode = prime * hashCode + ((getFirewallFailOpen() == null) ? 0 : getFirewallFailOpen().hashCode());
return hashCode;
}
@Override
public FirewallConfig clone() {
try {
return (FirewallConfig) 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.route53resolver.model.transform.FirewallConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}