Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.Consumer;
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 based on resource type.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ResourceViolation implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField AWS_VPC_SECURITY_GROUP_VIOLATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("AwsVPCSecurityGroupViolation")
.getter(getter(ResourceViolation::awsVPCSecurityGroupViolation))
.setter(setter(Builder::awsVPCSecurityGroupViolation))
.constructor(AwsVPCSecurityGroupViolation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AwsVPCSecurityGroupViolation")
.build()).build();
private static final SdkField AWS_EC2_NETWORK_INTERFACE_VIOLATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("AwsEc2NetworkInterfaceViolation")
.getter(getter(ResourceViolation::awsEc2NetworkInterfaceViolation))
.setter(setter(Builder::awsEc2NetworkInterfaceViolation))
.constructor(AwsEc2NetworkInterfaceViolation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AwsEc2NetworkInterfaceViolation")
.build()).build();
private static final SdkField AWS_EC2_INSTANCE_VIOLATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AwsEc2InstanceViolation")
.getter(getter(ResourceViolation::awsEc2InstanceViolation)).setter(setter(Builder::awsEc2InstanceViolation))
.constructor(AwsEc2InstanceViolation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AwsEc2InstanceViolation").build())
.build();
private static final SdkField NETWORK_FIREWALL_MISSING_FIREWALL_VIOLATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("NetworkFirewallMissingFirewallViolation")
.getter(getter(ResourceViolation::networkFirewallMissingFirewallViolation))
.setter(setter(Builder::networkFirewallMissingFirewallViolation))
.constructor(NetworkFirewallMissingFirewallViolation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("NetworkFirewallMissingFirewallViolation").build()).build();
private static final SdkField NETWORK_FIREWALL_MISSING_SUBNET_VIOLATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("NetworkFirewallMissingSubnetViolation")
.getter(getter(ResourceViolation::networkFirewallMissingSubnetViolation))
.setter(setter(Builder::networkFirewallMissingSubnetViolation))
.constructor(NetworkFirewallMissingSubnetViolation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("NetworkFirewallMissingSubnetViolation").build()).build();
private static final SdkField NETWORK_FIREWALL_MISSING_EXPECTED_RT_VIOLATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("NetworkFirewallMissingExpectedRTViolation")
.getter(getter(ResourceViolation::networkFirewallMissingExpectedRTViolation))
.setter(setter(Builder::networkFirewallMissingExpectedRTViolation))
.constructor(NetworkFirewallMissingExpectedRTViolation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("NetworkFirewallMissingExpectedRTViolation").build()).build();
private static final SdkField NETWORK_FIREWALL_POLICY_MODIFIED_VIOLATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("NetworkFirewallPolicyModifiedViolation")
.getter(getter(ResourceViolation::networkFirewallPolicyModifiedViolation))
.setter(setter(Builder::networkFirewallPolicyModifiedViolation))
.constructor(NetworkFirewallPolicyModifiedViolation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("NetworkFirewallPolicyModifiedViolation").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
AWS_VPC_SECURITY_GROUP_VIOLATION_FIELD, AWS_EC2_NETWORK_INTERFACE_VIOLATION_FIELD, AWS_EC2_INSTANCE_VIOLATION_FIELD,
NETWORK_FIREWALL_MISSING_FIREWALL_VIOLATION_FIELD, NETWORK_FIREWALL_MISSING_SUBNET_VIOLATION_FIELD,
NETWORK_FIREWALL_MISSING_EXPECTED_RT_VIOLATION_FIELD, NETWORK_FIREWALL_POLICY_MODIFIED_VIOLATION_FIELD));
private static final long serialVersionUID = 1L;
private final AwsVPCSecurityGroupViolation awsVPCSecurityGroupViolation;
private final AwsEc2NetworkInterfaceViolation awsEc2NetworkInterfaceViolation;
private final AwsEc2InstanceViolation awsEc2InstanceViolation;
private final NetworkFirewallMissingFirewallViolation networkFirewallMissingFirewallViolation;
private final NetworkFirewallMissingSubnetViolation networkFirewallMissingSubnetViolation;
private final NetworkFirewallMissingExpectedRTViolation networkFirewallMissingExpectedRTViolation;
private final NetworkFirewallPolicyModifiedViolation networkFirewallPolicyModifiedViolation;
private ResourceViolation(BuilderImpl builder) {
this.awsVPCSecurityGroupViolation = builder.awsVPCSecurityGroupViolation;
this.awsEc2NetworkInterfaceViolation = builder.awsEc2NetworkInterfaceViolation;
this.awsEc2InstanceViolation = builder.awsEc2InstanceViolation;
this.networkFirewallMissingFirewallViolation = builder.networkFirewallMissingFirewallViolation;
this.networkFirewallMissingSubnetViolation = builder.networkFirewallMissingSubnetViolation;
this.networkFirewallMissingExpectedRTViolation = builder.networkFirewallMissingExpectedRTViolation;
this.networkFirewallPolicyModifiedViolation = builder.networkFirewallPolicyModifiedViolation;
}
/**
*
* Violation details for security groups.
*
*
* @return Violation details for security groups.
*/
public AwsVPCSecurityGroupViolation awsVPCSecurityGroupViolation() {
return awsVPCSecurityGroupViolation;
}
/**
*
* Violation details for network interface.
*
*
* @return Violation details for network interface.
*/
public AwsEc2NetworkInterfaceViolation awsEc2NetworkInterfaceViolation() {
return awsEc2NetworkInterfaceViolation;
}
/**
*
* Violation details for an EC2 instance.
*
*
* @return Violation details for an EC2 instance.
*/
public AwsEc2InstanceViolation awsEc2InstanceViolation() {
return awsEc2InstanceViolation;
}
/**
*
* Violation detail for an Network Firewall policy that indicates that a subnet has no Firewall Manager managed
* firewall in its VPC.
*
*
* @return Violation detail for an Network Firewall policy that indicates that a subnet has no Firewall Manager
* managed firewall in its VPC.
*/
public NetworkFirewallMissingFirewallViolation networkFirewallMissingFirewallViolation() {
return networkFirewallMissingFirewallViolation;
}
/**
*
* Violation detail for an Network Firewall policy that indicates that an Availability Zone is missing the expected
* Firewall Manager managed subnet.
*
*
* @return Violation detail for an Network Firewall policy that indicates that an Availability Zone is missing the
* expected Firewall Manager managed subnet.
*/
public NetworkFirewallMissingSubnetViolation networkFirewallMissingSubnetViolation() {
return networkFirewallMissingSubnetViolation;
}
/**
*
* Violation detail for an Network Firewall policy that indicates that a subnet is not associated with the expected
* Firewall Manager managed route table.
*
*
* @return Violation detail for an Network Firewall policy that indicates that a subnet is not associated with the
* expected Firewall Manager managed route table.
*/
public NetworkFirewallMissingExpectedRTViolation networkFirewallMissingExpectedRTViolation() {
return networkFirewallMissingExpectedRTViolation;
}
/**
*
* Violation detail for an Network Firewall policy that indicates that a firewall policy in an individual account
* has been modified in a way that makes it noncompliant. For example, the individual account owner might have
* deleted a rule group, changed the priority of a stateless rule group, or changed a policy default action.
*
*
* @return Violation detail for an Network Firewall policy that indicates that a firewall policy in an individual
* account has been modified in a way that makes it noncompliant. For example, the individual account owner
* might have deleted a rule group, changed the priority of a stateless rule group, or changed a policy
* default action.
*/
public NetworkFirewallPolicyModifiedViolation networkFirewallPolicyModifiedViolation() {
return networkFirewallPolicyModifiedViolation;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(awsVPCSecurityGroupViolation());
hashCode = 31 * hashCode + Objects.hashCode(awsEc2NetworkInterfaceViolation());
hashCode = 31 * hashCode + Objects.hashCode(awsEc2InstanceViolation());
hashCode = 31 * hashCode + Objects.hashCode(networkFirewallMissingFirewallViolation());
hashCode = 31 * hashCode + Objects.hashCode(networkFirewallMissingSubnetViolation());
hashCode = 31 * hashCode + Objects.hashCode(networkFirewallMissingExpectedRTViolation());
hashCode = 31 * hashCode + Objects.hashCode(networkFirewallPolicyModifiedViolation());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ResourceViolation)) {
return false;
}
ResourceViolation other = (ResourceViolation) obj;
return Objects.equals(awsVPCSecurityGroupViolation(), other.awsVPCSecurityGroupViolation())
&& Objects.equals(awsEc2NetworkInterfaceViolation(), other.awsEc2NetworkInterfaceViolation())
&& Objects.equals(awsEc2InstanceViolation(), other.awsEc2InstanceViolation())
&& Objects.equals(networkFirewallMissingFirewallViolation(), other.networkFirewallMissingFirewallViolation())
&& Objects.equals(networkFirewallMissingSubnetViolation(), other.networkFirewallMissingSubnetViolation())
&& Objects.equals(networkFirewallMissingExpectedRTViolation(), other.networkFirewallMissingExpectedRTViolation())
&& Objects.equals(networkFirewallPolicyModifiedViolation(), other.networkFirewallPolicyModifiedViolation());
}
/**
* 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 String toString() {
return ToString.builder("ResourceViolation").add("AwsVPCSecurityGroupViolation", awsVPCSecurityGroupViolation())
.add("AwsEc2NetworkInterfaceViolation", awsEc2NetworkInterfaceViolation())
.add("AwsEc2InstanceViolation", awsEc2InstanceViolation())
.add("NetworkFirewallMissingFirewallViolation", networkFirewallMissingFirewallViolation())
.add("NetworkFirewallMissingSubnetViolation", networkFirewallMissingSubnetViolation())
.add("NetworkFirewallMissingExpectedRTViolation", networkFirewallMissingExpectedRTViolation())
.add("NetworkFirewallPolicyModifiedViolation", networkFirewallPolicyModifiedViolation()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AwsVPCSecurityGroupViolation":
return Optional.ofNullable(clazz.cast(awsVPCSecurityGroupViolation()));
case "AwsEc2NetworkInterfaceViolation":
return Optional.ofNullable(clazz.cast(awsEc2NetworkInterfaceViolation()));
case "AwsEc2InstanceViolation":
return Optional.ofNullable(clazz.cast(awsEc2InstanceViolation()));
case "NetworkFirewallMissingFirewallViolation":
return Optional.ofNullable(clazz.cast(networkFirewallMissingFirewallViolation()));
case "NetworkFirewallMissingSubnetViolation":
return Optional.ofNullable(clazz.cast(networkFirewallMissingSubnetViolation()));
case "NetworkFirewallMissingExpectedRTViolation":
return Optional.ofNullable(clazz.cast(networkFirewallMissingExpectedRTViolation()));
case "NetworkFirewallPolicyModifiedViolation":
return Optional.ofNullable(clazz.cast(networkFirewallPolicyModifiedViolation()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function