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

software.amazon.awssdk.services.sms.model.ValidationOutput Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Server Migration module holds the client classes that are used for communicating with AWS Server Migration Service

There is a newer version: 2.29.16
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.sms.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;

/**
 * 

* Contains validation output. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ValidationOutput implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField VALIDATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ValidationOutput::validationId)).setter(setter(Builder::validationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("validationId").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ValidationOutput::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ValidationOutput::statusAsString)).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) .getter(getter(ValidationOutput::statusMessage)).setter(setter(Builder::statusMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusMessage").build()).build(); private static final SdkField LATEST_VALIDATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(ValidationOutput::latestValidationTime)).setter(setter(Builder::latestValidationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("latestValidationTime").build()) .build(); private static final SdkField APP_VALIDATION_OUTPUT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).getter(getter(ValidationOutput::appValidationOutput)) .setter(setter(Builder::appValidationOutput)).constructor(AppValidationOutput::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("appValidationOutput").build()) .build(); private static final SdkField SERVER_VALIDATION_OUTPUT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).getter(getter(ValidationOutput::serverValidationOutput)) .setter(setter(Builder::serverValidationOutput)).constructor(ServerValidationOutput::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serverValidationOutput").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VALIDATION_ID_FIELD, NAME_FIELD, STATUS_FIELD, STATUS_MESSAGE_FIELD, LATEST_VALIDATION_TIME_FIELD, APP_VALIDATION_OUTPUT_FIELD, SERVER_VALIDATION_OUTPUT_FIELD)); private static final long serialVersionUID = 1L; private final String validationId; private final String name; private final String status; private final String statusMessage; private final Instant latestValidationTime; private final AppValidationOutput appValidationOutput; private final ServerValidationOutput serverValidationOutput; private ValidationOutput(BuilderImpl builder) { this.validationId = builder.validationId; this.name = builder.name; this.status = builder.status; this.statusMessage = builder.statusMessage; this.latestValidationTime = builder.latestValidationTime; this.appValidationOutput = builder.appValidationOutput; this.serverValidationOutput = builder.serverValidationOutput; } /** *

* The ID of the validation. *

* * @return The ID of the validation. */ public String validationId() { return validationId; } /** *

* The name of the validation. *

* * @return The name of the validation. */ public String name() { return name; } /** *

* The status of the validation. *

*

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

* * @return The status of the validation. * @see ValidationStatus */ public ValidationStatus status() { return ValidationStatus.fromValue(status); } /** *

* The status of the validation. *

*

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

* * @return The status of the validation. * @see ValidationStatus */ public String statusAsString() { return status; } /** *

* The status message. *

* * @return The status message. */ public String statusMessage() { return statusMessage; } /** *

* The latest time that the validation was performed. *

* * @return The latest time that the validation was performed. */ public Instant latestValidationTime() { return latestValidationTime; } /** *

* The output from validating an application. *

* * @return The output from validating an application. */ public AppValidationOutput appValidationOutput() { return appValidationOutput; } /** *

* The output from validation an instance. *

* * @return The output from validation an instance. */ public ServerValidationOutput serverValidationOutput() { return serverValidationOutput; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(validationId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusMessage()); hashCode = 31 * hashCode + Objects.hashCode(latestValidationTime()); hashCode = 31 * hashCode + Objects.hashCode(appValidationOutput()); hashCode = 31 * hashCode + Objects.hashCode(serverValidationOutput()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ValidationOutput)) { return false; } ValidationOutput other = (ValidationOutput) obj; return Objects.equals(validationId(), other.validationId()) && Objects.equals(name(), other.name()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusMessage(), other.statusMessage()) && Objects.equals(latestValidationTime(), other.latestValidationTime()) && Objects.equals(appValidationOutput(), other.appValidationOutput()) && Objects.equals(serverValidationOutput(), other.serverValidationOutput()); } /** * 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 String toString() { return ToString.builder("ValidationOutput").add("ValidationId", validationId()).add("Name", name()) .add("Status", statusAsString()).add("StatusMessage", statusMessage()) .add("LatestValidationTime", latestValidationTime()).add("AppValidationOutput", appValidationOutput()) .add("ServerValidationOutput", serverValidationOutput()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "validationId": return Optional.ofNullable(clazz.cast(validationId())); case "name": return Optional.ofNullable(clazz.cast(name())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "statusMessage": return Optional.ofNullable(clazz.cast(statusMessage())); case "latestValidationTime": return Optional.ofNullable(clazz.cast(latestValidationTime())); case "appValidationOutput": return Optional.ofNullable(clazz.cast(appValidationOutput())); case "serverValidationOutput": return Optional.ofNullable(clazz.cast(serverValidationOutput())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ValidationOutput) 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 validation. *

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

* The name of the validation. *

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

* The status of the validation. *

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

* The status of the validation. *

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

* The status message. *

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

* The latest time that the validation was performed. *

* * @param latestValidationTime * The latest time that the validation was performed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder latestValidationTime(Instant latestValidationTime); /** *

* The output from validating an application. *

* * @param appValidationOutput * The output from validating an application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder appValidationOutput(AppValidationOutput appValidationOutput); /** *

* The output from validating an application. *

* This is a convenience that creates an instance of the {@link AppValidationOutput.Builder} avoiding the need * to create one manually via {@link AppValidationOutput#builder()}. * * When the {@link Consumer} completes, {@link AppValidationOutput.Builder#build()} is called immediately and * its result is passed to {@link #appValidationOutput(AppValidationOutput)}. * * @param appValidationOutput * a consumer that will call methods on {@link AppValidationOutput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #appValidationOutput(AppValidationOutput) */ default Builder appValidationOutput(Consumer appValidationOutput) { return appValidationOutput(AppValidationOutput.builder().applyMutation(appValidationOutput).build()); } /** *

* The output from validation an instance. *

* * @param serverValidationOutput * The output from validation an instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverValidationOutput(ServerValidationOutput serverValidationOutput); /** *

* The output from validation an instance. *

* This is a convenience that creates an instance of the {@link ServerValidationOutput.Builder} avoiding the * need to create one manually via {@link ServerValidationOutput#builder()}. * * When the {@link Consumer} completes, {@link ServerValidationOutput.Builder#build()} is called immediately and * its result is passed to {@link #serverValidationOutput(ServerValidationOutput)}. * * @param serverValidationOutput * a consumer that will call methods on {@link ServerValidationOutput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #serverValidationOutput(ServerValidationOutput) */ default Builder serverValidationOutput(Consumer serverValidationOutput) { return serverValidationOutput(ServerValidationOutput.builder().applyMutation(serverValidationOutput).build()); } } static final class BuilderImpl implements Builder { private String validationId; private String name; private String status; private String statusMessage; private Instant latestValidationTime; private AppValidationOutput appValidationOutput; private ServerValidationOutput serverValidationOutput; private BuilderImpl() { } private BuilderImpl(ValidationOutput model) { validationId(model.validationId); name(model.name); status(model.status); statusMessage(model.statusMessage); latestValidationTime(model.latestValidationTime); appValidationOutput(model.appValidationOutput); serverValidationOutput(model.serverValidationOutput); } public final String getValidationId() { return validationId; } @Override public final Builder validationId(String validationId) { this.validationId = validationId; return this; } public final void setValidationId(String validationId) { this.validationId = validationId; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(ValidationStatus status) { this.status(status == null ? null : status.toString()); return this; } public final void setStatus(String status) { this.status = status; } public final String getStatusMessage() { return statusMessage; } @Override public final Builder statusMessage(String statusMessage) { this.statusMessage = statusMessage; return this; } public final void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } public final Instant getLatestValidationTime() { return latestValidationTime; } @Override public final Builder latestValidationTime(Instant latestValidationTime) { this.latestValidationTime = latestValidationTime; return this; } public final void setLatestValidationTime(Instant latestValidationTime) { this.latestValidationTime = latestValidationTime; } public final AppValidationOutput.Builder getAppValidationOutput() { return appValidationOutput != null ? appValidationOutput.toBuilder() : null; } @Override public final Builder appValidationOutput(AppValidationOutput appValidationOutput) { this.appValidationOutput = appValidationOutput; return this; } public final void setAppValidationOutput(AppValidationOutput.BuilderImpl appValidationOutput) { this.appValidationOutput = appValidationOutput != null ? appValidationOutput.build() : null; } public final ServerValidationOutput.Builder getServerValidationOutput() { return serverValidationOutput != null ? serverValidationOutput.toBuilder() : null; } @Override public final Builder serverValidationOutput(ServerValidationOutput serverValidationOutput) { this.serverValidationOutput = serverValidationOutput; return this; } public final void setServerValidationOutput(ServerValidationOutput.BuilderImpl serverValidationOutput) { this.serverValidationOutput = serverValidationOutput != null ? serverValidationOutput.build() : null; } @Override public ValidationOutput build() { return new ValidationOutput(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy