software.amazon.awssdk.services.qldb.model.ExportJournalToS3Request 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.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.awscore.AwsRequestOverrideConfiguration;
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 ExportJournalToS3Request extends QldbRequest implements
ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(ExportJournalToS3Request::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("name").build()).build();
private static final SdkField INCLUSIVE_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("InclusiveStartTime").getter(getter(ExportJournalToS3Request::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(ExportJournalToS3Request::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(ExportJournalToS3Request::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(ExportJournalToS3Request::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(ExportJournalToS3Request::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(NAME_FIELD,
INCLUSIVE_START_TIME_FIELD, EXCLUSIVE_END_TIME_FIELD, S3_EXPORT_CONFIGURATION_FIELD, ROLE_ARN_FIELD,
OUTPUT_FORMAT_FIELD));
private final String name;
private final Instant inclusiveStartTime;
private final Instant exclusiveEndTime;
private final S3ExportConfiguration s3ExportConfiguration;
private final String roleArn;
private final String outputFormat;
private ExportJournalToS3Request(BuilderImpl builder) {
super(builder);
this.name = builder.name;
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 name() {
return name;
}
/**
*
* The inclusive start date and time for the range of journal contents to export.
*
*
* The InclusiveStartTime
must be in ISO 8601
date and time format and in Universal
* Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* The InclusiveStartTime
must be before ExclusiveEndTime
.
*
*
* If you provide an InclusiveStartTime
that is before the ledger's CreationDateTime
,
* Amazon QLDB defaults it to the ledger's CreationDateTime
.
*
*
* @return The inclusive start date and time for the range of journal contents to export.
*
* The InclusiveStartTime
must be in ISO 8601
date and time format and in
* Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* The InclusiveStartTime
must be before ExclusiveEndTime
.
*
*
* If you provide an InclusiveStartTime
that is before the ledger's
* CreationDateTime
, Amazon QLDB defaults it to the ledger's CreationDateTime
.
*/
public final Instant inclusiveStartTime() {
return inclusiveStartTime;
}
/**
*
* The exclusive end date and time for the range of journal contents to export.
*
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in Universal
* Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* The ExclusiveEndTime
must be less than or equal to the current UTC date and time.
*
*
* @return The exclusive end date and time for the range of journal contents to export.
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in Universal
* Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* The ExclusiveEndTime
must be less than or equal to the current UTC date and time.
*/
public final Instant exclusiveEndTime() {
return exclusiveEndTime;
}
/**
*
* The configuration settings of the Amazon S3 bucket destination for your export request.
*
*
* @return The configuration settings of the Amazon S3 bucket destination for your export request.
*/
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 S3 bucket.
*
*
* -
*
* (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your
* exported data.
*
*
*
*
* To pass a role to QLDB when requesting a journal export, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal export requests.
*
*
* @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 S3 bucket.
*
*
* -
*
* (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of
* your exported data.
*
*
*
*
* To pass a role to QLDB when requesting a journal export, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal export
* requests.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* The output format of your exported journal data. A journal export job can write the data objects in either the
* text or binary representation of Amazon
* Ion format, or in JSON Lines text format.
*
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is delimited by a
* newline. You can use this format to directly integrate JSON exports with analytics tools such as Amazon Athena
* and Glue because these services can parse newline-delimited JSON automatically.
*
*
* 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 your exported journal data. A journal export job can write the data objects in
* either the text or binary representation of Amazon Ion format, or in JSON Lines text format.
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is
* delimited by a newline. You can use this format to directly integrate JSON exports with analytics tools
* such as Amazon Athena and Glue because these services can parse newline-delimited JSON automatically.
* @see OutputFormat
*/
public final OutputFormat outputFormat() {
return OutputFormat.fromValue(outputFormat);
}
/**
*
* The output format of your exported journal data. A journal export job can write the data objects in either the
* text or binary representation of Amazon
* Ion format, or in JSON Lines text format.
*
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is delimited by a
* newline. You can use this format to directly integrate JSON exports with analytics tools such as Amazon Athena
* and Glue because these services can parse newline-delimited JSON automatically.
*
*
* 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 your exported journal data. A journal export job can write the data objects in
* either the text or binary representation of Amazon Ion format, or in JSON Lines text format.
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is
* delimited by a newline. You can use this format to directly integrate JSON exports with analytics tools
* such as Amazon Athena and Glue because these services can parse newline-delimited JSON automatically.
* @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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(name());
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 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 ExportJournalToS3Request)) {
return false;
}
ExportJournalToS3Request other = (ExportJournalToS3Request) obj;
return Objects.equals(name(), other.name()) && 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("ExportJournalToS3Request").add("Name", name()).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 "Name":
return Optional.ofNullable(clazz.cast(name()));
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
*
* The InclusiveStartTime
must be in ISO 8601
date and time format and in
* Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* The InclusiveStartTime
must be before ExclusiveEndTime
.
*
*
* If you provide an InclusiveStartTime
that is before the ledger's
* CreationDateTime
, Amazon QLDB defaults it to the ledger's CreationDateTime
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inclusiveStartTime(Instant inclusiveStartTime);
/**
*
* The exclusive end date and time for the range of journal contents to export.
*
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in Universal
* Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* The ExclusiveEndTime
must be less than or equal to the current UTC date and time.
*
*
* @param exclusiveEndTime
* The exclusive end date and time for the range of journal contents to export.
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in
* Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* The ExclusiveEndTime
must be less than or equal to the current UTC date and time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder exclusiveEndTime(Instant exclusiveEndTime);
/**
*
* The configuration settings of the Amazon S3 bucket destination for your export request.
*
*
* @param s3ExportConfiguration
* The configuration settings of the Amazon S3 bucket destination for your export request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder s3ExportConfiguration(S3ExportConfiguration s3ExportConfiguration);
/**
*
* The configuration settings of the Amazon S3 bucket destination for your export request.
*
* This is a convenience method that creates an instance of the {@link S3ExportConfiguration.Builder} avoiding
* the need to create one manually via {@link S3ExportConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link S3ExportConfiguration.Builder#build()} is called immediately and
* its result is passed to {@link #s3ExportConfiguration(S3ExportConfiguration)}.
*
* @param s3ExportConfiguration
* a consumer that will call methods on {@link S3ExportConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #s3ExportConfiguration(S3ExportConfiguration)
*/
default Builder s3ExportConfiguration(Consumer s3ExportConfiguration) {
return s3ExportConfiguration(S3ExportConfiguration.builder().applyMutation(s3ExportConfiguration).build());
}
/**
*
* 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 S3 bucket.
*
*
* -
*
* (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your
* exported data.
*
*
*
*
* To pass a role to QLDB when requesting a journal export, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal export requests.
*
*
* @param roleArn
* 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 S3 bucket.
*
*
* -
*
* (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of
* your exported data.
*
*
*
*
* To pass a role to QLDB when requesting a journal export, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal export
* requests.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder roleArn(String roleArn);
/**
*
* The output format of your exported journal data. A journal export job can write the data objects in either
* the text or binary representation of Amazon Ion format, or in JSON Lines text format.
*
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is delimited
* by a newline. You can use this format to directly integrate JSON exports with analytics tools such as Amazon
* Athena and Glue because these services can parse newline-delimited JSON automatically.
*
*
* @param outputFormat
* The output format of your exported journal data. A journal export job can write the data objects in
* either the text or binary representation of Amazon Ion format, or in JSON Lines text format.
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is
* delimited by a newline. You can use this format to directly integrate JSON exports with analytics
* tools such as Amazon Athena and Glue because these services can parse newline-delimited JSON
* automatically.
* @see OutputFormat
* @return Returns a reference to this object so that method calls can be chained together.
* @see OutputFormat
*/
Builder outputFormat(String outputFormat);
/**
*
* The output format of your exported journal data. A journal export job can write the data objects in either
* the text or binary representation of Amazon Ion format, or in JSON Lines text format.
*
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is delimited
* by a newline. You can use this format to directly integrate JSON exports with analytics tools such as Amazon
* Athena and Glue because these services can parse newline-delimited JSON automatically.
*
*
* @param outputFormat
* The output format of your exported journal data. A journal export job can write the data objects in
* either the text or binary representation of Amazon Ion format, or in JSON Lines text format.
*
* Default: ION_TEXT
*
*
* In JSON Lines format, each journal block in an exported data object is a valid JSON object that is
* delimited by a newline. You can use this format to directly integrate JSON exports with analytics
* tools such as Amazon Athena and Glue because these services can parse newline-delimited JSON
* automatically.
* @see OutputFormat
* @return Returns a reference to this object so that method calls can be chained together.
* @see OutputFormat
*/
Builder outputFormat(OutputFormat outputFormat);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends QldbRequest.BuilderImpl implements Builder {
private String name;
private Instant inclusiveStartTime;
private Instant exclusiveEndTime;
private S3ExportConfiguration s3ExportConfiguration;
private String roleArn;
private String outputFormat;
private BuilderImpl() {
}
private BuilderImpl(ExportJournalToS3Request model) {
super(model);
name(model.name);
inclusiveStartTime(model.inclusiveStartTime);
exclusiveEndTime(model.exclusiveEndTime);
s3ExportConfiguration(model.s3ExportConfiguration);
roleArn(model.roleArn);
outputFormat(model.outputFormat);
}
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 Instant getInclusiveStartTime() {
return inclusiveStartTime;
}
public final void setInclusiveStartTime(Instant inclusiveStartTime) {
this.inclusiveStartTime = inclusiveStartTime;
}
@Override
public final Builder inclusiveStartTime(Instant inclusiveStartTime) {
this.inclusiveStartTime = inclusiveStartTime;
return this;
}
public final Instant getExclusiveEndTime() {
return exclusiveEndTime;
}
public final void setExclusiveEndTime(Instant exclusiveEndTime) {
this.exclusiveEndTime = exclusiveEndTime;
}
@Override
public final Builder exclusiveEndTime(Instant exclusiveEndTime) {
this.exclusiveEndTime = exclusiveEndTime;
return this;
}
public final S3ExportConfiguration.Builder getS3ExportConfiguration() {
return s3ExportConfiguration != null ? s3ExportConfiguration.toBuilder() : null;
}
public final void setS3ExportConfiguration(S3ExportConfiguration.BuilderImpl s3ExportConfiguration) {
this.s3ExportConfiguration = s3ExportConfiguration != null ? s3ExportConfiguration.build() : null;
}
@Override
public final Builder s3ExportConfiguration(S3ExportConfiguration s3ExportConfiguration) {
this.s3ExportConfiguration = s3ExportConfiguration;
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 getOutputFormat() {
return outputFormat;
}
public final void setOutputFormat(String outputFormat) {
this.outputFormat = outputFormat;
}
@Override
public final Builder outputFormat(String outputFormat) {
this.outputFormat = outputFormat;
return this;
}
@Override
public final Builder outputFormat(OutputFormat outputFormat) {
this.outputFormat(outputFormat == null ? null : outputFormat.toString());
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public ExportJournalToS3Request build() {
return new ExportJournalToS3Request(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}