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

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

    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(GetGraphSnapshotResponse::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
            .getter(getter(GetGraphSnapshotResponse::arn)).setter(setter(Builder::arn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();

    private static final SdkField SOURCE_GRAPH_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("sourceGraphId").getter(getter(GetGraphSnapshotResponse::sourceGraphId))
            .setter(setter(Builder::sourceGraphId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourceGraphId").build()).build();

    private static final SdkField SNAPSHOT_CREATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("snapshotCreateTime").getter(getter(GetGraphSnapshotResponse::snapshotCreateTime))
            .setter(setter(Builder::snapshotCreateTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("snapshotCreateTime").build())
            .build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
            .getter(getter(GetGraphSnapshotResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();

    private static final SdkField KMS_KEY_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("kmsKeyIdentifier").getter(getter(GetGraphSnapshotResponse::kmsKeyIdentifier))
            .setter(setter(Builder::kmsKeyIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKeyIdentifier").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, NAME_FIELD,
            ARN_FIELD, SOURCE_GRAPH_ID_FIELD, SNAPSHOT_CREATE_TIME_FIELD, STATUS_FIELD, KMS_KEY_IDENTIFIER_FIELD));

    private final String id;

    private final String name;

    private final String arn;

    private final String sourceGraphId;

    private final Instant snapshotCreateTime;

    private final String status;

    private final String kmsKeyIdentifier;

    private GetGraphSnapshotResponse(BuilderImpl builder) {
        super(builder);
        this.id = builder.id;
        this.name = builder.name;
        this.arn = builder.arn;
        this.sourceGraphId = builder.sourceGraphId;
        this.snapshotCreateTime = builder.snapshotCreateTime;
        this.status = builder.status;
        this.kmsKeyIdentifier = builder.kmsKeyIdentifier;
    }

    /**
     * 

* The unique identifier of the graph snapshot. *

* * @return The unique identifier of the graph snapshot. */ public final String id() { return id; } /** *

* The snapshot name. For example: my-snapshot-1. *

*

* The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It * cannot end with a hyphen or contain two consecutive hyphens. *

* * @return The snapshot name. For example: my-snapshot-1.

*

* The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a * letter. It cannot end with a hyphen or contain two consecutive hyphens. */ public final String name() { return name; } /** *

* The ARN of the graph snapshot. *

* * @return The ARN of the graph snapshot. */ public final String arn() { return arn; } /** *

* The graph identifier for the graph for which a snapshot is to be created. *

* * @return The graph identifier for the graph for which a snapshot is to be created. */ public final String sourceGraphId() { return sourceGraphId; } /** *

* The time when the snapshot was created. *

* * @return The time when the snapshot was created. */ public final Instant snapshotCreateTime() { return snapshotCreateTime; } /** *

* The status of the graph snapshot. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link SnapshotStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the graph snapshot. * @see SnapshotStatus */ public final SnapshotStatus status() { return SnapshotStatus.fromValue(status); } /** *

* The status of the graph snapshot. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link SnapshotStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The status of the graph snapshot. * @see SnapshotStatus */ public final String statusAsString() { return status; } /** *

* The ID of the KMS key used to encrypt and decrypt the snapshot. *

* * @return The ID of the KMS key used to encrypt and decrypt the snapshot. */ public final String kmsKeyIdentifier() { return kmsKeyIdentifier; } @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(id()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(sourceGraphId()); hashCode = 31 * hashCode + Objects.hashCode(snapshotCreateTime()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyIdentifier()); 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 GetGraphSnapshotResponse)) { return false; } GetGraphSnapshotResponse other = (GetGraphSnapshotResponse) obj; return Objects.equals(id(), other.id()) && Objects.equals(name(), other.name()) && Objects.equals(arn(), other.arn()) && Objects.equals(sourceGraphId(), other.sourceGraphId()) && Objects.equals(snapshotCreateTime(), other.snapshotCreateTime()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(kmsKeyIdentifier(), other.kmsKeyIdentifier()); } /** * 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("GetGraphSnapshotResponse").add("Id", id()).add("Name", name()).add("Arn", arn()) .add("SourceGraphId", sourceGraphId()).add("SnapshotCreateTime", snapshotCreateTime()) .add("Status", statusAsString()).add("KmsKeyIdentifier", kmsKeyIdentifier()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "id": return Optional.ofNullable(clazz.cast(id())); case "name": return Optional.ofNullable(clazz.cast(name())); case "arn": return Optional.ofNullable(clazz.cast(arn())); case "sourceGraphId": return Optional.ofNullable(clazz.cast(sourceGraphId())); case "snapshotCreateTime": return Optional.ofNullable(clazz.cast(snapshotCreateTime())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "kmsKeyIdentifier": return Optional.ofNullable(clazz.cast(kmsKeyIdentifier())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetGraphSnapshotResponse) 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 graph snapshot. *

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

* The snapshot name. For example: my-snapshot-1. *

*

* The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It * cannot end with a hyphen or contain two consecutive hyphens. *

* * @param name * The snapshot name. For example: my-snapshot-1.

*

* The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a * letter. It cannot end with a hyphen or contain two consecutive hyphens. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The ARN of the graph snapshot. *

* * @param arn * The ARN of the graph snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* The graph identifier for the graph for which a snapshot is to be created. *

* * @param sourceGraphId * The graph identifier for the graph for which a snapshot is to be created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceGraphId(String sourceGraphId); /** *

* The time when the snapshot was created. *

* * @param snapshotCreateTime * The time when the snapshot was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotCreateTime(Instant snapshotCreateTime); /** *

* The status of the graph snapshot. *

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

* The status of the graph snapshot. *

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

* The ID of the KMS key used to encrypt and decrypt the snapshot. *

* * @param kmsKeyIdentifier * The ID of the KMS key used to encrypt and decrypt the snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyIdentifier(String kmsKeyIdentifier); } static final class BuilderImpl extends NeptuneGraphResponse.BuilderImpl implements Builder { private String id; private String name; private String arn; private String sourceGraphId; private Instant snapshotCreateTime; private String status; private String kmsKeyIdentifier; private BuilderImpl() { } private BuilderImpl(GetGraphSnapshotResponse model) { super(model); id(model.id); name(model.name); arn(model.arn); sourceGraphId(model.sourceGraphId); snapshotCreateTime(model.snapshotCreateTime); status(model.status); kmsKeyIdentifier(model.kmsKeyIdentifier); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getSourceGraphId() { return sourceGraphId; } public final void setSourceGraphId(String sourceGraphId) { this.sourceGraphId = sourceGraphId; } @Override public final Builder sourceGraphId(String sourceGraphId) { this.sourceGraphId = sourceGraphId; return this; } public final Instant getSnapshotCreateTime() { return snapshotCreateTime; } public final void setSnapshotCreateTime(Instant snapshotCreateTime) { this.snapshotCreateTime = snapshotCreateTime; } @Override public final Builder snapshotCreateTime(Instant snapshotCreateTime) { this.snapshotCreateTime = snapshotCreateTime; 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(SnapshotStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getKmsKeyIdentifier() { return kmsKeyIdentifier; } public final void setKmsKeyIdentifier(String kmsKeyIdentifier) { this.kmsKeyIdentifier = kmsKeyIdentifier; } @Override public final Builder kmsKeyIdentifier(String kmsKeyIdentifier) { this.kmsKeyIdentifier = kmsKeyIdentifier; return this; } @Override public GetGraphSnapshotResponse build() { return new GetGraphSnapshotResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy