
software.amazon.awssdk.services.databasemigration.model.ReplicationTaskAssessmentRun 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.databasemigration.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;
/**
*
* Provides information that describes a premigration assessment run that you have started using the
* StartReplicationTaskAssessmentRun
operation.
*
*
* Some of the information appears based on other operations that can return the
* ReplicationTaskAssessmentRun
object.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ReplicationTaskAssessmentRun implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField REPLICATION_TASK_ASSESSMENT_RUN_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ReplicationTaskAssessmentRunArn")
.getter(getter(ReplicationTaskAssessmentRun::replicationTaskAssessmentRunArn))
.setter(setter(Builder::replicationTaskAssessmentRunArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskAssessmentRunArn")
.build()).build();
private static final SdkField REPLICATION_TASK_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationTaskArn").getter(getter(ReplicationTaskAssessmentRun::replicationTaskArn))
.setter(setter(Builder::replicationTaskArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskArn").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(ReplicationTaskAssessmentRun::status)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField REPLICATION_TASK_ASSESSMENT_RUN_CREATION_DATE_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("ReplicationTaskAssessmentRunCreationDate")
.getter(getter(ReplicationTaskAssessmentRun::replicationTaskAssessmentRunCreationDate))
.setter(setter(Builder::replicationTaskAssessmentRunCreationDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("ReplicationTaskAssessmentRunCreationDate").build()).build();
private static final SdkField ASSESSMENT_PROGRESS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AssessmentProgress")
.getter(getter(ReplicationTaskAssessmentRun::assessmentProgress)).setter(setter(Builder::assessmentProgress))
.constructor(ReplicationTaskAssessmentRunProgress::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssessmentProgress").build())
.build();
private static final SdkField LAST_FAILURE_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastFailureMessage").getter(getter(ReplicationTaskAssessmentRun::lastFailureMessage))
.setter(setter(Builder::lastFailureMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastFailureMessage").build())
.build();
private static final SdkField SERVICE_ACCESS_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceAccessRoleArn").getter(getter(ReplicationTaskAssessmentRun::serviceAccessRoleArn))
.setter(setter(Builder::serviceAccessRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceAccessRoleArn").build())
.build();
private static final SdkField RESULT_LOCATION_BUCKET_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResultLocationBucket").getter(getter(ReplicationTaskAssessmentRun::resultLocationBucket))
.setter(setter(Builder::resultLocationBucket))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResultLocationBucket").build())
.build();
private static final SdkField RESULT_LOCATION_FOLDER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResultLocationFolder").getter(getter(ReplicationTaskAssessmentRun::resultLocationFolder))
.setter(setter(Builder::resultLocationFolder))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResultLocationFolder").build())
.build();
private static final SdkField RESULT_ENCRYPTION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResultEncryptionMode").getter(getter(ReplicationTaskAssessmentRun::resultEncryptionMode))
.setter(setter(Builder::resultEncryptionMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResultEncryptionMode").build())
.build();
private static final SdkField RESULT_KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ResultKmsKeyArn").getter(getter(ReplicationTaskAssessmentRun::resultKmsKeyArn))
.setter(setter(Builder::resultKmsKeyArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResultKmsKeyArn").build()).build();
private static final SdkField ASSESSMENT_RUN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AssessmentRunName").getter(getter(ReplicationTaskAssessmentRun::assessmentRunName))
.setter(setter(Builder::assessmentRunName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssessmentRunName").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
REPLICATION_TASK_ASSESSMENT_RUN_ARN_FIELD, REPLICATION_TASK_ARN_FIELD, STATUS_FIELD,
REPLICATION_TASK_ASSESSMENT_RUN_CREATION_DATE_FIELD, ASSESSMENT_PROGRESS_FIELD, LAST_FAILURE_MESSAGE_FIELD,
SERVICE_ACCESS_ROLE_ARN_FIELD, RESULT_LOCATION_BUCKET_FIELD, RESULT_LOCATION_FOLDER_FIELD,
RESULT_ENCRYPTION_MODE_FIELD, RESULT_KMS_KEY_ARN_FIELD, ASSESSMENT_RUN_NAME_FIELD));
private static final long serialVersionUID = 1L;
private final String replicationTaskAssessmentRunArn;
private final String replicationTaskArn;
private final String status;
private final Instant replicationTaskAssessmentRunCreationDate;
private final ReplicationTaskAssessmentRunProgress assessmentProgress;
private final String lastFailureMessage;
private final String serviceAccessRoleArn;
private final String resultLocationBucket;
private final String resultLocationFolder;
private final String resultEncryptionMode;
private final String resultKmsKeyArn;
private final String assessmentRunName;
private ReplicationTaskAssessmentRun(BuilderImpl builder) {
this.replicationTaskAssessmentRunArn = builder.replicationTaskAssessmentRunArn;
this.replicationTaskArn = builder.replicationTaskArn;
this.status = builder.status;
this.replicationTaskAssessmentRunCreationDate = builder.replicationTaskAssessmentRunCreationDate;
this.assessmentProgress = builder.assessmentProgress;
this.lastFailureMessage = builder.lastFailureMessage;
this.serviceAccessRoleArn = builder.serviceAccessRoleArn;
this.resultLocationBucket = builder.resultLocationBucket;
this.resultLocationFolder = builder.resultLocationFolder;
this.resultEncryptionMode = builder.resultEncryptionMode;
this.resultKmsKeyArn = builder.resultKmsKeyArn;
this.assessmentRunName = builder.assessmentRunName;
}
/**
*
* Amazon Resource Name (ARN) of this assessment run.
*
*
* @return Amazon Resource Name (ARN) of this assessment run.
*/
public final String replicationTaskAssessmentRunArn() {
return replicationTaskAssessmentRunArn;
}
/**
*
* ARN of the migration task associated with this premigration assessment run.
*
*
* @return ARN of the migration task associated with this premigration assessment run.
*/
public final String replicationTaskArn() {
return replicationTaskArn;
}
/**
*
* Assessment run status.
*
*
* This status can have one of the following values:
*
*
* -
*
* "cancelling"
– The assessment run was canceled by the
* CancelReplicationTaskAssessmentRun
operation.
*
*
* -
*
* "deleting"
– The assessment run was deleted by the DeleteReplicationTaskAssessmentRun
* operation.
*
*
* -
*
* "failed"
– At least one individual assessment completed with a failed
status.
*
*
* -
*
* "error-provisioning"
– An internal error occurred while resources were provisioned (during
* provisioning
status).
*
*
* -
*
* "error-executing"
– An internal error occurred while individual assessments ran (during
* running
status).
*
*
* -
*
* "invalid state"
– The assessment run is in an unknown state.
*
*
* -
*
* "passed"
– All individual assessments have completed, and none has a failed
status.
*
*
* -
*
* "provisioning"
– Resources required to run individual assessments are being provisioned.
*
*
* -
*
* "running"
– Individual assessments are being run.
*
*
* -
*
* "starting"
– The assessment run is starting, but resources are not yet being provisioned for
* individual assessments.
*
*
*
*
* @return Assessment run status.
*
* This status can have one of the following values:
*
*
* -
*
* "cancelling"
– The assessment run was canceled by the
* CancelReplicationTaskAssessmentRun
operation.
*
*
* -
*
* "deleting"
– The assessment run was deleted by the
* DeleteReplicationTaskAssessmentRun
operation.
*
*
* -
*
* "failed"
– At least one individual assessment completed with a failed
status.
*
*
* -
*
* "error-provisioning"
– An internal error occurred while resources were provisioned (during
* provisioning
status).
*
*
* -
*
* "error-executing"
– An internal error occurred while individual assessments ran (during
* running
status).
*
*
* -
*
* "invalid state"
– The assessment run is in an unknown state.
*
*
* -
*
* "passed"
– All individual assessments have completed, and none has a failed
* status.
*
*
* -
*
* "provisioning"
– Resources required to run individual assessments are being provisioned.
*
*
* -
*
* "running"
– Individual assessments are being run.
*
*
* -
*
* "starting"
– The assessment run is starting, but resources are not yet being provisioned for
* individual assessments.
*
*
*/
public final String status() {
return status;
}
/**
*
* Date on which the assessment run was created using the StartReplicationTaskAssessmentRun
operation.
*
*
* @return Date on which the assessment run was created using the StartReplicationTaskAssessmentRun
* operation.
*/
public final Instant replicationTaskAssessmentRunCreationDate() {
return replicationTaskAssessmentRunCreationDate;
}
/**
*
* Indication of the completion progress for the individual assessments specified to run.
*
*
* @return Indication of the completion progress for the individual assessments specified to run.
*/
public final ReplicationTaskAssessmentRunProgress assessmentProgress() {
return assessmentProgress;
}
/**
*
* Last message generated by an individual assessment failure.
*
*
* @return Last message generated by an individual assessment failure.
*/
public final String lastFailureMessage() {
return lastFailureMessage;
}
/**
*
* ARN of the service role used to start the assessment run using the StartReplicationTaskAssessmentRun
* operation. The role must allow the iam:PassRole
action.
*
*
* @return ARN of the service role used to start the assessment run using the
* StartReplicationTaskAssessmentRun
operation. The role must allow the
* iam:PassRole
action.
*/
public final String serviceAccessRoleArn() {
return serviceAccessRoleArn;
}
/**
*
* Amazon S3 bucket where DMS stores the results of this assessment run.
*
*
* @return Amazon S3 bucket where DMS stores the results of this assessment run.
*/
public final String resultLocationBucket() {
return resultLocationBucket;
}
/**
*
* Folder in an Amazon S3 bucket where DMS stores the results of this assessment run.
*
*
* @return Folder in an Amazon S3 bucket where DMS stores the results of this assessment run.
*/
public final String resultLocationFolder() {
return resultLocationFolder;
}
/**
*
* Encryption mode used to encrypt the assessment run results.
*
*
* @return Encryption mode used to encrypt the assessment run results.
*/
public final String resultEncryptionMode() {
return resultEncryptionMode;
}
/**
*
* ARN of the KMS encryption key used to encrypt the assessment run results.
*
*
* @return ARN of the KMS encryption key used to encrypt the assessment run results.
*/
public final String resultKmsKeyArn() {
return resultKmsKeyArn;
}
/**
*
* Unique name of the assessment run.
*
*
* @return Unique name of the assessment run.
*/
public final String assessmentRunName() {
return assessmentRunName;
}
@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(replicationTaskAssessmentRunArn());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskArn());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskAssessmentRunCreationDate());
hashCode = 31 * hashCode + Objects.hashCode(assessmentProgress());
hashCode = 31 * hashCode + Objects.hashCode(lastFailureMessage());
hashCode = 31 * hashCode + Objects.hashCode(serviceAccessRoleArn());
hashCode = 31 * hashCode + Objects.hashCode(resultLocationBucket());
hashCode = 31 * hashCode + Objects.hashCode(resultLocationFolder());
hashCode = 31 * hashCode + Objects.hashCode(resultEncryptionMode());
hashCode = 31 * hashCode + Objects.hashCode(resultKmsKeyArn());
hashCode = 31 * hashCode + Objects.hashCode(assessmentRunName());
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 ReplicationTaskAssessmentRun)) {
return false;
}
ReplicationTaskAssessmentRun other = (ReplicationTaskAssessmentRun) obj;
return Objects.equals(replicationTaskAssessmentRunArn(), other.replicationTaskAssessmentRunArn())
&& Objects.equals(replicationTaskArn(), other.replicationTaskArn()) && Objects.equals(status(), other.status())
&& Objects.equals(replicationTaskAssessmentRunCreationDate(), other.replicationTaskAssessmentRunCreationDate())
&& Objects.equals(assessmentProgress(), other.assessmentProgress())
&& Objects.equals(lastFailureMessage(), other.lastFailureMessage())
&& Objects.equals(serviceAccessRoleArn(), other.serviceAccessRoleArn())
&& Objects.equals(resultLocationBucket(), other.resultLocationBucket())
&& Objects.equals(resultLocationFolder(), other.resultLocationFolder())
&& Objects.equals(resultEncryptionMode(), other.resultEncryptionMode())
&& Objects.equals(resultKmsKeyArn(), other.resultKmsKeyArn())
&& Objects.equals(assessmentRunName(), other.assessmentRunName());
}
/**
* 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("ReplicationTaskAssessmentRun")
.add("ReplicationTaskAssessmentRunArn", replicationTaskAssessmentRunArn())
.add("ReplicationTaskArn", replicationTaskArn()).add("Status", status())
.add("ReplicationTaskAssessmentRunCreationDate", replicationTaskAssessmentRunCreationDate())
.add("AssessmentProgress", assessmentProgress()).add("LastFailureMessage", lastFailureMessage())
.add("ServiceAccessRoleArn", serviceAccessRoleArn()).add("ResultLocationBucket", resultLocationBucket())
.add("ResultLocationFolder", resultLocationFolder()).add("ResultEncryptionMode", resultEncryptionMode())
.add("ResultKmsKeyArn", resultKmsKeyArn()).add("AssessmentRunName", assessmentRunName()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReplicationTaskAssessmentRunArn":
return Optional.ofNullable(clazz.cast(replicationTaskAssessmentRunArn()));
case "ReplicationTaskArn":
return Optional.ofNullable(clazz.cast(replicationTaskArn()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "ReplicationTaskAssessmentRunCreationDate":
return Optional.ofNullable(clazz.cast(replicationTaskAssessmentRunCreationDate()));
case "AssessmentProgress":
return Optional.ofNullable(clazz.cast(assessmentProgress()));
case "LastFailureMessage":
return Optional.ofNullable(clazz.cast(lastFailureMessage()));
case "ServiceAccessRoleArn":
return Optional.ofNullable(clazz.cast(serviceAccessRoleArn()));
case "ResultLocationBucket":
return Optional.ofNullable(clazz.cast(resultLocationBucket()));
case "ResultLocationFolder":
return Optional.ofNullable(clazz.cast(resultLocationFolder()));
case "ResultEncryptionMode":
return Optional.ofNullable(clazz.cast(resultEncryptionMode()));
case "ResultKmsKeyArn":
return Optional.ofNullable(clazz.cast(resultKmsKeyArn()));
case "AssessmentRunName":
return Optional.ofNullable(clazz.cast(assessmentRunName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function