* The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data
* records to a Kinesis Data Streams resource.
*
*
* To pass a role to QLDB when requesting a journal stream, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal stream requests.
*
*
* @return The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write
* data records to a Kinesis Data Streams resource.
*
* To pass a role to QLDB when requesting a journal stream, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal stream
* requests.
*/
public final String roleArn() {
return roleArn;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* The key-value pairs to add as tags to the stream that you want to create. Tag keys are case sensitive. Tag values
* are case sensitive and can be null.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return The key-value pairs to add as tags to the stream that you want to create. Tag keys are case sensitive.
* Tag values are case sensitive and can be null.
*/
public final Map tags() {
return tags;
}
/**
*
* The inclusive start date and time from which to start streaming journal data. This parameter must be in
* ISO 8601
date and time format and in Universal Coordinated Time (UTC). For example:
* 2019-06-13T21:36:34Z
.
*
*
* The InclusiveStartTime
cannot be in the future and must be before ExclusiveEndTime
.
*
*
* If you provide an InclusiveStartTime
that is before the ledger's CreationDateTime
, QLDB
* effectively defaults it to the ledger's CreationDateTime
.
*
*
* @return The inclusive start date and time from which to start streaming journal data. This parameter must be in
* ISO 8601
date and time format and in Universal Coordinated Time (UTC). For example:
* 2019-06-13T21:36:34Z
.
*
* The InclusiveStartTime
cannot be in the future and must be before
* ExclusiveEndTime
.
*
*
* If you provide an InclusiveStartTime
that is before the ledger's
* CreationDateTime
, QLDB effectively defaults it to the ledger's CreationDateTime
.
*/
public final Instant inclusiveStartTime() {
return inclusiveStartTime;
}
/**
*
* The exclusive date and time that specifies when the stream ends. If you don't define this parameter, the stream
* runs indefinitely until you cancel it.
*
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in Universal
* Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* @return The exclusive date and time that specifies when the stream ends. If you don't define this parameter, the
* stream runs indefinitely until you cancel it.
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in Universal
* Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*/
public final Instant exclusiveEndTime() {
return exclusiveEndTime;
}
/**
*
* The configuration settings of the Kinesis Data Streams destination for your stream request.
*
*
* @return The configuration settings of the Kinesis Data Streams destination for your stream request.
*/
public final KinesisConfiguration kinesisConfiguration() {
return kinesisConfiguration;
}
/**
*
* The name that you want to assign to the QLDB journal stream. User-defined names can help identify and indicate
* the purpose of a stream.
*
*
* Your stream name must be unique among other active streams for a given ledger. Stream names have the same
* naming constraints as ledger names, as defined in Quotas in Amazon QLDB
* in the Amazon QLDB Developer Guide .
*
*
* @return The name that you want to assign to the QLDB journal stream. User-defined names can help identify and
* indicate the purpose of a stream.
*
* Your stream name must be unique among other active streams for a given ledger. Stream names have
* the same naming constraints as ledger names, as defined in Quotas in Amazon
* QLDB in the Amazon QLDB Developer Guide .
*/
public final String streamName() {
return streamName;
}
@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(ledgerName());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(inclusiveStartTime());
hashCode = 31 * hashCode + Objects.hashCode(exclusiveEndTime());
hashCode = 31 * hashCode + Objects.hashCode(kinesisConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(streamName());
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 StreamJournalToKinesisRequest)) {
return false;
}
StreamJournalToKinesisRequest other = (StreamJournalToKinesisRequest) obj;
return Objects.equals(ledgerName(), other.ledgerName()) && Objects.equals(roleArn(), other.roleArn())
&& hasTags() == other.hasTags() && Objects.equals(tags(), other.tags())
&& Objects.equals(inclusiveStartTime(), other.inclusiveStartTime())
&& Objects.equals(exclusiveEndTime(), other.exclusiveEndTime())
&& Objects.equals(kinesisConfiguration(), other.kinesisConfiguration())
&& Objects.equals(streamName(), other.streamName());
}
/**
* 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("StreamJournalToKinesisRequest").add("LedgerName", ledgerName()).add("RoleArn", roleArn())
.add("Tags", hasTags() ? tags() : null).add("InclusiveStartTime", inclusiveStartTime())
.add("ExclusiveEndTime", exclusiveEndTime()).add("KinesisConfiguration", kinesisConfiguration())
.add("StreamName", streamName()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "LedgerName":
return Optional.ofNullable(clazz.cast(ledgerName()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "InclusiveStartTime":
return Optional.ofNullable(clazz.cast(inclusiveStartTime()));
case "ExclusiveEndTime":
return Optional.ofNullable(clazz.cast(exclusiveEndTime()));
case "KinesisConfiguration":
return Optional.ofNullable(clazz.cast(kinesisConfiguration()));
case "StreamName":
return Optional.ofNullable(clazz.cast(streamName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((StreamJournalToKinesisRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends QldbRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The name of the ledger.
*
*
* @param ledgerName
* The name of the ledger.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder ledgerName(String ledgerName);
/**
*
* The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write
* data records to a Kinesis Data Streams resource.
*
*
* To pass a role to QLDB when requesting a journal stream, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal stream requests.
*
*
* @param roleArn
* The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to
* write data records to a Kinesis Data Streams resource.
*
* To pass a role to QLDB when requesting a journal stream, you must have permissions to perform the
* iam:PassRole
action on the IAM role resource. This is required for all journal stream
* requests.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder roleArn(String roleArn);
/**
*
* The key-value pairs to add as tags to the stream that you want to create. Tag keys are case sensitive. Tag
* values are case sensitive and can be null.
*
*
* @param tags
* The key-value pairs to add as tags to the stream that you want to create. Tag keys are case sensitive.
* Tag values are case sensitive and can be null.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
/**
*
* The inclusive start date and time from which to start streaming journal data. This parameter must be in
* ISO 8601
date and time format and in Universal Coordinated Time (UTC). For example:
* 2019-06-13T21:36:34Z
.
*
*
* The InclusiveStartTime
cannot be in the future and must be before ExclusiveEndTime
.
*
*
* If you provide an InclusiveStartTime
that is before the ledger's CreationDateTime
,
* QLDB effectively defaults it to the ledger's CreationDateTime
.
*
*
* @param inclusiveStartTime
* The inclusive start date and time from which to start streaming journal data. This parameter must be
* in ISO 8601
date and time format and in Universal Coordinated Time (UTC). For example:
* 2019-06-13T21:36:34Z
.
*
* The InclusiveStartTime
cannot be in the future and must be before
* ExclusiveEndTime
.
*
*
* If you provide an InclusiveStartTime
that is before the ledger's
* CreationDateTime
, QLDB effectively 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 date and time that specifies when the stream ends. If you don't define this parameter, the
* stream runs indefinitely until you cancel it.
*
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in Universal
* Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
*
*
* @param exclusiveEndTime
* The exclusive date and time that specifies when the stream ends. If you don't define this parameter,
* the stream runs indefinitely until you cancel it.
*
* The ExclusiveEndTime
must be in ISO 8601
date and time format and in
* Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder exclusiveEndTime(Instant exclusiveEndTime);
/**
*
* The configuration settings of the Kinesis Data Streams destination for your stream request.
*
*
* @param kinesisConfiguration
* The configuration settings of the Kinesis Data Streams destination for your stream request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder kinesisConfiguration(KinesisConfiguration kinesisConfiguration);
/**
*
* The configuration settings of the Kinesis Data Streams destination for your stream request.
*
* This is a convenience method that creates an instance of the {@link KinesisConfiguration.Builder} avoiding
* the need to create one manually via {@link KinesisConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link KinesisConfiguration.Builder#build()} is called immediately and
* its result is passed to {@link #kinesisConfiguration(KinesisConfiguration)}.
*
* @param kinesisConfiguration
* a consumer that will call methods on {@link KinesisConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #kinesisConfiguration(KinesisConfiguration)
*/
default Builder kinesisConfiguration(Consumer kinesisConfiguration) {
return kinesisConfiguration(KinesisConfiguration.builder().applyMutation(kinesisConfiguration).build());
}
/**
*
* The name that you want to assign to the QLDB journal stream. User-defined names can help identify and
* indicate the purpose of a stream.
*
*
* Your stream name must be unique among other active streams for a given ledger. Stream names have the
* same naming constraints as ledger names, as defined in Quotas in Amazon
* QLDB in the Amazon QLDB Developer Guide .
*
*
* @param streamName
* The name that you want to assign to the QLDB journal stream. User-defined names can help identify and
* indicate the purpose of a stream.
*
* Your stream name must be unique among other active streams for a given ledger. Stream names
* have the same naming constraints as ledger names, as defined in Quotas in
* Amazon QLDB in the Amazon QLDB Developer Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder streamName(String streamName);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends QldbRequest.BuilderImpl implements Builder {
private String ledgerName;
private String roleArn;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private Instant inclusiveStartTime;
private Instant exclusiveEndTime;
private KinesisConfiguration kinesisConfiguration;
private String streamName;
private BuilderImpl() {
}
private BuilderImpl(StreamJournalToKinesisRequest model) {
super(model);
ledgerName(model.ledgerName);
roleArn(model.roleArn);
tags(model.tags);
inclusiveStartTime(model.inclusiveStartTime);
exclusiveEndTime(model.exclusiveEndTime);
kinesisConfiguration(model.kinesisConfiguration);
streamName(model.streamName);
}
public final String getLedgerName() {
return ledgerName;
}
public final void setLedgerName(String ledgerName) {
this.ledgerName = ledgerName;
}
@Override
public final Builder ledgerName(String ledgerName) {
this.ledgerName = ledgerName;
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 Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagsCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagsCopier.copy(tags);
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 KinesisConfiguration.Builder getKinesisConfiguration() {
return kinesisConfiguration != null ? kinesisConfiguration.toBuilder() : null;
}
public final void setKinesisConfiguration(KinesisConfiguration.BuilderImpl kinesisConfiguration) {
this.kinesisConfiguration = kinesisConfiguration != null ? kinesisConfiguration.build() : null;
}
@Override
public final Builder kinesisConfiguration(KinesisConfiguration kinesisConfiguration) {
this.kinesisConfiguration = kinesisConfiguration;
return this;
}
public final String getStreamName() {
return streamName;
}
public final void setStreamName(String streamName) {
this.streamName = streamName;
}
@Override
public final Builder streamName(String streamName) {
this.streamName = streamName;
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 StreamJournalToKinesisRequest build() {
return new StreamJournalToKinesisRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}