Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.sns.model.PublishBatchRequestEntry 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.sns.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Contains the details of a single Amazon SNS message along with an Id
that identifies a message within
* the batch.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class PublishBatchRequestEntry implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id")
.getter(getter(PublishBatchRequestEntry::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build();
private static final SdkField MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Message")
.getter(getter(PublishBatchRequestEntry::message)).setter(setter(Builder::message))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Message").build()).build();
private static final SdkField SUBJECT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Subject")
.getter(getter(PublishBatchRequestEntry::subject)).setter(setter(Builder::subject))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Subject").build()).build();
private static final SdkField MESSAGE_STRUCTURE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MessageStructure").getter(getter(PublishBatchRequestEntry::messageStructure))
.setter(setter(Builder::messageStructure))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageStructure").build()).build();
private static final SdkField> MESSAGE_ATTRIBUTES_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("MessageAttributes")
.getter(getter(PublishBatchRequestEntry::messageAttributes))
.setter(setter(Builder::messageAttributes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageAttributes").build(),
MapTrait.builder()
.keyLocationName("Name")
.valueLocationName("Value")
.valueFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(MessageAttributeValue::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("Value").build()).build()).build()).build();
private static final SdkField MESSAGE_DEDUPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MessageDeduplicationId").getter(getter(PublishBatchRequestEntry::messageDeduplicationId))
.setter(setter(Builder::messageDeduplicationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageDeduplicationId").build())
.build();
private static final SdkField MESSAGE_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MessageGroupId").getter(getter(PublishBatchRequestEntry::messageGroupId))
.setter(setter(Builder::messageGroupId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageGroupId").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, MESSAGE_FIELD,
SUBJECT_FIELD, MESSAGE_STRUCTURE_FIELD, MESSAGE_ATTRIBUTES_FIELD, MESSAGE_DEDUPLICATION_ID_FIELD,
MESSAGE_GROUP_ID_FIELD));
private static final long serialVersionUID = 1L;
private final String id;
private final String message;
private final String subject;
private final String messageStructure;
private final Map messageAttributes;
private final String messageDeduplicationId;
private final String messageGroupId;
private PublishBatchRequestEntry(BuilderImpl builder) {
this.id = builder.id;
this.message = builder.message;
this.subject = builder.subject;
this.messageStructure = builder.messageStructure;
this.messageAttributes = builder.messageAttributes;
this.messageDeduplicationId = builder.messageDeduplicationId;
this.messageGroupId = builder.messageGroupId;
}
/**
*
* An identifier for the message in this batch.
*
*
*
* The Ids
of a batch request must be unique within a request.
*
*
* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric characters,
* hyphens(-), and underscores (_).
*
*
*
* @return An identifier for the message in this batch.
*
* The Ids
of a batch request must be unique within a request.
*
*
* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric
* characters, hyphens(-), and underscores (_).
*
*/
public final String id() {
return id;
}
/**
*
* The body of the message.
*
*
* @return The body of the message.
*/
public final String message() {
return message;
}
/**
*
* The subject of the batch message.
*
*
* @return The subject of the batch message.
*/
public final String subject() {
return subject;
}
/**
*
* Set MessageStructure
to json
if you want to send a different message for each protocol.
* For example, using one publish action, you can send a short message to your SMS subscribers and a longer message
* to your email subscribers. If you set MessageStructure
to json
, the value of the
* Message
parameter must:
*
*
*
* You can define other top-level keys that define the message you want to send to a specific transport protocol
* (e.g. http).
*
*
* @return Set MessageStructure
to json
if you want to send a different message for each
* protocol. For example, using one publish action, you can send a short message to your SMS subscribers and
* a longer message to your email subscribers. If you set MessageStructure
to json
* , the value of the Message
parameter must:
*
*
* You can define other top-level keys that define the message you want to send to a specific transport
* protocol (e.g. http).
*/
public final String messageStructure() {
return messageStructure;
}
/**
* For responses, this returns true if the service returned a value for the MessageAttributes 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 hasMessageAttributes() {
return messageAttributes != null && !(messageAttributes instanceof SdkAutoConstructMap);
}
/**
*
* Each message attribute consists of a Name
, Type
, and Value
. For more
* information, see Amazon SNS
* message attributes in the Amazon SNS Developer Guide.
*
*
* 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 #hasMessageAttributes} method.
*
*
* @return Each message attribute consists of a Name
, Type
, and Value
. For
* more information, see Amazon SNS message
* attributes in the Amazon SNS Developer Guide.
*/
public final Map messageAttributes() {
return messageAttributes;
}
/**
*
* This parameter applies only to FIFO (first-in-first-out) topics.
*
*
* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a message with
* a particular MessageDeduplicationId
is sent successfully, subsequent messages with the same
* MessageDeduplicationId
are accepted successfully but aren't delivered.
*
*
*
*
* Every message must have a unique MessageDeduplicationId
.
*
*
*
*
* You may provide a MessageDeduplicationId
explicitly.
*
*
*
*
* If you aren't able to provide a MessageDeduplicationId
and you enable
* ContentBasedDeduplication
for your topic, Amazon SNS uses a SHA-256 hash to generate the
* MessageDeduplicationId
using the body of the message (but not the attributes of the message).
*
*
*
*
* If you don't provide a MessageDeduplicationId
and the topic doesn't have
* ContentBasedDeduplication
set, the action fails with an error.
*
*
*
*
* If the topic has a ContentBasedDeduplication
set, your MessageDeduplicationId
overrides
* the generated one.
*
*
*
*
*
*
* When ContentBasedDeduplication
is in effect, messages with identical content sent within the
* deduplication interval are treated as duplicates and only one copy of the message is delivered.
*
*
*
*
* If you send one message with ContentBasedDeduplication
enabled, and then another message with a
* MessageDeduplicationId
that is the same as the one generated for the first
* MessageDeduplicationId
, the two messages are treated as duplicates and only one copy of the message
* is delivered.
*
*
*
*
*
* The MessageDeduplicationId
is available to the consumer of the message (this can be useful for
* troubleshooting delivery issues).
*
*
* If a message is sent successfully but the acknowledgement is lost and the message is resent with the same
* MessageDeduplicationId
after the deduplication interval, Amazon SNS can't detect duplicate messages.
*
*
* Amazon SNS continues to keep track of the message deduplication ID even after the message is received and
* deleted.
*
*
*
* The length of MessageDeduplicationId
is 128 characters.
*
*
* MessageDeduplicationId
can contain alphanumeric characters (a-z, A-Z, 0-9)
and
* punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
*
*
* @return This parameter applies only to FIFO (first-in-first-out) topics.
*
* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a
* message with a particular MessageDeduplicationId
is sent successfully, subsequent messages
* with the same MessageDeduplicationId
are accepted successfully but aren't delivered.
*
*
*
*
* Every message must have a unique MessageDeduplicationId
.
*
*
*
*
* You may provide a MessageDeduplicationId
explicitly.
*
*
*
*
* If you aren't able to provide a MessageDeduplicationId
and you enable
* ContentBasedDeduplication
for your topic, Amazon SNS uses a SHA-256 hash to generate the
* MessageDeduplicationId
using the body of the message (but not the attributes of the
* message).
*
*
*
*
* If you don't provide a MessageDeduplicationId
and the topic doesn't have
* ContentBasedDeduplication
set, the action fails with an error.
*
*
*
*
* If the topic has a ContentBasedDeduplication
set, your MessageDeduplicationId
* overrides the generated one.
*
*
*
*
*
*
* When ContentBasedDeduplication
is in effect, messages with identical content sent within the
* deduplication interval are treated as duplicates and only one copy of the message is delivered.
*
*
*
*
* If you send one message with ContentBasedDeduplication
enabled, and then another message
* with a MessageDeduplicationId
that is the same as the one generated for the first
* MessageDeduplicationId
, the two messages are treated as duplicates and only one copy of the
* message is delivered.
*
*
*
*
*
* The MessageDeduplicationId
is available to the consumer of the message (this can be useful
* for troubleshooting delivery issues).
*
*
* If a message is sent successfully but the acknowledgement is lost and the message is resent with the same
* MessageDeduplicationId
after the deduplication interval, Amazon SNS can't detect duplicate
* messages.
*
*
* Amazon SNS continues to keep track of the message deduplication ID even after the message is received and
* deleted.
*
*
*
* The length of MessageDeduplicationId
is 128 characters.
*
*
* MessageDeduplicationId
can contain alphanumeric characters (a-z, A-Z, 0-9)
and
* punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
*/
public final String messageDeduplicationId() {
return messageDeduplicationId;
}
/**
*
* This parameter applies only to FIFO (first-in-first-out) topics.
*
*
* The tag that specifies that a message belongs to a specific message group. Messages that belong to the same
* message group are processed in a FIFO manner (however, messages in different message groups might be processed
* out of order). To interleave multiple ordered streams within a single topic, use MessageGroupId
* values (for example, session data for multiple users). In this scenario, multiple consumers can process the
* topic, but the session data of each user is processed in a FIFO fashion.
*
*
* You must associate a non-empty MessageGroupId
with a message. If you don't provide a
* MessageGroupId
, the action fails.
*
*
* The length of MessageGroupId
is 128 characters.
*
*
* MessageGroupId
can contain alphanumeric characters (a-z, A-Z, 0-9)
and punctuation
* (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
*
*
*
* MessageGroupId
is required for FIFO topics. You can't use it for standard topics.
*
*
*
* @return This parameter applies only to FIFO (first-in-first-out) topics.
*
* The tag that specifies that a message belongs to a specific message group. Messages that belong to the
* same message group are processed in a FIFO manner (however, messages in different message groups might be
* processed out of order). To interleave multiple ordered streams within a single topic, use
* MessageGroupId
values (for example, session data for multiple users). In this scenario,
* multiple consumers can process the topic, but the session data of each user is processed in a FIFO
* fashion.
*
*
* You must associate a non-empty MessageGroupId
with a message. If you don't provide a
* MessageGroupId
, the action fails.
*
*
* The length of MessageGroupId
is 128 characters.
*
*
* MessageGroupId
can contain alphanumeric characters (a-z, A-Z, 0-9)
and
* punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
*
*
*
* MessageGroupId
is required for FIFO topics. You can't use it for standard topics.
*
*/
public final String messageGroupId() {
return messageGroupId;
}
@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(id());
hashCode = 31 * hashCode + Objects.hashCode(message());
hashCode = 31 * hashCode + Objects.hashCode(subject());
hashCode = 31 * hashCode + Objects.hashCode(messageStructure());
hashCode = 31 * hashCode + Objects.hashCode(hasMessageAttributes() ? messageAttributes() : null);
hashCode = 31 * hashCode + Objects.hashCode(messageDeduplicationId());
hashCode = 31 * hashCode + Objects.hashCode(messageGroupId());
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 PublishBatchRequestEntry)) {
return false;
}
PublishBatchRequestEntry other = (PublishBatchRequestEntry) obj;
return Objects.equals(id(), other.id()) && Objects.equals(message(), other.message())
&& Objects.equals(subject(), other.subject()) && Objects.equals(messageStructure(), other.messageStructure())
&& hasMessageAttributes() == other.hasMessageAttributes()
&& Objects.equals(messageAttributes(), other.messageAttributes())
&& Objects.equals(messageDeduplicationId(), other.messageDeduplicationId())
&& Objects.equals(messageGroupId(), other.messageGroupId());
}
/**
* 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("PublishBatchRequestEntry").add("Id", id()).add("Message", message()).add("Subject", subject())
.add("MessageStructure", messageStructure())
.add("MessageAttributes", hasMessageAttributes() ? messageAttributes() : null)
.add("MessageDeduplicationId", messageDeduplicationId()).add("MessageGroupId", messageGroupId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "Message":
return Optional.ofNullable(clazz.cast(message()));
case "Subject":
return Optional.ofNullable(clazz.cast(subject()));
case "MessageStructure":
return Optional.ofNullable(clazz.cast(messageStructure()));
case "MessageAttributes":
return Optional.ofNullable(clazz.cast(messageAttributes()));
case "MessageDeduplicationId":
return Optional.ofNullable(clazz.cast(messageDeduplicationId()));
case "MessageGroupId":
return Optional.ofNullable(clazz.cast(messageGroupId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((PublishBatchRequestEntry) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* An identifier for the message in this batch.
*
*
*
* The Ids
of a batch request must be unique within a request.
*
*
* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric characters,
* hyphens(-), and underscores (_).
*
*
*
* @param id
* An identifier for the message in this batch.
*
* The Ids
of a batch request must be unique within a request.
*
*
* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric
* characters, hyphens(-), and underscores (_).
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder id(String id);
/**
*
* The body of the message.
*
*
* @param message
* The body of the message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder message(String message);
/**
*
* The subject of the batch message.
*
*
* @param subject
* The subject of the batch message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subject(String subject);
/**
*
* Set MessageStructure
to json
if you want to send a different message for each
* protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a
* longer message to your email subscribers. If you set MessageStructure
to json
, the
* value of the Message
parameter must:
*
*
*
* You can define other top-level keys that define the message you want to send to a specific transport protocol
* (e.g. http).
*
*
* @param messageStructure
* Set MessageStructure
to json
if you want to send a different message for
* each protocol. For example, using one publish action, you can send a short message to your SMS
* subscribers and a longer message to your email subscribers. If you set MessageStructure
* to json
, the value of the Message
parameter must:
*
*
* You can define other top-level keys that define the message you want to send to a specific transport
* protocol (e.g. http).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder messageStructure(String messageStructure);
/**
*
* Each message attribute consists of a Name
, Type
, and Value
. For more
* information, see Amazon SNS
* message attributes in the Amazon SNS Developer Guide.
*
*
* @param messageAttributes
* Each message attribute consists of a Name
, Type
, and Value
. For
* more information, see Amazon SNS message
* attributes in the Amazon SNS Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder messageAttributes(Map messageAttributes);
/**
*
* This parameter applies only to FIFO (first-in-first-out) topics.
*
*
* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a message
* with a particular MessageDeduplicationId
is sent successfully, subsequent messages with the same
* MessageDeduplicationId
are accepted successfully but aren't delivered.
*
*
*
*
* Every message must have a unique MessageDeduplicationId
.
*
*
*
*
* You may provide a MessageDeduplicationId
explicitly.
*
*
*
*
* If you aren't able to provide a MessageDeduplicationId
and you enable
* ContentBasedDeduplication
for your topic, Amazon SNS uses a SHA-256 hash to generate the
* MessageDeduplicationId
using the body of the message (but not the attributes of the message).
*
*
*
*
* If you don't provide a MessageDeduplicationId
and the topic doesn't have
* ContentBasedDeduplication
set, the action fails with an error.
*
*
*
*
* If the topic has a ContentBasedDeduplication
set, your MessageDeduplicationId
* overrides the generated one.
*
*
*
*
*
*
* When ContentBasedDeduplication
is in effect, messages with identical content sent within the
* deduplication interval are treated as duplicates and only one copy of the message is delivered.
*
*
*
*
* If you send one message with ContentBasedDeduplication
enabled, and then another message with a
* MessageDeduplicationId
that is the same as the one generated for the first
* MessageDeduplicationId
, the two messages are treated as duplicates and only one copy of the
* message is delivered.
*
*
*
*
*
* The MessageDeduplicationId
is available to the consumer of the message (this can be useful for
* troubleshooting delivery issues).
*
*
* If a message is sent successfully but the acknowledgement is lost and the message is resent with the same
* MessageDeduplicationId
after the deduplication interval, Amazon SNS can't detect duplicate
* messages.
*
*
* Amazon SNS continues to keep track of the message deduplication ID even after the message is received and
* deleted.
*
*
*
* The length of MessageDeduplicationId
is 128 characters.
*
*
* MessageDeduplicationId
can contain alphanumeric characters (a-z, A-Z, 0-9)
and
* punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
*
*
* @param messageDeduplicationId
* This parameter applies only to FIFO (first-in-first-out) topics.
*
* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a
* message with a particular MessageDeduplicationId
is sent successfully, subsequent
* messages with the same MessageDeduplicationId
are accepted successfully but aren't
* delivered.
*
*
*
*
* Every message must have a unique MessageDeduplicationId
.
*
*
*
*
* You may provide a MessageDeduplicationId
explicitly.
*
*
*
*
* If you aren't able to provide a MessageDeduplicationId
and you enable
* ContentBasedDeduplication
for your topic, Amazon SNS uses a SHA-256 hash to generate the
* MessageDeduplicationId
using the body of the message (but not the attributes of the
* message).
*
*
*
*
* If you don't provide a MessageDeduplicationId
and the topic doesn't have
* ContentBasedDeduplication
set, the action fails with an error.
*
*
*
*
* If the topic has a ContentBasedDeduplication
set, your
* MessageDeduplicationId
overrides the generated one.
*
*
*
*
*
*
* When ContentBasedDeduplication
is in effect, messages with identical content sent within
* the deduplication interval are treated as duplicates and only one copy of the message is delivered.
*
*
*
*
* If you send one message with ContentBasedDeduplication
enabled, and then another message
* with a MessageDeduplicationId
that is the same as the one generated for the first
* MessageDeduplicationId
, the two messages are treated as duplicates and only one copy of
* the message is delivered.
*
*
*
*
*
* The MessageDeduplicationId
is available to the consumer of the message (this can be
* useful for troubleshooting delivery issues).
*
*
* If a message is sent successfully but the acknowledgement is lost and the message is resent with the
* same MessageDeduplicationId
after the deduplication interval, Amazon SNS can't detect
* duplicate messages.
*
*
* Amazon SNS continues to keep track of the message deduplication ID even after the message is received
* and deleted.
*
*
*
* The length of MessageDeduplicationId
is 128 characters.
*
*
* MessageDeduplicationId
can contain alphanumeric characters (a-z, A-Z, 0-9)
* and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder messageDeduplicationId(String messageDeduplicationId);
/**
*
* This parameter applies only to FIFO (first-in-first-out) topics.
*
*
* The tag that specifies that a message belongs to a specific message group. Messages that belong to the same
* message group are processed in a FIFO manner (however, messages in different message groups might be
* processed out of order). To interleave multiple ordered streams within a single topic, use
* MessageGroupId
values (for example, session data for multiple users). In this scenario, multiple
* consumers can process the topic, but the session data of each user is processed in a FIFO fashion.
*
*
* You must associate a non-empty MessageGroupId
with a message. If you don't provide a
* MessageGroupId
, the action fails.
*
*
* The length of MessageGroupId
is 128 characters.
*
*
* MessageGroupId
can contain alphanumeric characters (a-z, A-Z, 0-9)
and punctuation
* (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
*
*
*
* MessageGroupId
is required for FIFO topics. You can't use it for standard topics.
*
*
*
* @param messageGroupId
* This parameter applies only to FIFO (first-in-first-out) topics.
*
* The tag that specifies that a message belongs to a specific message group. Messages that belong to the
* same message group are processed in a FIFO manner (however, messages in different message groups might
* be processed out of order). To interleave multiple ordered streams within a single topic, use
* MessageGroupId
values (for example, session data for multiple users). In this scenario,
* multiple consumers can process the topic, but the session data of each user is processed in a FIFO
* fashion.
*
*
* You must associate a non-empty MessageGroupId
with a message. If you don't provide a
* MessageGroupId
, the action fails.
*
*
* The length of MessageGroupId
is 128 characters.
*
*
* MessageGroupId
can contain alphanumeric characters (a-z, A-Z, 0-9)
and
* punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)
.
*
*
*
* MessageGroupId
is required for FIFO topics. You can't use it for standard topics.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder messageGroupId(String messageGroupId);
}
static final class BuilderImpl implements Builder {
private String id;
private String message;
private String subject;
private String messageStructure;
private Map messageAttributes = DefaultSdkAutoConstructMap.getInstance();
private String messageDeduplicationId;
private String messageGroupId;
private BuilderImpl() {
}
private BuilderImpl(PublishBatchRequestEntry model) {
id(model.id);
message(model.message);
subject(model.subject);
messageStructure(model.messageStructure);
messageAttributes(model.messageAttributes);
messageDeduplicationId(model.messageDeduplicationId);
messageGroupId(model.messageGroupId);
}
public final String getId() {
return id;
}
public final void setId(String id) {
this.id = id;
}
@Override
public final Builder id(String id) {
this.id = id;
return this;
}
public final String getMessage() {
return message;
}
public final void setMessage(String message) {
this.message = message;
}
@Override
public final Builder message(String message) {
this.message = message;
return this;
}
public final String getSubject() {
return subject;
}
public final void setSubject(String subject) {
this.subject = subject;
}
@Override
public final Builder subject(String subject) {
this.subject = subject;
return this;
}
public final String getMessageStructure() {
return messageStructure;
}
public final void setMessageStructure(String messageStructure) {
this.messageStructure = messageStructure;
}
@Override
public final Builder messageStructure(String messageStructure) {
this.messageStructure = messageStructure;
return this;
}
public final Map getMessageAttributes() {
Map result = MessageAttributeMapCopier.copyToBuilder(this.messageAttributes);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMessageAttributes(Map messageAttributes) {
this.messageAttributes = MessageAttributeMapCopier.copyFromBuilder(messageAttributes);
}
@Override
public final Builder messageAttributes(Map messageAttributes) {
this.messageAttributes = MessageAttributeMapCopier.copy(messageAttributes);
return this;
}
public final String getMessageDeduplicationId() {
return messageDeduplicationId;
}
public final void setMessageDeduplicationId(String messageDeduplicationId) {
this.messageDeduplicationId = messageDeduplicationId;
}
@Override
public final Builder messageDeduplicationId(String messageDeduplicationId) {
this.messageDeduplicationId = messageDeduplicationId;
return this;
}
public final String getMessageGroupId() {
return messageGroupId;
}
public final void setMessageGroupId(String messageGroupId) {
this.messageGroupId = messageGroupId;
}
@Override
public final Builder messageGroupId(String messageGroupId) {
this.messageGroupId = messageGroupId;
return this;
}
@Override
public PublishBatchRequestEntry build() {
return new PublishBatchRequestEntry(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}