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

software.amazon.awssdk.services.migrationhubrefactorspaces.model.UpdateRouteResponse 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.migrationhubrefactorspaces.model;

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.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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateRouteResponse extends MigrationHubRefactorSpacesResponse implements
        ToCopyableBuilder {
    private static final SdkField APPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ApplicationId").getter(getter(UpdateRouteResponse::applicationId))
            .setter(setter(Builder::applicationId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationId").build()).build();

    private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
            .getter(getter(UpdateRouteResponse::arn)).setter(setter(Builder::arn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();

    private static final SdkField LAST_UPDATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("LastUpdatedTime").getter(getter(UpdateRouteResponse::lastUpdatedTime))
            .setter(setter(Builder::lastUpdatedTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedTime").build()).build();

    private static final SdkField ROUTE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("RouteId").getter(getter(UpdateRouteResponse::routeId)).setter(setter(Builder::routeId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RouteId").build()).build();

    private static final SdkField SERVICE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ServiceId").getter(getter(UpdateRouteResponse::serviceId)).setter(setter(Builder::serviceId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceId").build()).build();

    private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State")
            .getter(getter(UpdateRouteResponse::stateAsString)).setter(setter(Builder::state))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_ID_FIELD,
            ARN_FIELD, LAST_UPDATED_TIME_FIELD, ROUTE_ID_FIELD, SERVICE_ID_FIELD, STATE_FIELD));

    private final String applicationId;

    private final String arn;

    private final Instant lastUpdatedTime;

    private final String routeId;

    private final String serviceId;

    private final String state;

    private UpdateRouteResponse(BuilderImpl builder) {
        super(builder);
        this.applicationId = builder.applicationId;
        this.arn = builder.arn;
        this.lastUpdatedTime = builder.lastUpdatedTime;
        this.routeId = builder.routeId;
        this.serviceId = builder.serviceId;
        this.state = builder.state;
    }

    /**
     * 

* The ID of the application in which the route is being updated. *

* * @return The ID of the application in which the route is being updated. */ public final String applicationId() { return applicationId; } /** *

* The Amazon Resource Name (ARN) of the route. The format for this ARN is * arn:aws:refactor-spaces:region:account-id:resource-type/resource-id . For more * information about ARNs, see * Amazon Resource Names (ARNs) in the Amazon Web Services General Reference. *

* * @return The Amazon Resource Name (ARN) of the route. The format for this ARN is * arn:aws:refactor-spaces:region:account-id:resource-type/resource-id . * For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. */ public final String arn() { return arn; } /** *

* A timestamp that indicates when the route was last updated. *

* * @return A timestamp that indicates when the route was last updated. */ public final Instant lastUpdatedTime() { return lastUpdatedTime; } /** *

* The unique identifier of the route. *

* * @return The unique identifier of the route. */ public final String routeId() { return routeId; } /** *

* The ID of service in which the route was created. Traffic that matches this route is forwarded to this service. *

* * @return The ID of service in which the route was created. Traffic that matches this route is forwarded to this * service. */ public final String serviceId() { return serviceId; } /** *

* The current state of the route. *

*

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

* * @return The current state of the route. * @see RouteState */ public final RouteState state() { return RouteState.fromValue(state); } /** *

* The current state of the route. *

*

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

* * @return The current state of the route. * @see RouteState */ public final String stateAsString() { return state; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(applicationId()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedTime()); hashCode = 31 * hashCode + Objects.hashCode(routeId()); hashCode = 31 * hashCode + Objects.hashCode(serviceId()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateRouteResponse)) { return false; } UpdateRouteResponse other = (UpdateRouteResponse) obj; return Objects.equals(applicationId(), other.applicationId()) && Objects.equals(arn(), other.arn()) && Objects.equals(lastUpdatedTime(), other.lastUpdatedTime()) && Objects.equals(routeId(), other.routeId()) && Objects.equals(serviceId(), other.serviceId()) && Objects.equals(stateAsString(), other.stateAsString()); } /** * 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("UpdateRouteResponse").add("ApplicationId", applicationId()).add("Arn", arn()) .add("LastUpdatedTime", lastUpdatedTime()).add("RouteId", routeId()).add("ServiceId", serviceId()) .add("State", stateAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ApplicationId": return Optional.ofNullable(clazz.cast(applicationId())); case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "LastUpdatedTime": return Optional.ofNullable(clazz.cast(lastUpdatedTime())); case "RouteId": return Optional.ofNullable(clazz.cast(routeId())); case "ServiceId": return Optional.ofNullable(clazz.cast(serviceId())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateRouteResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends MigrationHubRefactorSpacesResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the application in which the route is being updated. *

* * @param applicationId * The ID of the application in which the route is being updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationId(String applicationId); /** *

* The Amazon Resource Name (ARN) of the route. The format for this ARN is * arn:aws:refactor-spaces:region:account-id:resource-type/resource-id . For * more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

* * @param arn * The Amazon Resource Name (ARN) of the route. The format for this ARN is * arn:aws:refactor-spaces:region:account-id:resource-type/resource-id * . For more information about ARNs, see Amazon Resource * Names (ARNs) in the Amazon Web Services General Reference. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* A timestamp that indicates when the route was last updated. *

* * @param lastUpdatedTime * A timestamp that indicates when the route was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedTime(Instant lastUpdatedTime); /** *

* The unique identifier of the route. *

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

* The ID of service in which the route was created. Traffic that matches this route is forwarded to this * service. *

* * @param serviceId * The ID of service in which the route was created. Traffic that matches this route is forwarded to this * service. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceId(String serviceId); /** *

* The current state of the route. *

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

* The current state of the route. *

* * @param state * The current state of the route. * @see RouteState * @return Returns a reference to this object so that method calls can be chained together. * @see RouteState */ Builder state(RouteState state); } static final class BuilderImpl extends MigrationHubRefactorSpacesResponse.BuilderImpl implements Builder { private String applicationId; private String arn; private Instant lastUpdatedTime; private String routeId; private String serviceId; private String state; private BuilderImpl() { } private BuilderImpl(UpdateRouteResponse model) { super(model); applicationId(model.applicationId); arn(model.arn); lastUpdatedTime(model.lastUpdatedTime); routeId(model.routeId); serviceId(model.serviceId); state(model.state); } public final String getApplicationId() { return applicationId; } public final void setApplicationId(String applicationId) { this.applicationId = applicationId; } @Override public final Builder applicationId(String applicationId) { this.applicationId = applicationId; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final Instant getLastUpdatedTime() { return lastUpdatedTime; } public final void setLastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; } @Override public final Builder lastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; return this; } public final String getRouteId() { return routeId; } public final void setRouteId(String routeId) { this.routeId = routeId; } @Override public final Builder routeId(String routeId) { this.routeId = routeId; return this; } public final String getServiceId() { return serviceId; } public final void setServiceId(String serviceId) { this.serviceId = serviceId; } @Override public final Builder serviceId(String serviceId) { this.serviceId = serviceId; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(RouteState state) { this.state(state == null ? null : state.toString()); return this; } @Override public UpdateRouteResponse build() { return new UpdateRouteResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy