
software.amazon.awssdk.services.quicksight.model.DashboardVersionSummary 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.quicksight.model;
import java.io.Serializable;
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;
/**
*
* Dashboard version summary.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DashboardVersionSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DashboardVersionSummary::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();
private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(DashboardVersionSummary::createdTime)).setter(setter(Builder::createdTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build();
private static final SdkField VERSION_NUMBER_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(DashboardVersionSummary::versionNumber)).setter(setter(Builder::versionNumber))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VersionNumber").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DashboardVersionSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField SOURCE_ENTITY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DashboardVersionSummary::sourceEntityArn)).setter(setter(Builder::sourceEntityArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceEntityArn").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DashboardVersionSummary::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, CREATED_TIME_FIELD,
VERSION_NUMBER_FIELD, STATUS_FIELD, SOURCE_ENTITY_ARN_FIELD, DESCRIPTION_FIELD));
private static final long serialVersionUID = 1L;
private final String arn;
private final Instant createdTime;
private final Long versionNumber;
private final String status;
private final String sourceEntityArn;
private final String description;
private DashboardVersionSummary(BuilderImpl builder) {
this.arn = builder.arn;
this.createdTime = builder.createdTime;
this.versionNumber = builder.versionNumber;
this.status = builder.status;
this.sourceEntityArn = builder.sourceEntityArn;
this.description = builder.description;
}
/**
*
* The Amazon Resource Name (ARN) of the resource.
*
*
* @return The Amazon Resource Name (ARN) of the resource.
*/
public String arn() {
return arn;
}
/**
*
* The time that this dashboard version was created.
*
*
* @return The time that this dashboard version was created.
*/
public Instant createdTime() {
return createdTime;
}
/**
*
* Version number.
*
*
* @return Version number.
*/
public Long versionNumber() {
return versionNumber;
}
/**
*
* The HTTP status of the request.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ResourceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The HTTP status of the request.
* @see ResourceStatus
*/
public ResourceStatus status() {
return ResourceStatus.fromValue(status);
}
/**
*
* The HTTP status of the request.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ResourceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The HTTP status of the request.
* @see ResourceStatus
*/
public String statusAsString() {
return status;
}
/**
*
* Source entity ARN.
*
*
* @return Source entity ARN.
*/
public String sourceEntityArn() {
return sourceEntityArn;
}
/**
*
* Description.
*
*
* @return Description.
*/
public String description() {
return description;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(createdTime());
hashCode = 31 * hashCode + Objects.hashCode(versionNumber());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(sourceEntityArn());
hashCode = 31 * hashCode + Objects.hashCode(description());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DashboardVersionSummary)) {
return false;
}
DashboardVersionSummary other = (DashboardVersionSummary) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(createdTime(), other.createdTime())
&& Objects.equals(versionNumber(), other.versionNumber())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(sourceEntityArn(), other.sourceEntityArn())
&& Objects.equals(description(), other.description());
}
/**
* 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 String toString() {
return ToString.builder("DashboardVersionSummary").add("Arn", arn()).add("CreatedTime", createdTime())
.add("VersionNumber", versionNumber()).add("Status", statusAsString()).add("SourceEntityArn", sourceEntityArn())
.add("Description", description()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "CreatedTime":
return Optional.ofNullable(clazz.cast(createdTime()));
case "VersionNumber":
return Optional.ofNullable(clazz.cast(versionNumber()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "SourceEntityArn":
return Optional.ofNullable(clazz.cast(sourceEntityArn()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function