software.amazon.awssdk.services.neptunegraph.model.CancelImportTaskResponse Maven / Gradle / Ivy
Show all versions of neptunegraph Show documentation
/*
* 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.neptunegraph.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.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 CancelImportTaskResponse extends NeptuneGraphResponse implements
ToCopyableBuilder {
private static final SdkField GRAPH_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("graphId").getter(getter(CancelImportTaskResponse::graphId)).setter(setter(Builder::graphId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("graphId").build()).build();
private static final SdkField TASK_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("taskId")
.getter(getter(CancelImportTaskResponse::taskId)).setter(setter(Builder::taskId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskId").build()).build();
private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("source")
.getter(getter(CancelImportTaskResponse::source)).setter(setter(Builder::source))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("source").build()).build();
private static final SdkField FORMAT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("format")
.getter(getter(CancelImportTaskResponse::formatAsString)).setter(setter(Builder::format))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("format").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("roleArn").getter(getter(CancelImportTaskResponse::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(CancelImportTaskResponse::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(GRAPH_ID_FIELD, TASK_ID_FIELD,
SOURCE_FIELD, FORMAT_FIELD, ROLE_ARN_FIELD, STATUS_FIELD));
private final String graphId;
private final String taskId;
private final String source;
private final String format;
private final String roleArn;
private final String status;
private CancelImportTaskResponse(BuilderImpl builder) {
super(builder);
this.graphId = builder.graphId;
this.taskId = builder.taskId;
this.source = builder.source;
this.format = builder.format;
this.roleArn = builder.roleArn;
this.status = builder.status;
}
/**
*
* The unique identifier of the Neptune Analytics graph.
*
*
* @return The unique identifier of the Neptune Analytics graph.
*/
public final String graphId() {
return graphId;
}
/**
*
* The unique identifier of the import task.
*
*
* @return The unique identifier of the import task.
*/
public final String taskId() {
return taskId;
}
/**
*
* A URL identifying to the location of the data to be imported. This can be an Amazon S3 path, or can point to a
* Neptune database endpoint or snapshot.
*
*
* @return A URL identifying to the location of the data to be imported. This can be an Amazon S3 path, or can point
* to a Neptune database endpoint or snapshot.
*/
public final String source() {
return source;
}
/**
*
* Specifies the format of S3 data to be imported. Valid values are CSV
, which identifies the Gremlin CSV
* format or OPENCYPHER
, which identies the openCypher
* load format.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #format} will
* return {@link Format#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #formatAsString}.
*
*
* @return Specifies the format of S3 data to be imported. Valid values are CSV
, which identifies the
*
* Gremlin CSV format or OPENCYPHER
, which identies the openCypher load format.
* @see Format
*/
public final Format format() {
return Format.fromValue(format);
}
/**
*
* Specifies the format of S3 data to be imported. Valid values are CSV
, which identifies the Gremlin CSV
* format or OPENCYPHER
, which identies the openCypher
* load format.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #format} will
* return {@link Format#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #formatAsString}.
*
*
* @return Specifies the format of S3 data to be imported. Valid values are CSV
, which identifies the
*
* Gremlin CSV format or OPENCYPHER
, which identies the openCypher load format.
* @see Format
*/
public final String formatAsString() {
return format;
}
/**
*
* The ARN of the IAM role that will allow access to the data that is to be imported.
*
*
* @return The ARN of the IAM role that will allow access to the data that is to be imported.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* Current status of the task. Status is CANCELLING when the import task is cancelled.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ImportTaskStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return Current status of the task. Status is CANCELLING when the import task is cancelled.
* @see ImportTaskStatus
*/
public final ImportTaskStatus status() {
return ImportTaskStatus.fromValue(status);
}
/**
*
* Current status of the task. Status is CANCELLING when the import task is cancelled.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ImportTaskStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return Current status of the task. Status is CANCELLING when the import task is cancelled.
* @see ImportTaskStatus
*/
public final String statusAsString() {
return status;
}
@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(graphId());
hashCode = 31 * hashCode + Objects.hashCode(taskId());
hashCode = 31 * hashCode + Objects.hashCode(source());
hashCode = 31 * hashCode + Objects.hashCode(formatAsString());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
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 CancelImportTaskResponse)) {
return false;
}
CancelImportTaskResponse other = (CancelImportTaskResponse) obj;
return Objects.equals(graphId(), other.graphId()) && Objects.equals(taskId(), other.taskId())
&& Objects.equals(source(), other.source()) && Objects.equals(formatAsString(), other.formatAsString())
&& Objects.equals(roleArn(), other.roleArn()) && Objects.equals(statusAsString(), other.statusAsString());
}
/**
* 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("CancelImportTaskResponse").add("GraphId", graphId()).add("TaskId", taskId())
.add("Source", source()).add("Format", formatAsString()).add("RoleArn", roleArn())
.add("Status", statusAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "graphId":
return Optional.ofNullable(clazz.cast(graphId()));
case "taskId":
return Optional.ofNullable(clazz.cast(taskId()));
case "source":
return Optional.ofNullable(clazz.cast(source()));
case "format":
return Optional.ofNullable(clazz.cast(formatAsString()));
case "roleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function