
software.amazon.awssdk.services.securityhub.model.AwsEc2VpnConnectionVgwTelemetryDetails 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.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;
/**
*
* Information about the VPN tunnel.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AwsEc2VpnConnectionVgwTelemetryDetails implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACCEPTED_ROUTE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("AcceptedRouteCount").getter(getter(AwsEc2VpnConnectionVgwTelemetryDetails::acceptedRouteCount))
.setter(setter(Builder::acceptedRouteCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AcceptedRouteCount").build())
.build();
private static final SdkField CERTIFICATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CertificateArn").getter(getter(AwsEc2VpnConnectionVgwTelemetryDetails::certificateArn))
.setter(setter(Builder::certificateArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CertificateArn").build()).build();
private static final SdkField LAST_STATUS_CHANGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastStatusChange").getter(getter(AwsEc2VpnConnectionVgwTelemetryDetails::lastStatusChange))
.setter(setter(Builder::lastStatusChange))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastStatusChange").build()).build();
private static final SdkField OUTSIDE_IP_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OutsideIpAddress").getter(getter(AwsEc2VpnConnectionVgwTelemetryDetails::outsideIpAddress))
.setter(setter(Builder::outsideIpAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutsideIpAddress").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(AwsEc2VpnConnectionVgwTelemetryDetails::status)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatusMessage").getter(getter(AwsEc2VpnConnectionVgwTelemetryDetails::statusMessage))
.setter(setter(Builder::statusMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusMessage").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCEPTED_ROUTE_COUNT_FIELD,
CERTIFICATE_ARN_FIELD, LAST_STATUS_CHANGE_FIELD, OUTSIDE_IP_ADDRESS_FIELD, STATUS_FIELD, STATUS_MESSAGE_FIELD));
private static final long serialVersionUID = 1L;
private final Integer acceptedRouteCount;
private final String certificateArn;
private final String lastStatusChange;
private final String outsideIpAddress;
private final String status;
private final String statusMessage;
private AwsEc2VpnConnectionVgwTelemetryDetails(BuilderImpl builder) {
this.acceptedRouteCount = builder.acceptedRouteCount;
this.certificateArn = builder.certificateArn;
this.lastStatusChange = builder.lastStatusChange;
this.outsideIpAddress = builder.outsideIpAddress;
this.status = builder.status;
this.statusMessage = builder.statusMessage;
}
/**
*
* The number of accepted routes.
*
*
* @return The number of accepted routes.
*/
public final Integer acceptedRouteCount() {
return acceptedRouteCount;
}
/**
*
* The ARN of the VPN tunnel endpoint certificate.
*
*
* @return The ARN of the VPN tunnel endpoint certificate.
*/
public final String certificateArn() {
return certificateArn;
}
/**
*
* The date and time of the last change in status.
*
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a maximum of 9
* digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example, 2024-01-04T15:25:10.123456789+17:59
)
*
*
*
*
* @return The date and time of the last change in status.
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a
* maximum of 9 digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example,
* 2024-01-04T15:25:10.123456789+17:59
)
*
*
*/
public final String lastStatusChange() {
return lastStatusChange;
}
/**
*
* The Internet-routable IP address of the virtual private gateway's outside interface.
*
*
* @return The Internet-routable IP address of the virtual private gateway's outside interface.
*/
public final String outsideIpAddress() {
return outsideIpAddress;
}
/**
*
* The status of the VPN tunnel. Valid values are DOWN
or UP
.
*
*
* @return The status of the VPN tunnel. Valid values are DOWN
or UP
.
*/
public final String status() {
return status;
}
/**
*
* If an error occurs, a description of the error.
*
*
* @return If an error occurs, a description of the error.
*/
public final String statusMessage() {
return statusMessage;
}
@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(acceptedRouteCount());
hashCode = 31 * hashCode + Objects.hashCode(certificateArn());
hashCode = 31 * hashCode + Objects.hashCode(lastStatusChange());
hashCode = 31 * hashCode + Objects.hashCode(outsideIpAddress());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(statusMessage());
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 AwsEc2VpnConnectionVgwTelemetryDetails)) {
return false;
}
AwsEc2VpnConnectionVgwTelemetryDetails other = (AwsEc2VpnConnectionVgwTelemetryDetails) obj;
return Objects.equals(acceptedRouteCount(), other.acceptedRouteCount())
&& Objects.equals(certificateArn(), other.certificateArn())
&& Objects.equals(lastStatusChange(), other.lastStatusChange())
&& Objects.equals(outsideIpAddress(), other.outsideIpAddress()) && Objects.equals(status(), other.status())
&& Objects.equals(statusMessage(), other.statusMessage());
}
/**
* 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("AwsEc2VpnConnectionVgwTelemetryDetails").add("AcceptedRouteCount", acceptedRouteCount())
.add("CertificateArn", certificateArn()).add("LastStatusChange", lastStatusChange())
.add("OutsideIpAddress", outsideIpAddress()).add("Status", status()).add("StatusMessage", statusMessage())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AcceptedRouteCount":
return Optional.ofNullable(clazz.cast(acceptedRouteCount()));
case "CertificateArn":
return Optional.ofNullable(clazz.cast(certificateArn()));
case "LastStatusChange":
return Optional.ofNullable(clazz.cast(lastStatusChange()));
case "OutsideIpAddress":
return Optional.ofNullable(clazz.cast(outsideIpAddress()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "StatusMessage":
return Optional.ofNullable(clazz.cast(statusMessage()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function