software.amazon.awssdk.services.qldb.model.JournalS3ExportDescription Maven / Gradle / Ivy
Show all versions of qldb Show documentation
/*
* 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.qldb.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.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;
/**
*
* Information about a journal export job, including the ledger name, export ID, creation time, current status, and the
* parameters of the original export creation request.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class JournalS3ExportDescription implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField LEDGER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LedgerName").getter(getter(JournalS3ExportDescription::ledgerName)).setter(setter(Builder::ledgerName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LedgerName").build()).build();
private static final SdkField EXPORT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ExportId").getter(getter(JournalS3ExportDescription::exportId)).setter(setter(Builder::exportId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExportId").build()).build();
private static final SdkField EXPORT_CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("ExportCreationTime").getter(getter(JournalS3ExportDescription::exportCreationTime))
.setter(setter(Builder::exportCreationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExportCreationTime").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(JournalS3ExportDescription::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField INCLUSIVE_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("InclusiveStartTime").getter(getter(JournalS3ExportDescription::inclusiveStartTime))
.setter(setter(Builder::inclusiveStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InclusiveStartTime").build())
.build();
private static final SdkField EXCLUSIVE_END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("ExclusiveEndTime").getter(getter(JournalS3ExportDescription::exclusiveEndTime))
.setter(setter(Builder::exclusiveEndTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExclusiveEndTime").build()).build();
private static final SdkField S3_EXPORT_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("S3ExportConfiguration")
.getter(getter(JournalS3ExportDescription::s3ExportConfiguration)).setter(setter(Builder::s3ExportConfiguration))
.constructor(S3ExportConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3ExportConfiguration").build())
.build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleArn").getter(getter(JournalS3ExportDescription::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();
private static final SdkField OUTPUT_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OutputFormat").getter(getter(JournalS3ExportDescription::outputFormatAsString))
.setter(setter(Builder::outputFormat))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputFormat").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LEDGER_NAME_FIELD,
EXPORT_ID_FIELD, EXPORT_CREATION_TIME_FIELD, STATUS_FIELD, INCLUSIVE_START_TIME_FIELD, EXCLUSIVE_END_TIME_FIELD,
S3_EXPORT_CONFIGURATION_FIELD, ROLE_ARN_FIELD, OUTPUT_FORMAT_FIELD));
private static final long serialVersionUID = 1L;
private final String ledgerName;
private final String exportId;
private final Instant exportCreationTime;
private final String status;
private final Instant inclusiveStartTime;
private final Instant exclusiveEndTime;
private final S3ExportConfiguration s3ExportConfiguration;
private final String roleArn;
private final String outputFormat;
private JournalS3ExportDescription(BuilderImpl builder) {
this.ledgerName = builder.ledgerName;
this.exportId = builder.exportId;
this.exportCreationTime = builder.exportCreationTime;
this.status = builder.status;
this.inclusiveStartTime = builder.inclusiveStartTime;
this.exclusiveEndTime = builder.exclusiveEndTime;
this.s3ExportConfiguration = builder.s3ExportConfiguration;
this.roleArn = builder.roleArn;
this.outputFormat = builder.outputFormat;
}
/**
*
* The name of the ledger.
*
*
* @return The name of the ledger.
*/
public final String ledgerName() {
return ledgerName;
}
/**
*
* The UUID (represented in Base62-encoded text) of the journal export job.
*
*
* @return The UUID (represented in Base62-encoded text) of the journal export job.
*/
public final String exportId() {
return exportId;
}
/**
*
* The date and time, in epoch time format, when the export job was created. (Epoch time format is the number of
* seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
*
*
* @return The date and time, in epoch time format, when the export job was created. (Epoch time format is the
* number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)
*/
public final Instant exportCreationTime() {
return exportCreationTime;
}
/**
*
* The current state of the journal export job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ExportStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current state of the journal export job.
* @see ExportStatus
*/
public final ExportStatus status() {
return ExportStatus.fromValue(status);
}
/**
*
* The current state of the journal export job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ExportStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current state of the journal export job.
* @see ExportStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The inclusive start date and time for the range of journal contents that was specified in the original export
* request.
*
*
* @return The inclusive start date and time for the range of journal contents that was specified in the original
* export request.
*/
public final Instant inclusiveStartTime() {
return inclusiveStartTime;
}
/**
*
* The exclusive end date and time for the range of journal contents that was specified in the original export
* request.
*
*
* @return The exclusive end date and time for the range of journal contents that was specified in the original
* export request.
*/
public final Instant exclusiveEndTime() {
return exclusiveEndTime;
}
/**
* Returns the value of the S3ExportConfiguration property for this object.
*
* @return The value of the S3ExportConfiguration property for this object.
*/
public final S3ExportConfiguration s3ExportConfiguration() {
return s3ExportConfiguration;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the
* following:
*
*
* -
*
* Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.
*
*
* -
*
* (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your
* exported data.
*
*
*
*
* @return The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to
* do the following:
*
* -
*
* Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.
*
*
* -
*
* (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of
* your exported data.
*
*
*/
public final String roleArn() {
return roleArn;
}
/**
*
* The output format of the exported journal data.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #outputFormat} will
* return {@link OutputFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #outputFormatAsString}.
*
*
* @return The output format of the exported journal data.
* @see OutputFormat
*/
public final OutputFormat outputFormat() {
return OutputFormat.fromValue(outputFormat);
}
/**
*
* The output format of the exported journal data.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #outputFormat} will
* return {@link OutputFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #outputFormatAsString}.
*
*
* @return The output format of the exported journal data.
* @see OutputFormat
*/
public final String outputFormatAsString() {
return outputFormat;
}
@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(ledgerName());
hashCode = 31 * hashCode + Objects.hashCode(exportId());
hashCode = 31 * hashCode + Objects.hashCode(exportCreationTime());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(inclusiveStartTime());
hashCode = 31 * hashCode + Objects.hashCode(exclusiveEndTime());
hashCode = 31 * hashCode + Objects.hashCode(s3ExportConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(outputFormatAsString());
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 JournalS3ExportDescription)) {
return false;
}
JournalS3ExportDescription other = (JournalS3ExportDescription) obj;
return Objects.equals(ledgerName(), other.ledgerName()) && Objects.equals(exportId(), other.exportId())
&& Objects.equals(exportCreationTime(), other.exportCreationTime())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(inclusiveStartTime(), other.inclusiveStartTime())
&& Objects.equals(exclusiveEndTime(), other.exclusiveEndTime())
&& Objects.equals(s3ExportConfiguration(), other.s3ExportConfiguration())
&& Objects.equals(roleArn(), other.roleArn())
&& Objects.equals(outputFormatAsString(), other.outputFormatAsString());
}
/**
* 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("JournalS3ExportDescription").add("LedgerName", ledgerName()).add("ExportId", exportId())
.add("ExportCreationTime", exportCreationTime()).add("Status", statusAsString())
.add("InclusiveStartTime", inclusiveStartTime()).add("ExclusiveEndTime", exclusiveEndTime())
.add("S3ExportConfiguration", s3ExportConfiguration()).add("RoleArn", roleArn())
.add("OutputFormat", outputFormatAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "LedgerName":
return Optional.ofNullable(clazz.cast(ledgerName()));
case "ExportId":
return Optional.ofNullable(clazz.cast(exportId()));
case "ExportCreationTime":
return Optional.ofNullable(clazz.cast(exportCreationTime()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "InclusiveStartTime":
return Optional.ofNullable(clazz.cast(inclusiveStartTime()));
case "ExclusiveEndTime":
return Optional.ofNullable(clazz.cast(exclusiveEndTime()));
case "S3ExportConfiguration":
return Optional.ofNullable(clazz.cast(s3ExportConfiguration()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "OutputFormat":
return Optional.ofNullable(clazz.cast(outputFormatAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function