software.amazon.awssdk.services.securityhub.model.AwsEc2VpcEndpointServiceDetails 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.securityhub.model;
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 service configuration for a VPC endpoint service.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AwsEc2VpcEndpointServiceDetails implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACCEPTANCE_REQUIRED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AcceptanceRequired").getter(getter(AwsEc2VpcEndpointServiceDetails::acceptanceRequired))
.setter(setter(Builder::acceptanceRequired))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AcceptanceRequired").build())
.build();
private static final SdkField> AVAILABILITY_ZONES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AvailabilityZones")
.getter(getter(AwsEc2VpcEndpointServiceDetails::availabilityZones))
.setter(setter(Builder::availabilityZones))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZones").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> BASE_ENDPOINT_DNS_NAMES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("BaseEndpointDnsNames")
.getter(getter(AwsEc2VpcEndpointServiceDetails::baseEndpointDnsNames))
.setter(setter(Builder::baseEndpointDnsNames))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaseEndpointDnsNames").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField MANAGES_VPC_ENDPOINTS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ManagesVpcEndpoints").getter(getter(AwsEc2VpcEndpointServiceDetails::managesVpcEndpoints))
.setter(setter(Builder::managesVpcEndpoints))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ManagesVpcEndpoints").build())
.build();
private static final SdkField> GATEWAY_LOAD_BALANCER_ARNS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("GatewayLoadBalancerArns")
.getter(getter(AwsEc2VpcEndpointServiceDetails::gatewayLoadBalancerArns))
.setter(setter(Builder::gatewayLoadBalancerArns))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GatewayLoadBalancerArns").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> NETWORK_LOAD_BALANCER_ARNS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("NetworkLoadBalancerArns")
.getter(getter(AwsEc2VpcEndpointServiceDetails::networkLoadBalancerArns))
.setter(setter(Builder::networkLoadBalancerArns))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkLoadBalancerArns").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField PRIVATE_DNS_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PrivateDnsName").getter(getter(AwsEc2VpcEndpointServiceDetails::privateDnsName))
.setter(setter(Builder::privateDnsName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrivateDnsName").build()).build();
private static final SdkField SERVICE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceId").getter(getter(AwsEc2VpcEndpointServiceDetails::serviceId))
.setter(setter(Builder::serviceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceId").build()).build();
private static final SdkField SERVICE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceName").getter(getter(AwsEc2VpcEndpointServiceDetails::serviceName))
.setter(setter(Builder::serviceName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceName").build()).build();
private static final SdkField SERVICE_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceState").getter(getter(AwsEc2VpcEndpointServiceDetails::serviceState))
.setter(setter(Builder::serviceState))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceState").build()).build();
private static final SdkField> SERVICE_TYPE_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ServiceType")
.getter(getter(AwsEc2VpcEndpointServiceDetails::serviceType))
.setter(setter(Builder::serviceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceType").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AwsEc2VpcEndpointServiceServiceTypeDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCEPTANCE_REQUIRED_FIELD,
AVAILABILITY_ZONES_FIELD, BASE_ENDPOINT_DNS_NAMES_FIELD, MANAGES_VPC_ENDPOINTS_FIELD,
GATEWAY_LOAD_BALANCER_ARNS_FIELD, NETWORK_LOAD_BALANCER_ARNS_FIELD, PRIVATE_DNS_NAME_FIELD, SERVICE_ID_FIELD,
SERVICE_NAME_FIELD, SERVICE_STATE_FIELD, SERVICE_TYPE_FIELD));
private static final long serialVersionUID = 1L;
private final Boolean acceptanceRequired;
private final List availabilityZones;
private final List baseEndpointDnsNames;
private final Boolean managesVpcEndpoints;
private final List gatewayLoadBalancerArns;
private final List networkLoadBalancerArns;
private final String privateDnsName;
private final String serviceId;
private final String serviceName;
private final String serviceState;
private final List serviceType;
private AwsEc2VpcEndpointServiceDetails(BuilderImpl builder) {
this.acceptanceRequired = builder.acceptanceRequired;
this.availabilityZones = builder.availabilityZones;
this.baseEndpointDnsNames = builder.baseEndpointDnsNames;
this.managesVpcEndpoints = builder.managesVpcEndpoints;
this.gatewayLoadBalancerArns = builder.gatewayLoadBalancerArns;
this.networkLoadBalancerArns = builder.networkLoadBalancerArns;
this.privateDnsName = builder.privateDnsName;
this.serviceId = builder.serviceId;
this.serviceName = builder.serviceName;
this.serviceState = builder.serviceState;
this.serviceType = builder.serviceType;
}
/**
*
* Whether requests from other Amazon Web Services accounts to create an endpoint to the service must first be
* accepted.
*
*
* @return Whether requests from other Amazon Web Services accounts to create an endpoint to the service must first
* be accepted.
*/
public final Boolean acceptanceRequired() {
return acceptanceRequired;
}
/**
* For responses, this returns true if the service returned a value for the AvailabilityZones 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 hasAvailabilityZones() {
return availabilityZones != null && !(availabilityZones instanceof SdkAutoConstructList);
}
/**
*
* The Availability Zones where the service is available.
*
*
* 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 #hasAvailabilityZones} method.
*
*
* @return The Availability Zones where the service is available.
*/
public final List availabilityZones() {
return availabilityZones;
}
/**
* For responses, this returns true if the service returned a value for the BaseEndpointDnsNames 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 hasBaseEndpointDnsNames() {
return baseEndpointDnsNames != null && !(baseEndpointDnsNames instanceof SdkAutoConstructList);
}
/**
*
* The DNS names for the service.
*
*
* 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 #hasBaseEndpointDnsNames} method.
*
*
* @return The DNS names for the service.
*/
public final List baseEndpointDnsNames() {
return baseEndpointDnsNames;
}
/**
*
* Whether the service manages its VPC endpoints.
*
*
* @return Whether the service manages its VPC endpoints.
*/
public final Boolean managesVpcEndpoints() {
return managesVpcEndpoints;
}
/**
* For responses, this returns true if the service returned a value for the GatewayLoadBalancerArns 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 hasGatewayLoadBalancerArns() {
return gatewayLoadBalancerArns != null && !(gatewayLoadBalancerArns instanceof SdkAutoConstructList);
}
/**
*
* The ARNs of the Gateway Load Balancers for the service.
*
*
* 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 #hasGatewayLoadBalancerArns} method.
*
*
* @return The ARNs of the Gateway Load Balancers for the service.
*/
public final List gatewayLoadBalancerArns() {
return gatewayLoadBalancerArns;
}
/**
* For responses, this returns true if the service returned a value for the NetworkLoadBalancerArns 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 hasNetworkLoadBalancerArns() {
return networkLoadBalancerArns != null && !(networkLoadBalancerArns instanceof SdkAutoConstructList);
}
/**
*
* The ARNs of the Network Load Balancers for the service.
*
*
* 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 #hasNetworkLoadBalancerArns} method.
*
*
* @return The ARNs of the Network Load Balancers for the service.
*/
public final List networkLoadBalancerArns() {
return networkLoadBalancerArns;
}
/**
*
* The private DNS name for the service.
*
*
* @return The private DNS name for the service.
*/
public final String privateDnsName() {
return privateDnsName;
}
/**
*
* The identifier of the service.
*
*
* @return The identifier of the service.
*/
public final String serviceId() {
return serviceId;
}
/**
*
* The name of the service.
*
*
* @return The name of the service.
*/
public final String serviceName() {
return serviceName;
}
/**
*
* The current state of the service. Valid values are as follows:
*
*
* -
*
* Available
*
*
* -
*
* Deleted
*
*
* -
*
* Deleting
*
*
* -
*
* Failed
*
*
* -
*
* Pending
*
*
*
*
* @return The current state of the service. Valid values are as follows:
*
* -
*
* Available
*
*
* -
*
* Deleted
*
*
* -
*
* Deleting
*
*
* -
*
* Failed
*
*
* -
*
* Pending
*
*
*/
public final String serviceState() {
return serviceState;
}
/**
* For responses, this returns true if the service returned a value for the ServiceType 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 hasServiceType() {
return serviceType != null && !(serviceType instanceof SdkAutoConstructList);
}
/**
*
* The types for the service.
*
*
* 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 #hasServiceType} method.
*
*
* @return The types for the service.
*/
public final List serviceType() {
return serviceType;
}
@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(acceptanceRequired());
hashCode = 31 * hashCode + Objects.hashCode(hasAvailabilityZones() ? availabilityZones() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasBaseEndpointDnsNames() ? baseEndpointDnsNames() : null);
hashCode = 31 * hashCode + Objects.hashCode(managesVpcEndpoints());
hashCode = 31 * hashCode + Objects.hashCode(hasGatewayLoadBalancerArns() ? gatewayLoadBalancerArns() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasNetworkLoadBalancerArns() ? networkLoadBalancerArns() : null);
hashCode = 31 * hashCode + Objects.hashCode(privateDnsName());
hashCode = 31 * hashCode + Objects.hashCode(serviceId());
hashCode = 31 * hashCode + Objects.hashCode(serviceName());
hashCode = 31 * hashCode + Objects.hashCode(serviceState());
hashCode = 31 * hashCode + Objects.hashCode(hasServiceType() ? serviceType() : 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 AwsEc2VpcEndpointServiceDetails)) {
return false;
}
AwsEc2VpcEndpointServiceDetails other = (AwsEc2VpcEndpointServiceDetails) obj;
return Objects.equals(acceptanceRequired(), other.acceptanceRequired())
&& hasAvailabilityZones() == other.hasAvailabilityZones()
&& Objects.equals(availabilityZones(), other.availabilityZones())
&& hasBaseEndpointDnsNames() == other.hasBaseEndpointDnsNames()
&& Objects.equals(baseEndpointDnsNames(), other.baseEndpointDnsNames())
&& Objects.equals(managesVpcEndpoints(), other.managesVpcEndpoints())
&& hasGatewayLoadBalancerArns() == other.hasGatewayLoadBalancerArns()
&& Objects.equals(gatewayLoadBalancerArns(), other.gatewayLoadBalancerArns())
&& hasNetworkLoadBalancerArns() == other.hasNetworkLoadBalancerArns()
&& Objects.equals(networkLoadBalancerArns(), other.networkLoadBalancerArns())
&& Objects.equals(privateDnsName(), other.privateDnsName()) && Objects.equals(serviceId(), other.serviceId())
&& Objects.equals(serviceName(), other.serviceName()) && Objects.equals(serviceState(), other.serviceState())
&& hasServiceType() == other.hasServiceType() && Objects.equals(serviceType(), other.serviceType());
}
/**
* 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("AwsEc2VpcEndpointServiceDetails").add("AcceptanceRequired", acceptanceRequired())
.add("AvailabilityZones", hasAvailabilityZones() ? availabilityZones() : null)
.add("BaseEndpointDnsNames", hasBaseEndpointDnsNames() ? baseEndpointDnsNames() : null)
.add("ManagesVpcEndpoints", managesVpcEndpoints())
.add("GatewayLoadBalancerArns", hasGatewayLoadBalancerArns() ? gatewayLoadBalancerArns() : null)
.add("NetworkLoadBalancerArns", hasNetworkLoadBalancerArns() ? networkLoadBalancerArns() : null)
.add("PrivateDnsName", privateDnsName()).add("ServiceId", serviceId()).add("ServiceName", serviceName())
.add("ServiceState", serviceState()).add("ServiceType", hasServiceType() ? serviceType() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AcceptanceRequired":
return Optional.ofNullable(clazz.cast(acceptanceRequired()));
case "AvailabilityZones":
return Optional.ofNullable(clazz.cast(availabilityZones()));
case "BaseEndpointDnsNames":
return Optional.ofNullable(clazz.cast(baseEndpointDnsNames()));
case "ManagesVpcEndpoints":
return Optional.ofNullable(clazz.cast(managesVpcEndpoints()));
case "GatewayLoadBalancerArns":
return Optional.ofNullable(clazz.cast(gatewayLoadBalancerArns()));
case "NetworkLoadBalancerArns":
return Optional.ofNullable(clazz.cast(networkLoadBalancerArns()));
case "PrivateDnsName":
return Optional.ofNullable(clazz.cast(privateDnsName()));
case "ServiceId":
return Optional.ofNullable(clazz.cast(serviceId()));
case "ServiceName":
return Optional.ofNullable(clazz.cast(serviceName()));
case "ServiceState":
return Optional.ofNullable(clazz.cast(serviceState()));
case "ServiceType":
return Optional.ofNullable(clazz.cast(serviceType()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function