@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:15.766Z") @Stability(value=Experimental) public enum MessageAttributeDataType extends Enum<MessageAttributeDataType>
Example:
Topic topic = new Topic(this, "Topic");
// Use a field from the execution data as message.
SnsPublish task1 = SnsPublish.Builder.create(this, "Publish1")
.topic(topic)
.integrationPattern(IntegrationPattern.REQUEST_RESPONSE)
.message(TaskInput.fromDataAt("$.state.message"))
.messageAttributes(Map.of(
"place", MessageAttribute.builder()
.value(JsonPath.stringAt("$.place"))
.build(),
"pic", MessageAttribute.builder()
// BINARY must be explicitly set
.dataType(MessageAttributeDataType.BINARY)
.value(JsonPath.stringAt("$.pic"))
.build(),
"people", MessageAttribute.builder()
.value(4)
.build(),
"handles", MessageAttribute.builder()
.value(List.of("@kslater", "@jjf", null, "@mfanning"))
.build()))
.build();
// Combine a field from the execution data with
// a literal object.
SnsPublish task2 = SnsPublish.Builder.create(this, "Publish2")
.topic(topic)
.message(TaskInput.fromObject(Map.of(
"field1", "somedata",
"field2", JsonPath.stringAt("$.field2"))))
.build();
https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes| Enum Constant and Description |
|---|
BINARY
(experimental) Binary type attributes can store any binary data.
|
NUMBER
(experimental) Numbers are positive or negative integers or floating-point numbers.
|
STRING
(experimental) Strings are Unicode with UTF-8 binary encoding.
|
STRING_ARRAY
(experimental) An array, formatted as a string.
|
| Modifier and Type | Method and Description |
|---|---|
static MessageAttributeDataType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MessageAttributeDataType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Experimental) public static final MessageAttributeDataType STRING
@Stability(value=Experimental) public static final MessageAttributeDataType STRING_ARRAY
https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes@Stability(value=Experimental) public static final MessageAttributeDataType NUMBER
https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes@Stability(value=Experimental) public static final MessageAttributeDataType BINARY
https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypespublic static MessageAttributeDataType[] values()
for (MessageAttributeDataType c : MessageAttributeDataType.values()) System.out.println(c);
public static MessageAttributeDataType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.