All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.networkmanager.model.RouteAnalysis Maven / Gradle / Ivy

Go to download

The AWS Java SDK for NetworkManager module holds the client classes that are used for communicating with NetworkManager.

There is a newer version: 2.29.39
Show newest version
/*
 * 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.networkmanager.model;

import java.io.Serializable;
import java.time.Instant;
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;

/**
 * 

* Describes a route analysis. *

*/ @Generated("software.amazon.awssdk:codegen") public final class RouteAnalysis implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField GLOBAL_NETWORK_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("GlobalNetworkId").getter(getter(RouteAnalysis::globalNetworkId)) .setter(setter(Builder::globalNetworkId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalNetworkId").build()).build(); private static final SdkField OWNER_ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("OwnerAccountId").getter(getter(RouteAnalysis::ownerAccountId)).setter(setter(Builder::ownerAccountId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OwnerAccountId").build()).build(); private static final SdkField ROUTE_ANALYSIS_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RouteAnalysisId").getter(getter(RouteAnalysis::routeAnalysisId)) .setter(setter(Builder::routeAnalysisId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RouteAnalysisId").build()).build(); private static final SdkField START_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTimestamp").getter(getter(RouteAnalysis::startTimestamp)).setter(setter(Builder::startTimestamp)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTimestamp").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(RouteAnalysis::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField SOURCE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Source") .getter(getter(RouteAnalysis::source)).setter(setter(Builder::source)) .constructor(RouteAnalysisEndpointOptions::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build(); private static final SdkField DESTINATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Destination") .getter(getter(RouteAnalysis::destination)).setter(setter(Builder::destination)) .constructor(RouteAnalysisEndpointOptions::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Destination").build()).build(); private static final SdkField INCLUDE_RETURN_PATH_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("IncludeReturnPath").getter(getter(RouteAnalysis::includeReturnPath)) .setter(setter(Builder::includeReturnPath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IncludeReturnPath").build()).build(); private static final SdkField USE_MIDDLEBOXES_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("UseMiddleboxes").getter(getter(RouteAnalysis::useMiddleboxes)).setter(setter(Builder::useMiddleboxes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UseMiddleboxes").build()).build(); private static final SdkField FORWARD_PATH_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ForwardPath") .getter(getter(RouteAnalysis::forwardPath)).setter(setter(Builder::forwardPath)) .constructor(RouteAnalysisPath::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ForwardPath").build()).build(); private static final SdkField RETURN_PATH_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ReturnPath") .getter(getter(RouteAnalysis::returnPath)).setter(setter(Builder::returnPath)) .constructor(RouteAnalysisPath::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReturnPath").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(GLOBAL_NETWORK_ID_FIELD, OWNER_ACCOUNT_ID_FIELD, ROUTE_ANALYSIS_ID_FIELD, START_TIMESTAMP_FIELD, STATUS_FIELD, SOURCE_FIELD, DESTINATION_FIELD, INCLUDE_RETURN_PATH_FIELD, USE_MIDDLEBOXES_FIELD, FORWARD_PATH_FIELD, RETURN_PATH_FIELD)); private static final long serialVersionUID = 1L; private final String globalNetworkId; private final String ownerAccountId; private final String routeAnalysisId; private final Instant startTimestamp; private final String status; private final RouteAnalysisEndpointOptions source; private final RouteAnalysisEndpointOptions destination; private final Boolean includeReturnPath; private final Boolean useMiddleboxes; private final RouteAnalysisPath forwardPath; private final RouteAnalysisPath returnPath; private RouteAnalysis(BuilderImpl builder) { this.globalNetworkId = builder.globalNetworkId; this.ownerAccountId = builder.ownerAccountId; this.routeAnalysisId = builder.routeAnalysisId; this.startTimestamp = builder.startTimestamp; this.status = builder.status; this.source = builder.source; this.destination = builder.destination; this.includeReturnPath = builder.includeReturnPath; this.useMiddleboxes = builder.useMiddleboxes; this.forwardPath = builder.forwardPath; this.returnPath = builder.returnPath; } /** *

* The ID of the global network. *

* * @return The ID of the global network. */ public final String globalNetworkId() { return globalNetworkId; } /** *

* The ID of the AWS account that created the route analysis. *

* * @return The ID of the AWS account that created the route analysis. */ public final String ownerAccountId() { return ownerAccountId; } /** *

* The ID of the route analysis. *

* * @return The ID of the route analysis. */ public final String routeAnalysisId() { return routeAnalysisId; } /** *

* The time that the analysis started. *

* * @return The time that the analysis started. */ public final Instant startTimestamp() { return startTimestamp; } /** *

* The status of the route analysis. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link RouteAnalysisStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the route analysis. * @see RouteAnalysisStatus */ public final RouteAnalysisStatus status() { return RouteAnalysisStatus.fromValue(status); } /** *

* The status of the route analysis. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link RouteAnalysisStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

* * @return The status of the route analysis. * @see RouteAnalysisStatus */ public final String statusAsString() { return status; } /** *

* The source. *

* * @return The source. */ public final RouteAnalysisEndpointOptions source() { return source; } /** *

* The destination. *

* * @return The destination. */ public final RouteAnalysisEndpointOptions destination() { return destination; } /** *

* Indicates whether to analyze the return path. The return path is not analyzed if the forward path analysis does * not succeed. *

* * @return Indicates whether to analyze the return path. The return path is not analyzed if the forward path * analysis does not succeed. */ public final Boolean includeReturnPath() { return includeReturnPath; } /** *

* Indicates whether to include the location of middlebox appliances in the route analysis. *

* * @return Indicates whether to include the location of middlebox appliances in the route analysis. */ public final Boolean useMiddleboxes() { return useMiddleboxes; } /** *

* The forward path. *

* * @return The forward path. */ public final RouteAnalysisPath forwardPath() { return forwardPath; } /** *

* The return path. *

* * @return The return path. */ public final RouteAnalysisPath returnPath() { return returnPath; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(globalNetworkId()); hashCode = 31 * hashCode + Objects.hashCode(ownerAccountId()); hashCode = 31 * hashCode + Objects.hashCode(routeAnalysisId()); hashCode = 31 * hashCode + Objects.hashCode(startTimestamp()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(source()); hashCode = 31 * hashCode + Objects.hashCode(destination()); hashCode = 31 * hashCode + Objects.hashCode(includeReturnPath()); hashCode = 31 * hashCode + Objects.hashCode(useMiddleboxes()); hashCode = 31 * hashCode + Objects.hashCode(forwardPath()); hashCode = 31 * hashCode + Objects.hashCode(returnPath()); 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 RouteAnalysis)) { return false; } RouteAnalysis other = (RouteAnalysis) obj; return Objects.equals(globalNetworkId(), other.globalNetworkId()) && Objects.equals(ownerAccountId(), other.ownerAccountId()) && Objects.equals(routeAnalysisId(), other.routeAnalysisId()) && Objects.equals(startTimestamp(), other.startTimestamp()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(source(), other.source()) && Objects.equals(destination(), other.destination()) && Objects.equals(includeReturnPath(), other.includeReturnPath()) && Objects.equals(useMiddleboxes(), other.useMiddleboxes()) && Objects.equals(forwardPath(), other.forwardPath()) && Objects.equals(returnPath(), other.returnPath()); } /** * 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("RouteAnalysis").add("GlobalNetworkId", globalNetworkId()) .add("OwnerAccountId", ownerAccountId()).add("RouteAnalysisId", routeAnalysisId()) .add("StartTimestamp", startTimestamp()).add("Status", statusAsString()).add("Source", source()) .add("Destination", destination()).add("IncludeReturnPath", includeReturnPath()) .add("UseMiddleboxes", useMiddleboxes()).add("ForwardPath", forwardPath()).add("ReturnPath", returnPath()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "GlobalNetworkId": return Optional.ofNullable(clazz.cast(globalNetworkId())); case "OwnerAccountId": return Optional.ofNullable(clazz.cast(ownerAccountId())); case "RouteAnalysisId": return Optional.ofNullable(clazz.cast(routeAnalysisId())); case "StartTimestamp": return Optional.ofNullable(clazz.cast(startTimestamp())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "Source": return Optional.ofNullable(clazz.cast(source())); case "Destination": return Optional.ofNullable(clazz.cast(destination())); case "IncludeReturnPath": return Optional.ofNullable(clazz.cast(includeReturnPath())); case "UseMiddleboxes": return Optional.ofNullable(clazz.cast(useMiddleboxes())); case "ForwardPath": return Optional.ofNullable(clazz.cast(forwardPath())); case "ReturnPath": return Optional.ofNullable(clazz.cast(returnPath())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RouteAnalysis) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the global network. *

* * @param globalNetworkId * The ID of the global network. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalNetworkId(String globalNetworkId); /** *

* The ID of the AWS account that created the route analysis. *

* * @param ownerAccountId * The ID of the AWS account that created the route analysis. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerAccountId(String ownerAccountId); /** *

* The ID of the route analysis. *

* * @param routeAnalysisId * The ID of the route analysis. * @return Returns a reference to this object so that method calls can be chained together. */ Builder routeAnalysisId(String routeAnalysisId); /** *

* The time that the analysis started. *

* * @param startTimestamp * The time that the analysis started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTimestamp(Instant startTimestamp); /** *

* The status of the route analysis. *

* * @param status * The status of the route analysis. * @see RouteAnalysisStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RouteAnalysisStatus */ Builder status(String status); /** *

* The status of the route analysis. *

* * @param status * The status of the route analysis. * @see RouteAnalysisStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RouteAnalysisStatus */ Builder status(RouteAnalysisStatus status); /** *

* The source. *

* * @param source * The source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder source(RouteAnalysisEndpointOptions source); /** *

* The source. *

* This is a convenience method that creates an instance of the {@link RouteAnalysisEndpointOptions.Builder} * avoiding the need to create one manually via {@link RouteAnalysisEndpointOptions#builder()}. * *

* When the {@link Consumer} completes, {@link RouteAnalysisEndpointOptions.Builder#build()} is called * immediately and its result is passed to {@link #source(RouteAnalysisEndpointOptions)}. * * @param source * a consumer that will call methods on {@link RouteAnalysisEndpointOptions.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #source(RouteAnalysisEndpointOptions) */ default Builder source(Consumer source) { return source(RouteAnalysisEndpointOptions.builder().applyMutation(source).build()); } /** *

* The destination. *

* * @param destination * The destination. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destination(RouteAnalysisEndpointOptions destination); /** *

* The destination. *

* This is a convenience method that creates an instance of the {@link RouteAnalysisEndpointOptions.Builder} * avoiding the need to create one manually via {@link RouteAnalysisEndpointOptions#builder()}. * *

* When the {@link Consumer} completes, {@link RouteAnalysisEndpointOptions.Builder#build()} is called * immediately and its result is passed to {@link #destination(RouteAnalysisEndpointOptions)}. * * @param destination * a consumer that will call methods on {@link RouteAnalysisEndpointOptions.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #destination(RouteAnalysisEndpointOptions) */ default Builder destination(Consumer destination) { return destination(RouteAnalysisEndpointOptions.builder().applyMutation(destination).build()); } /** *

* Indicates whether to analyze the return path. The return path is not analyzed if the forward path analysis * does not succeed. *

* * @param includeReturnPath * Indicates whether to analyze the return path. The return path is not analyzed if the forward path * analysis does not succeed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder includeReturnPath(Boolean includeReturnPath); /** *

* Indicates whether to include the location of middlebox appliances in the route analysis. *

* * @param useMiddleboxes * Indicates whether to include the location of middlebox appliances in the route analysis. * @return Returns a reference to this object so that method calls can be chained together. */ Builder useMiddleboxes(Boolean useMiddleboxes); /** *

* The forward path. *

* * @param forwardPath * The forward path. * @return Returns a reference to this object so that method calls can be chained together. */ Builder forwardPath(RouteAnalysisPath forwardPath); /** *

* The forward path. *

* This is a convenience method that creates an instance of the {@link RouteAnalysisPath.Builder} avoiding the * need to create one manually via {@link RouteAnalysisPath#builder()}. * *

* When the {@link Consumer} completes, {@link RouteAnalysisPath.Builder#build()} is called immediately and its * result is passed to {@link #forwardPath(RouteAnalysisPath)}. * * @param forwardPath * a consumer that will call methods on {@link RouteAnalysisPath.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #forwardPath(RouteAnalysisPath) */ default Builder forwardPath(Consumer forwardPath) { return forwardPath(RouteAnalysisPath.builder().applyMutation(forwardPath).build()); } /** *

* The return path. *

* * @param returnPath * The return path. * @return Returns a reference to this object so that method calls can be chained together. */ Builder returnPath(RouteAnalysisPath returnPath); /** *

* The return path. *

* This is a convenience method that creates an instance of the {@link RouteAnalysisPath.Builder} avoiding the * need to create one manually via {@link RouteAnalysisPath#builder()}. * *

* When the {@link Consumer} completes, {@link RouteAnalysisPath.Builder#build()} is called immediately and its * result is passed to {@link #returnPath(RouteAnalysisPath)}. * * @param returnPath * a consumer that will call methods on {@link RouteAnalysisPath.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #returnPath(RouteAnalysisPath) */ default Builder returnPath(Consumer returnPath) { return returnPath(RouteAnalysisPath.builder().applyMutation(returnPath).build()); } } static final class BuilderImpl implements Builder { private String globalNetworkId; private String ownerAccountId; private String routeAnalysisId; private Instant startTimestamp; private String status; private RouteAnalysisEndpointOptions source; private RouteAnalysisEndpointOptions destination; private Boolean includeReturnPath; private Boolean useMiddleboxes; private RouteAnalysisPath forwardPath; private RouteAnalysisPath returnPath; private BuilderImpl() { } private BuilderImpl(RouteAnalysis model) { globalNetworkId(model.globalNetworkId); ownerAccountId(model.ownerAccountId); routeAnalysisId(model.routeAnalysisId); startTimestamp(model.startTimestamp); status(model.status); source(model.source); destination(model.destination); includeReturnPath(model.includeReturnPath); useMiddleboxes(model.useMiddleboxes); forwardPath(model.forwardPath); returnPath(model.returnPath); } public final String getGlobalNetworkId() { return globalNetworkId; } public final void setGlobalNetworkId(String globalNetworkId) { this.globalNetworkId = globalNetworkId; } @Override public final Builder globalNetworkId(String globalNetworkId) { this.globalNetworkId = globalNetworkId; return this; } public final String getOwnerAccountId() { return ownerAccountId; } public final void setOwnerAccountId(String ownerAccountId) { this.ownerAccountId = ownerAccountId; } @Override public final Builder ownerAccountId(String ownerAccountId) { this.ownerAccountId = ownerAccountId; return this; } public final String getRouteAnalysisId() { return routeAnalysisId; } public final void setRouteAnalysisId(String routeAnalysisId) { this.routeAnalysisId = routeAnalysisId; } @Override public final Builder routeAnalysisId(String routeAnalysisId) { this.routeAnalysisId = routeAnalysisId; return this; } public final Instant getStartTimestamp() { return startTimestamp; } public final void setStartTimestamp(Instant startTimestamp) { this.startTimestamp = startTimestamp; } @Override public final Builder startTimestamp(Instant startTimestamp) { this.startTimestamp = startTimestamp; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(RouteAnalysisStatus status) { this.status(status == null ? null : status.toString()); return this; } public final RouteAnalysisEndpointOptions.Builder getSource() { return source != null ? source.toBuilder() : null; } public final void setSource(RouteAnalysisEndpointOptions.BuilderImpl source) { this.source = source != null ? source.build() : null; } @Override public final Builder source(RouteAnalysisEndpointOptions source) { this.source = source; return this; } public final RouteAnalysisEndpointOptions.Builder getDestination() { return destination != null ? destination.toBuilder() : null; } public final void setDestination(RouteAnalysisEndpointOptions.BuilderImpl destination) { this.destination = destination != null ? destination.build() : null; } @Override public final Builder destination(RouteAnalysisEndpointOptions destination) { this.destination = destination; return this; } public final Boolean getIncludeReturnPath() { return includeReturnPath; } public final void setIncludeReturnPath(Boolean includeReturnPath) { this.includeReturnPath = includeReturnPath; } @Override public final Builder includeReturnPath(Boolean includeReturnPath) { this.includeReturnPath = includeReturnPath; return this; } public final Boolean getUseMiddleboxes() { return useMiddleboxes; } public final void setUseMiddleboxes(Boolean useMiddleboxes) { this.useMiddleboxes = useMiddleboxes; } @Override public final Builder useMiddleboxes(Boolean useMiddleboxes) { this.useMiddleboxes = useMiddleboxes; return this; } public final RouteAnalysisPath.Builder getForwardPath() { return forwardPath != null ? forwardPath.toBuilder() : null; } public final void setForwardPath(RouteAnalysisPath.BuilderImpl forwardPath) { this.forwardPath = forwardPath != null ? forwardPath.build() : null; } @Override public final Builder forwardPath(RouteAnalysisPath forwardPath) { this.forwardPath = forwardPath; return this; } public final RouteAnalysisPath.Builder getReturnPath() { return returnPath != null ? returnPath.toBuilder() : null; } public final void setReturnPath(RouteAnalysisPath.BuilderImpl returnPath) { this.returnPath = returnPath != null ? returnPath.build() : null; } @Override public final Builder returnPath(RouteAnalysisPath returnPath) { this.returnPath = returnPath; return this; } @Override public RouteAnalysis build() { return new RouteAnalysis(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy