software.amazon.awssdk.services.fms.model.ThirdPartyFirewallMissingSubnetViolation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fms Show documentation
Show all versions of fms Show documentation
The AWS Java SDK for FMS module holds the client classes that are used for
communicating with FMS.
/*
* 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.HashMap;
import java.util.List;
import java.util.Map;
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 violation details for a third-party firewall for an Availability Zone that's missing the Firewall Manager managed
* subnet.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ThirdPartyFirewallMissingSubnetViolation implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField VIOLATION_TARGET_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ViolationTarget").getter(getter(ThirdPartyFirewallMissingSubnetViolation::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(ThirdPartyFirewallMissingSubnetViolation::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(ThirdPartyFirewallMissingSubnetViolation::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(ThirdPartyFirewallMissingSubnetViolation::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 Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("ViolationTarget", VIOLATION_TARGET_FIELD);
put("VPC", VPC_FIELD);
put("AvailabilityZone", AVAILABILITY_ZONE_FIELD);
put("TargetViolationReason", 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 ThirdPartyFirewallMissingSubnetViolation(BuilderImpl builder) {
this.violationTarget = builder.violationTarget;
this.vpc = builder.vpc;
this.availabilityZone = builder.availabilityZone;
this.targetViolationReason = builder.targetViolationReason;
}
/**
*
* The ID of the third-party firewall or VPC resource that's causing the violation.
*
*
* @return The ID of the third-party firewall or VPC resource that's causing the violation.
*/
public final String violationTarget() {
return violationTarget;
}
/**
*
* The resource ID of the VPC associated with a subnet that's causing the violation.
*
*
* @return The resource ID of the VPC associated with a subnet that's causing the violation.
*/
public final String vpc() {
return vpc;
}
/**
*
* The Availability Zone of a subnet that's causing the violation.
*
*
* @return The Availability Zone of a subnet that's causing the violation.
*/
public final String availabilityZone() {
return availabilityZone;
}
/**
*
* The reason the resource is causing the violation, if a reason is available.
*
*
* @return The reason the resource is causing the violation, if a reason 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 ThirdPartyFirewallMissingSubnetViolation)) {
return false;
}
ThirdPartyFirewallMissingSubnetViolation other = (ThirdPartyFirewallMissingSubnetViolation) 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("ThirdPartyFirewallMissingSubnetViolation").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;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy