software.amazon.awssdk.services.fms.model.NetworkFirewallMissingSubnetViolation 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;
/**
*
* Violation detail for Network Firewall for an Availability Zone that's missing the expected Firewall Manager managed
* subnet.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class NetworkFirewallMissingSubnetViolation implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField VIOLATION_TARGET_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ViolationTarget").getter(getter(NetworkFirewallMissingSubnetViolation::violationTarget))
.setter(setter(Builder::violationTarget))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ViolationTarget").build()).build();
private static final SdkField VPC_FIELD = SdkField. builder(MarshallingType.STRING).memberName("VPC")
.getter(getter(NetworkFirewallMissingSubnetViolation::vpc)).setter(setter(Builder::vpc))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VPC").build()).build();
private static final SdkField AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AvailabilityZone").getter(getter(NetworkFirewallMissingSubnetViolation::availabilityZone))
.setter(setter(Builder::availabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZone").build()).build();
private static final SdkField TARGET_VIOLATION_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetViolationReason").getter(getter(NetworkFirewallMissingSubnetViolation::targetViolationReason))
.setter(setter(Builder::targetViolationReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetViolationReason").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VIOLATION_TARGET_FIELD,
VPC_FIELD, AVAILABILITY_ZONE_FIELD, TARGET_VIOLATION_REASON_FIELD));
private static final long serialVersionUID = 1L;
private final String violationTarget;
private final String vpc;
private final String availabilityZone;
private final String targetViolationReason;
private NetworkFirewallMissingSubnetViolation(BuilderImpl builder) {
this.violationTarget = builder.violationTarget;
this.vpc = builder.vpc;
this.availabilityZone = builder.availabilityZone;
this.targetViolationReason = builder.targetViolationReason;
}
/**
*
* The ID of the Network Firewall or VPC resource that's in violation.
*
*
* @return The ID of the Network Firewall or VPC resource that's in violation.
*/
public final String violationTarget() {
return violationTarget;
}
/**
*
* The resource ID of the VPC associated with a violating subnet.
*
*
* @return The resource ID of the VPC associated with a violating subnet.
*/
public final String vpc() {
return vpc;
}
/**
*
* The Availability Zone of a violating subnet.
*
*
* @return The Availability Zone of a violating subnet.
*/
public final String availabilityZone() {
return availabilityZone;
}
/**
*
* The reason the resource has this violation, if one is available.
*
*
* @return The reason the resource has this violation, if one is available.
*/
public final String targetViolationReason() {
return targetViolationReason;
}
@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(vpc());
hashCode = 31 * hashCode + Objects.hashCode(availabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(targetViolationReason());
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 NetworkFirewallMissingSubnetViolation)) {
return false;
}
NetworkFirewallMissingSubnetViolation other = (NetworkFirewallMissingSubnetViolation) obj;
return Objects.equals(violationTarget(), other.violationTarget()) && Objects.equals(vpc(), other.vpc())
&& Objects.equals(availabilityZone(), other.availabilityZone())
&& Objects.equals(targetViolationReason(), other.targetViolationReason());
}
/**
* 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("NetworkFirewallMissingSubnetViolation").add("ViolationTarget", violationTarget())
.add("VPC", vpc()).add("AvailabilityZone", availabilityZone())
.add("TargetViolationReason", targetViolationReason()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ViolationTarget":
return Optional.ofNullable(clazz.cast(violationTarget()));
case "VPC":
return Optional.ofNullable(clazz.cast(vpc()));
case "AvailabilityZone":
return Optional.ofNullable(clazz.cast(availabilityZone()));
case "TargetViolationReason":
return Optional.ofNullable(clazz.cast(targetViolationReason()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy