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

software.amazon.awssdk.services.neptunegraph.model.CancelImportTaskResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Neptune Graph module holds the client classes that are used for communicating with Neptune Graph.

There is a newer version: 2.29.39
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.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 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 getter(Function g) { return obj -> g.apply((CancelImportTaskResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends NeptuneGraphResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The unique identifier of the Neptune Analytics graph. *

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

* The unique identifier of the import task. *

* * @param taskId * The unique identifier of the import task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder taskId(String 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. *

* * @param source * 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 Returns a reference to this object so that method calls can be chained together. */ Builder source(String 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. *

* * @param 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. * @see Format * @return Returns a reference to this object so that method calls can be chained together. * @see Format */ Builder format(String 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. *

* * @param 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. * @see Format * @return Returns a reference to this object so that method calls can be chained together. * @see Format */ Builder format(Format format); /** *

* The ARN of the IAM role that will allow access to the data that is to be imported. *

* * @param roleArn * The ARN of the IAM role that will allow access to the data that is to be imported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* Current status of the task. Status is CANCELLING when the import task is cancelled. *

* * @param status * Current status of the task. Status is CANCELLING when the import task is cancelled. * @see ImportTaskStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ImportTaskStatus */ Builder status(String status); /** *

* Current status of the task. Status is CANCELLING when the import task is cancelled. *

* * @param status * Current status of the task. Status is CANCELLING when the import task is cancelled. * @see ImportTaskStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ImportTaskStatus */ Builder status(ImportTaskStatus status); } static final class BuilderImpl extends NeptuneGraphResponse.BuilderImpl implements Builder { private String graphId; private String taskId; private String source; private String format; private String roleArn; private String status; private BuilderImpl() { } private BuilderImpl(CancelImportTaskResponse model) { super(model); graphId(model.graphId); taskId(model.taskId); source(model.source); format(model.format); roleArn(model.roleArn); status(model.status); } public final String getGraphId() { return graphId; } public final void setGraphId(String graphId) { this.graphId = graphId; } @Override public final Builder graphId(String graphId) { this.graphId = graphId; return this; } public final String getTaskId() { return taskId; } public final void setTaskId(String taskId) { this.taskId = taskId; } @Override public final Builder taskId(String taskId) { this.taskId = taskId; return this; } public final String getSource() { return source; } public final void setSource(String source) { this.source = source; } @Override public final Builder source(String source) { this.source = source; return this; } public final String getFormat() { return format; } public final void setFormat(String format) { this.format = format; } @Override public final Builder format(String format) { this.format = format; return this; } @Override public final Builder format(Format format) { this.format(format == null ? null : format.toString()); return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(ImportTaskStatus status) { this.status(status == null ? null : status.toString()); return this; } @Override public CancelImportTaskResponse build() { return new CancelImportTaskResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy