
software.amazon.awssdk.services.appsync.model.GetDataSourceIntrospectionResponse 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.appsync.model;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetDataSourceIntrospectionResponse extends AppSyncResponse implements
ToCopyableBuilder {
private static final SdkField INTROSPECTION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("introspectionId").getter(getter(GetDataSourceIntrospectionResponse::introspectionId))
.setter(setter(Builder::introspectionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("introspectionId").build()).build();
private static final SdkField INTROSPECTION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("introspectionStatus").getter(getter(GetDataSourceIntrospectionResponse::introspectionStatusAsString))
.setter(setter(Builder::introspectionStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("introspectionStatus").build())
.build();
private static final SdkField INTROSPECTION_STATUS_DETAIL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("introspectionStatusDetail")
.getter(getter(GetDataSourceIntrospectionResponse::introspectionStatusDetail))
.setter(setter(Builder::introspectionStatusDetail))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("introspectionStatusDetail").build())
.build();
private static final SdkField INTROSPECTION_RESULT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("introspectionResult")
.getter(getter(GetDataSourceIntrospectionResponse::introspectionResult)).setter(setter(Builder::introspectionResult))
.constructor(DataSourceIntrospectionResult::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("introspectionResult").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INTROSPECTION_ID_FIELD,
INTROSPECTION_STATUS_FIELD, INTROSPECTION_STATUS_DETAIL_FIELD, INTROSPECTION_RESULT_FIELD));
private final String introspectionId;
private final String introspectionStatus;
private final String introspectionStatusDetail;
private final DataSourceIntrospectionResult introspectionResult;
private GetDataSourceIntrospectionResponse(BuilderImpl builder) {
super(builder);
this.introspectionId = builder.introspectionId;
this.introspectionStatus = builder.introspectionStatus;
this.introspectionStatusDetail = builder.introspectionStatusDetail;
this.introspectionResult = builder.introspectionResult;
}
/**
*
* The introspection ID. Each introspection contains a unique ID that can be used to reference the instrospection
* record.
*
*
* @return The introspection ID. Each introspection contains a unique ID that can be used to reference the
* instrospection record.
*/
public final String introspectionId() {
return introspectionId;
}
/**
*
* The status of the introspection during retrieval. By default, when a new instrospection is being retrieved, the
* status will be set to PROCESSING
. Once the operation has been completed, the status will change to
* SUCCESS
or FAILED
depending on how the data was parsed. A FAILED
operation
* will return an error and its details as an introspectionStatusDetail
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #introspectionStatus} will return {@link DataSourceIntrospectionStatus#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #introspectionStatusAsString}.
*
*
* @return The status of the introspection during retrieval. By default, when a new instrospection is being
* retrieved, the status will be set to PROCESSING
. Once the operation has been completed, the
* status will change to SUCCESS
or FAILED
depending on how the data was parsed. A
* FAILED
operation will return an error and its details as an
* introspectionStatusDetail
.
* @see DataSourceIntrospectionStatus
*/
public final DataSourceIntrospectionStatus introspectionStatus() {
return DataSourceIntrospectionStatus.fromValue(introspectionStatus);
}
/**
*
* The status of the introspection during retrieval. By default, when a new instrospection is being retrieved, the
* status will be set to PROCESSING
. Once the operation has been completed, the status will change to
* SUCCESS
or FAILED
depending on how the data was parsed. A FAILED
operation
* will return an error and its details as an introspectionStatusDetail
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #introspectionStatus} will return {@link DataSourceIntrospectionStatus#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #introspectionStatusAsString}.
*
*
* @return The status of the introspection during retrieval. By default, when a new instrospection is being
* retrieved, the status will be set to PROCESSING
. Once the operation has been completed, the
* status will change to SUCCESS
or FAILED
depending on how the data was parsed. A
* FAILED
operation will return an error and its details as an
* introspectionStatusDetail
.
* @see DataSourceIntrospectionStatus
*/
public final String introspectionStatusAsString() {
return introspectionStatus;
}
/**
*
* The error detail field. When a FAILED
introspectionStatus
is returned, the
* introspectionStatusDetail
will also return the exact error that was generated during the operation.
*
*
* @return The error detail field. When a FAILED
introspectionStatus
is returned, the
* introspectionStatusDetail
will also return the exact error that was generated during the
* operation.
*/
public final String introspectionStatusDetail() {
return introspectionStatusDetail;
}
/**
*
* The DataSourceIntrospectionResult
object data.
*
*
* @return The DataSourceIntrospectionResult
object data.
*/
public final DataSourceIntrospectionResult introspectionResult() {
return introspectionResult;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(introspectionId());
hashCode = 31 * hashCode + Objects.hashCode(introspectionStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(introspectionStatusDetail());
hashCode = 31 * hashCode + Objects.hashCode(introspectionResult());
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 GetDataSourceIntrospectionResponse)) {
return false;
}
GetDataSourceIntrospectionResponse other = (GetDataSourceIntrospectionResponse) obj;
return Objects.equals(introspectionId(), other.introspectionId())
&& Objects.equals(introspectionStatusAsString(), other.introspectionStatusAsString())
&& Objects.equals(introspectionStatusDetail(), other.introspectionStatusDetail())
&& Objects.equals(introspectionResult(), other.introspectionResult());
}
/**
* 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("GetDataSourceIntrospectionResponse").add("IntrospectionId", introspectionId())
.add("IntrospectionStatus", introspectionStatusAsString())
.add("IntrospectionStatusDetail", introspectionStatusDetail()).add("IntrospectionResult", introspectionResult())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "introspectionId":
return Optional.ofNullable(clazz.cast(introspectionId()));
case "introspectionStatus":
return Optional.ofNullable(clazz.cast(introspectionStatusAsString()));
case "introspectionStatusDetail":
return Optional.ofNullable(clazz.cast(introspectionStatusDetail()));
case "introspectionResult":
return Optional.ofNullable(clazz.cast(introspectionResult()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function