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

software.amazon.awssdk.services.neptunegraph.model.CreateGraphUsingImportTaskResponse 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.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 CreateGraphUsingImportTaskResponse extends NeptuneGraphResponse implements
        ToCopyableBuilder {
    private static final SdkField GRAPH_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("graphId").getter(getter(CreateGraphUsingImportTaskResponse::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(CreateGraphUsingImportTaskResponse::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(CreateGraphUsingImportTaskResponse::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(CreateGraphUsingImportTaskResponse::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(CreateGraphUsingImportTaskResponse::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(CreateGraphUsingImportTaskResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();

    private static final SdkField IMPORT_OPTIONS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("importOptions")
            .getter(getter(CreateGraphUsingImportTaskResponse::importOptions)).setter(setter(Builder::importOptions))
            .constructor(ImportOptions::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("importOptions").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, IMPORT_OPTIONS_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 final ImportOptions importOptions;

    private CreateGraphUsingImportTaskResponse(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;
        this.importOptions = builder.importOptions;
    }

    /**
     * 

* 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; } /** *

* The status of the import task. *

*

* 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 The status of the import task. * @see ImportTaskStatus */ public final ImportTaskStatus status() { return ImportTaskStatus.fromValue(status); } /** *

* The status of the import task. *

*

* 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 The status of the import task. * @see ImportTaskStatus */ public final String statusAsString() { return status; } /** *

* Contains options for controlling the import process. For example, if the failOnError key is set to * false, the import skips problem data and attempts to continue (whereas if set to true, * the default, or if omitted, the import operation halts immediately when an error is encountered. *

* * @return Contains options for controlling the import process. For example, if the failOnError key is * set to false, the import skips problem data and attempts to continue (whereas if set to * true, the default, or if omitted, the import operation halts immediately when an error is * encountered. */ public final ImportOptions importOptions() { return importOptions; } @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()); hashCode = 31 * hashCode + Objects.hashCode(importOptions()); 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 CreateGraphUsingImportTaskResponse)) { return false; } CreateGraphUsingImportTaskResponse other = (CreateGraphUsingImportTaskResponse) 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()) && Objects.equals(importOptions(), other.importOptions()); } /** * 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("CreateGraphUsingImportTaskResponse").add("GraphId", graphId()).add("TaskId", taskId()) .add("Source", source()).add("Format", formatAsString()).add("RoleArn", roleArn()) .add("Status", statusAsString()).add("ImportOptions", importOptions()).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())); case "importOptions": return Optional.ofNullable(clazz.cast(importOptions())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateGraphUsingImportTaskResponse) 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); /** *

* The status of the import task. *

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

* The status of the import task. *

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

* Contains options for controlling the import process. For example, if the failOnError key is set * to false, the import skips problem data and attempts to continue (whereas if set to * true, the default, or if omitted, the import operation halts immediately when an error is * encountered. *

* * @param importOptions * Contains options for controlling the import process. For example, if the failOnError key * is set to false, the import skips problem data and attempts to continue (whereas if set * to true, the default, or if omitted, the import operation halts immediately when an error * is encountered. * @return Returns a reference to this object so that method calls can be chained together. */ Builder importOptions(ImportOptions importOptions); /** *

* Contains options for controlling the import process. For example, if the failOnError key is set * to false, the import skips problem data and attempts to continue (whereas if set to * true, the default, or if omitted, the import operation halts immediately when an error is * encountered. *

* This is a convenience method that creates an instance of the {@link ImportOptions.Builder} avoiding the need * to create one manually via {@link ImportOptions#builder()}. * *

* When the {@link Consumer} completes, {@link ImportOptions.Builder#build()} is called immediately and its * result is passed to {@link #importOptions(ImportOptions)}. * * @param importOptions * a consumer that will call methods on {@link ImportOptions.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #importOptions(ImportOptions) */ default Builder importOptions(Consumer importOptions) { return importOptions(ImportOptions.builder().applyMutation(importOptions).build()); } } 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 ImportOptions importOptions; private BuilderImpl() { } private BuilderImpl(CreateGraphUsingImportTaskResponse model) { super(model); graphId(model.graphId); taskId(model.taskId); source(model.source); format(model.format); roleArn(model.roleArn); status(model.status); importOptions(model.importOptions); } 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; } public final ImportOptions.Builder getImportOptions() { return importOptions != null ? importOptions.toBuilder() : null; } public final void setImportOptions(ImportOptions.BuilderImpl importOptions) { this.importOptions = importOptions != null ? importOptions.build() : null; } @Override public final Builder importOptions(ImportOptions importOptions) { this.importOptions = importOptions; return this; } @Override public CreateGraphUsingImportTaskResponse build() { return new CreateGraphUsingImportTaskResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy