software.amazon.awssdk.services.fms.model.DnsRuleGroupLimitExceededViolation Maven / Gradle / Ivy
/*
* Copyright 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 software.amazon.awssdk.services.fms.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The VPC that Firewall Manager was applying a DNS Fireall policy to reached the limit for associated DNS Firewall rule
* groups. Firewall Manager tried to associate another rule group with the VPC and failed due to the limit.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DnsRuleGroupLimitExceededViolation implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField VIOLATION_TARGET_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ViolationTarget").getter(getter(DnsRuleGroupLimitExceededViolation::violationTarget))
.setter(setter(Builder::violationTarget))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ViolationTarget").build()).build();
private static final SdkField VIOLATION_TARGET_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ViolationTargetDescription")
.getter(getter(DnsRuleGroupLimitExceededViolation::violationTargetDescription))
.setter(setter(Builder::violationTargetDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ViolationTargetDescription").build())
.build();
private static final SdkField NUMBER_OF_RULE_GROUPS_ALREADY_ASSOCIATED_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("NumberOfRuleGroupsAlreadyAssociated")
.getter(getter(DnsRuleGroupLimitExceededViolation::numberOfRuleGroupsAlreadyAssociated))
.setter(setter(Builder::numberOfRuleGroupsAlreadyAssociated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("NumberOfRuleGroupsAlreadyAssociated").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VIOLATION_TARGET_FIELD,
VIOLATION_TARGET_DESCRIPTION_FIELD, NUMBER_OF_RULE_GROUPS_ALREADY_ASSOCIATED_FIELD));
private static final long serialVersionUID = 1L;
private final String violationTarget;
private final String violationTargetDescription;
private final Integer numberOfRuleGroupsAlreadyAssociated;
private DnsRuleGroupLimitExceededViolation(BuilderImpl builder) {
this.violationTarget = builder.violationTarget;
this.violationTargetDescription = builder.violationTargetDescription;
this.numberOfRuleGroupsAlreadyAssociated = builder.numberOfRuleGroupsAlreadyAssociated;
}
/**
*
* Information about the VPC ID.
*
*
* @return Information about the VPC ID.
*/
public final String violationTarget() {
return violationTarget;
}
/**
*
* A description of the violation that specifies the rule group and VPC.
*
*
* @return A description of the violation that specifies the rule group and VPC.
*/
public final String violationTargetDescription() {
return violationTargetDescription;
}
/**
*
* The number of rule groups currently associated with the VPC.
*
*
* @return The number of rule groups currently associated with the VPC.
*/
public final Integer numberOfRuleGroupsAlreadyAssociated() {
return numberOfRuleGroupsAlreadyAssociated;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(violationTarget());
hashCode = 31 * hashCode + Objects.hashCode(violationTargetDescription());
hashCode = 31 * hashCode + Objects.hashCode(numberOfRuleGroupsAlreadyAssociated());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DnsRuleGroupLimitExceededViolation)) {
return false;
}
DnsRuleGroupLimitExceededViolation other = (DnsRuleGroupLimitExceededViolation) obj;
return Objects.equals(violationTarget(), other.violationTarget())
&& Objects.equals(violationTargetDescription(), other.violationTargetDescription())
&& Objects.equals(numberOfRuleGroupsAlreadyAssociated(), other.numberOfRuleGroupsAlreadyAssociated());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("DnsRuleGroupLimitExceededViolation").add("ViolationTarget", violationTarget())
.add("ViolationTargetDescription", violationTargetDescription())
.add("NumberOfRuleGroupsAlreadyAssociated", numberOfRuleGroupsAlreadyAssociated()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ViolationTarget":
return Optional.ofNullable(clazz.cast(violationTarget()));
case "ViolationTargetDescription":
return Optional.ofNullable(clazz.cast(violationTargetDescription()));
case "NumberOfRuleGroupsAlreadyAssociated":
return Optional.ofNullable(clazz.cast(numberOfRuleGroupsAlreadyAssociated()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy