
software.amazon.awssdk.services.qldb.model.ExportJournalToS3Request Maven / Gradle / Ivy
/*
* Copyright 2015-2020 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)
.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)
.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)
.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)
.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)
.getter(getter(ExportJournalToS3Request::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").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));
private final String name;
private final Instant inclusiveStartTime;
private final Instant exclusiveEndTime;
private final S3ExportConfiguration s3ExportConfiguration;
private final String roleArn;
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;
}
/**
*
* The name of the ledger.
*
*
* @return The name of the ledger.
*/
public String name() {
return name;
}
/**
*
* The inclusive start date and time for the range of journal contents that you want 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 that you want 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 Instant inclusiveStartTime() {
return inclusiveStartTime;
}
/**
*
* The exclusive end date and time for the range of journal contents that you want 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 that you want 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 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 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 master key (CMK) in AWS Key Management Service (AWS 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 master key (CMK) in AWS Key Management Service (AWS KMS) for server-side
* encryption of your exported data.
*
*
*/
public String roleArn() {
return roleArn;
}
@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 + 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());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public 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());
}
/**
* 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("ExportJournalToS3Request").add("Name", name()).add("InclusiveStartTime", inclusiveStartTime())
.add("ExclusiveEndTime", exclusiveEndTime()).add("S3ExportConfiguration", s3ExportConfiguration())
.add("RoleArn", roleArn()).build();
}
public 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()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function