software.amazon.awssdk.services.fms.model.RouteHasOutOfScopeEndpointViolation Maven / Gradle / Ivy
Show all versions of fms Show documentation
/*
* 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.beans.Transient;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Contains details about the route endpoint that violates the policy scope.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RouteHasOutOfScopeEndpointViolation implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SubnetId").getter(getter(RouteHasOutOfScopeEndpointViolation::subnetId))
.setter(setter(Builder::subnetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetId").build()).build();
private static final SdkField VPC_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("VpcId")
.getter(getter(RouteHasOutOfScopeEndpointViolation::vpcId)).setter(setter(Builder::vpcId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcId").build()).build();
private static final SdkField ROUTE_TABLE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RouteTableId").getter(getter(RouteHasOutOfScopeEndpointViolation::routeTableId))
.setter(setter(Builder::routeTableId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RouteTableId").build()).build();
private static final SdkField> VIOLATING_ROUTES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ViolatingRoutes")
.getter(getter(RouteHasOutOfScopeEndpointViolation::violatingRoutes))
.setter(setter(Builder::violatingRoutes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ViolatingRoutes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Route::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField SUBNET_AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SubnetAvailabilityZone").getter(getter(RouteHasOutOfScopeEndpointViolation::subnetAvailabilityZone))
.setter(setter(Builder::subnetAvailabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetAvailabilityZone").build())
.build();
private static final SdkField SUBNET_AVAILABILITY_ZONE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SubnetAvailabilityZoneId").getter(getter(RouteHasOutOfScopeEndpointViolation::subnetAvailabilityZoneId))
.setter(setter(Builder::subnetAvailabilityZoneId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetAvailabilityZoneId").build())
.build();
private static final SdkField CURRENT_FIREWALL_SUBNET_ROUTE_TABLE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CurrentFirewallSubnetRouteTable")
.getter(getter(RouteHasOutOfScopeEndpointViolation::currentFirewallSubnetRouteTable))
.setter(setter(Builder::currentFirewallSubnetRouteTable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentFirewallSubnetRouteTable")
.build()).build();
private static final SdkField FIREWALL_SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FirewallSubnetId").getter(getter(RouteHasOutOfScopeEndpointViolation::firewallSubnetId))
.setter(setter(Builder::firewallSubnetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FirewallSubnetId").build()).build();
private static final SdkField> FIREWALL_SUBNET_ROUTES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("FirewallSubnetRoutes")
.getter(getter(RouteHasOutOfScopeEndpointViolation::firewallSubnetRoutes))
.setter(setter(Builder::firewallSubnetRoutes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FirewallSubnetRoutes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Route::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField INTERNET_GATEWAY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("InternetGatewayId").getter(getter(RouteHasOutOfScopeEndpointViolation::internetGatewayId))
.setter(setter(Builder::internetGatewayId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InternetGatewayId").build()).build();
private static final SdkField CURRENT_INTERNET_GATEWAY_ROUTE_TABLE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CurrentInternetGatewayRouteTable")
.getter(getter(RouteHasOutOfScopeEndpointViolation::currentInternetGatewayRouteTable))
.setter(setter(Builder::currentInternetGatewayRouteTable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentInternetGatewayRouteTable")
.build()).build();
private static final SdkField> INTERNET_GATEWAY_ROUTES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("InternetGatewayRoutes")
.getter(getter(RouteHasOutOfScopeEndpointViolation::internetGatewayRoutes))
.setter(setter(Builder::internetGatewayRoutes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InternetGatewayRoutes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Route::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SUBNET_ID_FIELD, VPC_ID_FIELD,
ROUTE_TABLE_ID_FIELD, VIOLATING_ROUTES_FIELD, SUBNET_AVAILABILITY_ZONE_FIELD, SUBNET_AVAILABILITY_ZONE_ID_FIELD,
CURRENT_FIREWALL_SUBNET_ROUTE_TABLE_FIELD, FIREWALL_SUBNET_ID_FIELD, FIREWALL_SUBNET_ROUTES_FIELD,
INTERNET_GATEWAY_ID_FIELD, CURRENT_INTERNET_GATEWAY_ROUTE_TABLE_FIELD, INTERNET_GATEWAY_ROUTES_FIELD));
private static final long serialVersionUID = 1L;
private final String subnetId;
private final String vpcId;
private final String routeTableId;
private final List violatingRoutes;
private final String subnetAvailabilityZone;
private final String subnetAvailabilityZoneId;
private final String currentFirewallSubnetRouteTable;
private final String firewallSubnetId;
private final List firewallSubnetRoutes;
private final String internetGatewayId;
private final String currentInternetGatewayRouteTable;
private final List internetGatewayRoutes;
private RouteHasOutOfScopeEndpointViolation(BuilderImpl builder) {
this.subnetId = builder.subnetId;
this.vpcId = builder.vpcId;
this.routeTableId = builder.routeTableId;
this.violatingRoutes = builder.violatingRoutes;
this.subnetAvailabilityZone = builder.subnetAvailabilityZone;
this.subnetAvailabilityZoneId = builder.subnetAvailabilityZoneId;
this.currentFirewallSubnetRouteTable = builder.currentFirewallSubnetRouteTable;
this.firewallSubnetId = builder.firewallSubnetId;
this.firewallSubnetRoutes = builder.firewallSubnetRoutes;
this.internetGatewayId = builder.internetGatewayId;
this.currentInternetGatewayRouteTable = builder.currentInternetGatewayRouteTable;
this.internetGatewayRoutes = builder.internetGatewayRoutes;
}
/**
*
* The ID of the subnet associated with the route that violates the policy scope.
*
*
* @return The ID of the subnet associated with the route that violates the policy scope.
*/
public final String subnetId() {
return subnetId;
}
/**
*
* The VPC ID of the route that violates the policy scope.
*
*
* @return The VPC ID of the route that violates the policy scope.
*/
public final String vpcId() {
return vpcId;
}
/**
*
* The ID of the route table.
*
*
* @return The ID of the route table.
*/
public final String routeTableId() {
return routeTableId;
}
/**
* For responses, this returns true if the service returned a value for the ViolatingRoutes property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasViolatingRoutes() {
return violatingRoutes != null && !(violatingRoutes instanceof SdkAutoConstructList);
}
/**
*
* The list of routes that violate the route table.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasViolatingRoutes} method.
*
*
* @return The list of routes that violate the route table.
*/
public final List violatingRoutes() {
return violatingRoutes;
}
/**
*
* The subnet's Availability Zone.
*
*
* @return The subnet's Availability Zone.
*/
public final String subnetAvailabilityZone() {
return subnetAvailabilityZone;
}
/**
*
* The ID of the subnet's Availability Zone.
*
*
* @return The ID of the subnet's Availability Zone.
*/
public final String subnetAvailabilityZoneId() {
return subnetAvailabilityZoneId;
}
/**
*
* The route table associated with the current firewall subnet.
*
*
* @return The route table associated with the current firewall subnet.
*/
public final String currentFirewallSubnetRouteTable() {
return currentFirewallSubnetRouteTable;
}
/**
*
* The ID of the firewall subnet.
*
*
* @return The ID of the firewall subnet.
*/
public final String firewallSubnetId() {
return firewallSubnetId;
}
/**
* For responses, this returns true if the service returned a value for the FirewallSubnetRoutes property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasFirewallSubnetRoutes() {
return firewallSubnetRoutes != null && !(firewallSubnetRoutes instanceof SdkAutoConstructList);
}
/**
*
* The list of firewall subnet routes.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasFirewallSubnetRoutes} method.
*
*
* @return The list of firewall subnet routes.
*/
public final List firewallSubnetRoutes() {
return firewallSubnetRoutes;
}
/**
*
* The ID of the Internet Gateway.
*
*
* @return The ID of the Internet Gateway.
*/
public final String internetGatewayId() {
return internetGatewayId;
}
/**
*
* The current route table associated with the Internet Gateway.
*
*
* @return The current route table associated with the Internet Gateway.
*/
public final String currentInternetGatewayRouteTable() {
return currentInternetGatewayRouteTable;
}
/**
* For responses, this returns true if the service returned a value for the InternetGatewayRoutes property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasInternetGatewayRoutes() {
return internetGatewayRoutes != null && !(internetGatewayRoutes instanceof SdkAutoConstructList);
}
/**
*
* The routes in the route table associated with the Internet Gateway.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasInternetGatewayRoutes} method.
*
*
* @return The routes in the route table associated with the Internet Gateway.
*/
public final List internetGatewayRoutes() {
return internetGatewayRoutes;
}
@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(subnetId());
hashCode = 31 * hashCode + Objects.hashCode(vpcId());
hashCode = 31 * hashCode + Objects.hashCode(routeTableId());
hashCode = 31 * hashCode + Objects.hashCode(hasViolatingRoutes() ? violatingRoutes() : null);
hashCode = 31 * hashCode + Objects.hashCode(subnetAvailabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(subnetAvailabilityZoneId());
hashCode = 31 * hashCode + Objects.hashCode(currentFirewallSubnetRouteTable());
hashCode = 31 * hashCode + Objects.hashCode(firewallSubnetId());
hashCode = 31 * hashCode + Objects.hashCode(hasFirewallSubnetRoutes() ? firewallSubnetRoutes() : null);
hashCode = 31 * hashCode + Objects.hashCode(internetGatewayId());
hashCode = 31 * hashCode + Objects.hashCode(currentInternetGatewayRouteTable());
hashCode = 31 * hashCode + Objects.hashCode(hasInternetGatewayRoutes() ? internetGatewayRoutes() : null);
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 RouteHasOutOfScopeEndpointViolation)) {
return false;
}
RouteHasOutOfScopeEndpointViolation other = (RouteHasOutOfScopeEndpointViolation) obj;
return Objects.equals(subnetId(), other.subnetId()) && Objects.equals(vpcId(), other.vpcId())
&& Objects.equals(routeTableId(), other.routeTableId()) && hasViolatingRoutes() == other.hasViolatingRoutes()
&& Objects.equals(violatingRoutes(), other.violatingRoutes())
&& Objects.equals(subnetAvailabilityZone(), other.subnetAvailabilityZone())
&& Objects.equals(subnetAvailabilityZoneId(), other.subnetAvailabilityZoneId())
&& Objects.equals(currentFirewallSubnetRouteTable(), other.currentFirewallSubnetRouteTable())
&& Objects.equals(firewallSubnetId(), other.firewallSubnetId())
&& hasFirewallSubnetRoutes() == other.hasFirewallSubnetRoutes()
&& Objects.equals(firewallSubnetRoutes(), other.firewallSubnetRoutes())
&& Objects.equals(internetGatewayId(), other.internetGatewayId())
&& Objects.equals(currentInternetGatewayRouteTable(), other.currentInternetGatewayRouteTable())
&& hasInternetGatewayRoutes() == other.hasInternetGatewayRoutes()
&& Objects.equals(internetGatewayRoutes(), other.internetGatewayRoutes());
}
/**
* 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("RouteHasOutOfScopeEndpointViolation").add("SubnetId", subnetId()).add("VpcId", vpcId())
.add("RouteTableId", routeTableId()).add("ViolatingRoutes", hasViolatingRoutes() ? violatingRoutes() : null)
.add("SubnetAvailabilityZone", subnetAvailabilityZone())
.add("SubnetAvailabilityZoneId", subnetAvailabilityZoneId())
.add("CurrentFirewallSubnetRouteTable", currentFirewallSubnetRouteTable())
.add("FirewallSubnetId", firewallSubnetId())
.add("FirewallSubnetRoutes", hasFirewallSubnetRoutes() ? firewallSubnetRoutes() : null)
.add("InternetGatewayId", internetGatewayId())
.add("CurrentInternetGatewayRouteTable", currentInternetGatewayRouteTable())
.add("InternetGatewayRoutes", hasInternetGatewayRoutes() ? internetGatewayRoutes() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SubnetId":
return Optional.ofNullable(clazz.cast(subnetId()));
case "VpcId":
return Optional.ofNullable(clazz.cast(vpcId()));
case "RouteTableId":
return Optional.ofNullable(clazz.cast(routeTableId()));
case "ViolatingRoutes":
return Optional.ofNullable(clazz.cast(violatingRoutes()));
case "SubnetAvailabilityZone":
return Optional.ofNullable(clazz.cast(subnetAvailabilityZone()));
case "SubnetAvailabilityZoneId":
return Optional.ofNullable(clazz.cast(subnetAvailabilityZoneId()));
case "CurrentFirewallSubnetRouteTable":
return Optional.ofNullable(clazz.cast(currentFirewallSubnetRouteTable()));
case "FirewallSubnetId":
return Optional.ofNullable(clazz.cast(firewallSubnetId()));
case "FirewallSubnetRoutes":
return Optional.ofNullable(clazz.cast(firewallSubnetRoutes()));
case "InternetGatewayId":
return Optional.ofNullable(clazz.cast(internetGatewayId()));
case "CurrentInternetGatewayRouteTable":
return Optional.ofNullable(clazz.cast(currentInternetGatewayRouteTable()));
case "InternetGatewayRoutes":
return Optional.ofNullable(clazz.cast(internetGatewayRoutes()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function