software.amazon.awssdk.services.applicationdiscovery.model.ExportInfo 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.applicationdiscovery.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
/**
*
* Information regarding the export status of discovered data. The value is an array of objects.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExportInfo implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField EXPORT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("exportId").getter(getter(ExportInfo::exportId)).setter(setter(Builder::exportId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportId").build()).build();
private static final SdkField EXPORT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("exportStatus").getter(getter(ExportInfo::exportStatusAsString)).setter(setter(Builder::exportStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportStatus").build()).build();
private static final SdkField STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("statusMessage").getter(getter(ExportInfo::statusMessage)).setter(setter(Builder::statusMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusMessage").build()).build();
private static final SdkField CONFIGURATIONS_DOWNLOAD_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("configurationsDownloadUrl").getter(getter(ExportInfo::configurationsDownloadUrl))
.setter(setter(Builder::configurationsDownloadUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("configurationsDownloadUrl").build())
.build();
private static final SdkField EXPORT_REQUEST_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("exportRequestTime").getter(getter(ExportInfo::exportRequestTime))
.setter(setter(Builder::exportRequestTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportRequestTime").build()).build();
private static final SdkField IS_TRUNCATED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("isTruncated").getter(getter(ExportInfo::isTruncated)).setter(setter(Builder::isTruncated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("isTruncated").build()).build();
private static final SdkField REQUESTED_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("requestedStartTime").getter(getter(ExportInfo::requestedStartTime))
.setter(setter(Builder::requestedStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requestedStartTime").build())
.build();
private static final SdkField REQUESTED_END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("requestedEndTime").getter(getter(ExportInfo::requestedEndTime))
.setter(setter(Builder::requestedEndTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requestedEndTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EXPORT_ID_FIELD,
EXPORT_STATUS_FIELD, STATUS_MESSAGE_FIELD, CONFIGURATIONS_DOWNLOAD_URL_FIELD, EXPORT_REQUEST_TIME_FIELD,
IS_TRUNCATED_FIELD, REQUESTED_START_TIME_FIELD, REQUESTED_END_TIME_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String exportId;
private final String exportStatus;
private final String statusMessage;
private final String configurationsDownloadUrl;
private final Instant exportRequestTime;
private final Boolean isTruncated;
private final Instant requestedStartTime;
private final Instant requestedEndTime;
private ExportInfo(BuilderImpl builder) {
this.exportId = builder.exportId;
this.exportStatus = builder.exportStatus;
this.statusMessage = builder.statusMessage;
this.configurationsDownloadUrl = builder.configurationsDownloadUrl;
this.exportRequestTime = builder.exportRequestTime;
this.isTruncated = builder.isTruncated;
this.requestedStartTime = builder.requestedStartTime;
this.requestedEndTime = builder.requestedEndTime;
}
/**
*
* A unique identifier used to query an export.
*
*
* @return A unique identifier used to query an export.
*/
public final String exportId() {
return exportId;
}
/**
*
* The status of the data export job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #exportStatus} will
* return {@link ExportStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #exportStatusAsString}.
*
*
* @return The status of the data export job.
* @see ExportStatus
*/
public final ExportStatus exportStatus() {
return ExportStatus.fromValue(exportStatus);
}
/**
*
* The status of the data export job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #exportStatus} will
* return {@link ExportStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #exportStatusAsString}.
*
*
* @return The status of the data export job.
* @see ExportStatus
*/
public final String exportStatusAsString() {
return exportStatus;
}
/**
*
* A status message provided for API callers.
*
*
* @return A status message provided for API callers.
*/
public final String statusMessage() {
return statusMessage;
}
/**
*
* A URL for an Amazon S3 bucket where you can review the exported data. The URL is displayed only if the export
* succeeded.
*
*
* @return A URL for an Amazon S3 bucket where you can review the exported data. The URL is displayed only if the
* export succeeded.
*/
public final String configurationsDownloadUrl() {
return configurationsDownloadUrl;
}
/**
*
* The time that the data export was initiated.
*
*
* @return The time that the data export was initiated.
*/
public final Instant exportRequestTime() {
return exportRequestTime;
}
/**
*
* If true, the export of agent information exceeded the size limit for a single export and the exported data is
* incomplete for the requested time range. To address this, select a smaller time range for the export by using
* startDate
and endDate
.
*
*
* @return If true, the export of agent information exceeded the size limit for a single export and the exported
* data is incomplete for the requested time range. To address this, select a smaller time range for the
* export by using startDate
and endDate
.
*/
public final Boolean isTruncated() {
return isTruncated;
}
/**
*
* The value of startTime
parameter in the StartExportTask
request. If no
* startTime
was requested, this result does not appear in ExportInfo
.
*
*
* @return The value of startTime
parameter in the StartExportTask
request. If no
* startTime
was requested, this result does not appear in ExportInfo
.
*/
public final Instant requestedStartTime() {
return requestedStartTime;
}
/**
*
* The endTime
used in the StartExportTask
request. If no endTime
was
* requested, this result does not appear in ExportInfo
.
*
*
* @return The endTime
used in the StartExportTask
request. If no endTime
was
* requested, this result does not appear in ExportInfo
.
*/
public final Instant requestedEndTime() {
return requestedEndTime;
}
@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 + Objects.hashCode(exportId());
hashCode = 31 * hashCode + Objects.hashCode(exportStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusMessage());
hashCode = 31 * hashCode + Objects.hashCode(configurationsDownloadUrl());
hashCode = 31 * hashCode + Objects.hashCode(exportRequestTime());
hashCode = 31 * hashCode + Objects.hashCode(isTruncated());
hashCode = 31 * hashCode + Objects.hashCode(requestedStartTime());
hashCode = 31 * hashCode + Objects.hashCode(requestedEndTime());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExportInfo)) {
return false;
}
ExportInfo other = (ExportInfo) obj;
return Objects.equals(exportId(), other.exportId())
&& Objects.equals(exportStatusAsString(), other.exportStatusAsString())
&& Objects.equals(statusMessage(), other.statusMessage())
&& Objects.equals(configurationsDownloadUrl(), other.configurationsDownloadUrl())
&& Objects.equals(exportRequestTime(), other.exportRequestTime())
&& Objects.equals(isTruncated(), other.isTruncated())
&& Objects.equals(requestedStartTime(), other.requestedStartTime())
&& Objects.equals(requestedEndTime(), other.requestedEndTime());
}
/**
* 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("ExportInfo").add("ExportId", exportId()).add("ExportStatus", exportStatusAsString())
.add("StatusMessage", statusMessage()).add("ConfigurationsDownloadUrl", configurationsDownloadUrl())
.add("ExportRequestTime", exportRequestTime()).add("IsTruncated", isTruncated())
.add("RequestedStartTime", requestedStartTime()).add("RequestedEndTime", requestedEndTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "exportId":
return Optional.ofNullable(clazz.cast(exportId()));
case "exportStatus":
return Optional.ofNullable(clazz.cast(exportStatusAsString()));
case "statusMessage":
return Optional.ofNullable(clazz.cast(statusMessage()));
case "configurationsDownloadUrl":
return Optional.ofNullable(clazz.cast(configurationsDownloadUrl()));
case "exportRequestTime":
return Optional.ofNullable(clazz.cast(exportRequestTime()));
case "isTruncated":
return Optional.ofNullable(clazz.cast(isTruncated()));
case "requestedStartTime":
return Optional.ofNullable(clazz.cast(requestedStartTime()));
case "requestedEndTime":
return Optional.ofNullable(clazz.cast(requestedEndTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("exportId", EXPORT_ID_FIELD);
map.put("exportStatus", EXPORT_STATUS_FIELD);
map.put("statusMessage", STATUS_MESSAGE_FIELD);
map.put("configurationsDownloadUrl", CONFIGURATIONS_DOWNLOAD_URL_FIELD);
map.put("exportRequestTime", EXPORT_REQUEST_TIME_FIELD);
map.put("isTruncated", IS_TRUNCATED_FIELD);
map.put("requestedStartTime", REQUESTED_START_TIME_FIELD);
map.put("requestedEndTime", REQUESTED_END_TIME_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function