@@ -42,21 +42,22 @@ class SnsMessage implements Message
42
42
*/
43
43
private $ targetArn ;
44
44
45
+ /**
46
+ * @var string|null
47
+ */
48
+ private $ messageGroupId ;
49
+
50
+ /**
51
+ * @var string|null
52
+ */
53
+ private $ messageDeduplicationId ;
54
+
45
55
/**
46
56
* SnsMessage constructor.
47
57
*
48
58
* See AWS documentation for message attribute structure.
49
59
*
50
60
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sns-2010-03-31.html#shape-messageattributevalue
51
- *
52
- * @param string $body
53
- * @param array $properties
54
- * @param array $headers
55
- * @param array|null $messageAttributes
56
- * @param string|null $messageStructure
57
- * @param string|null $phoneNumber
58
- * @param string|null $subject
59
- * @param string|null $targetArn
60
61
*/
61
62
public function __construct (
62
63
string $ body = '' ,
@@ -79,89 +80,58 @@ public function __construct(
79
80
$ this ->redelivered = false ;
80
81
}
81
82
82
- /**
83
- * @return string|null
84
- */
85
83
public function getSnsMessageId (): ?string
86
84
{
87
85
return $ this ->snsMessageId ;
88
86
}
89
87
90
- /**
91
- * @param string|null $snsMessageId
92
- */
93
88
public function setSnsMessageId (?string $ snsMessageId ): void
94
89
{
95
90
$ this ->snsMessageId = $ snsMessageId ;
96
91
}
97
92
98
- /**
99
- * @return string|null
100
- */
101
93
public function getMessageStructure (): ?string
102
94
{
103
95
return $ this ->messageStructure ;
104
96
}
105
97
106
- /**
107
- * @param string|null $messageStructure
108
- */
109
98
public function setMessageStructure (?string $ messageStructure ): void
110
99
{
111
100
$ this ->messageStructure = $ messageStructure ;
112
101
}
113
102
114
- /**
115
- * @return string|null
116
- */
117
103
public function getPhoneNumber (): ?string
118
104
{
119
105
return $ this ->phoneNumber ;
120
106
}
121
107
122
- /**
123
- * @param string|null $phoneNumber
124
- */
125
108
public function setPhoneNumber (?string $ phoneNumber ): void
126
109
{
127
110
$ this ->phoneNumber = $ phoneNumber ;
128
111
}
129
112
130
- /**
131
- * @return string|null
132
- */
133
113
public function getSubject (): ?string
134
114
{
135
115
return $ this ->subject ;
136
116
}
137
117
138
- /**
139
- * @param string|null $subject
140
- */
141
118
public function setSubject (?string $ subject ): void
142
119
{
143
120
$ this ->subject = $ subject ;
144
121
}
145
122
146
- /**
147
- * @return array|null
148
- */
149
123
public function getMessageAttributes (): ?array
150
124
{
151
125
return $ this ->messageAttributes ;
152
126
}
153
127
154
- /**
155
- * @param array|null $messageAttributes
156
- */
157
128
public function setMessageAttributes (?array $ messageAttributes ): void
158
129
{
159
130
$ this ->messageAttributes = $ messageAttributes ;
160
131
}
161
132
162
133
/**
163
- * @param string $name
164
- * @param null $default
134
+ * @param null $default
165
135
*
166
136
* @return array|null
167
137
*/
@@ -177,9 +147,6 @@ public function getAttribute(string $name, $default = null)
177
147
* 'DataType' => '<string>', // REQUIRED
178
148
* 'StringValue' => '<string>',
179
149
* ].
180
- *
181
- * @param string $name
182
- * @param array|null $attribute
183
150
*/
184
151
public function setAttribute (string $ name , ?array $ attribute ): void
185
152
{
@@ -191,7 +158,6 @@ public function setAttribute(string $name, ?array $attribute): void
191
158
}
192
159
193
160
/**
194
- * @param string $name
195
161
* @param string $dataType String, String.Array, Number, or Binary
196
162
* @param string|resource|StreamInterface $value
197
163
*/
@@ -205,19 +171,52 @@ public function addAttribute(string $name, string $dataType, $value): void
205
171
];
206
172
}
207
173
208
- /**
209
- * @return string|null
210
- */
211
174
public function getTargetArn (): ?string
212
175
{
213
176
return $ this ->targetArn ;
214
177
}
215
178
216
- /**
217
- * @param string|null $targetArn
218
- */
219
179
public function setTargetArn (?string $ targetArn ): void
220
180
{
221
181
$ this ->targetArn = $ targetArn ;
222
182
}
183
+
184
+ /**
185
+ * Only FIFO.
186
+ *
187
+ * The tag that specifies that a message belongs to a specific message group. Messages that belong to the same
188
+ * message group are processed in a FIFO manner (however, messages in different message groups might be processed
189
+ * out of order).
190
+ * To interleave multiple ordered streams within a single queue, use MessageGroupId values (for example, session
191
+ * data for multiple users). In this scenario, multiple readers can process the queue, but the session data
192
+ * of each user is processed in a FIFO fashion.
193
+ * For more information, see: https://docs.aws.amazon.com/sns/latest/dg/fifo-message-grouping.html
194
+ */
195
+ public function setMessageGroupId (string $ id = null ): void
196
+ {
197
+ $ this ->messageGroupId = $ id ;
198
+ }
199
+
200
+ public function getMessageGroupId (): ?string
201
+ {
202
+ return $ this ->messageGroupId ;
203
+ }
204
+
205
+ /**
206
+ * Only FIFO.
207
+ *
208
+ * The token used for deduplication of sent messages. If a message with a particular MessageDeduplicationId is
209
+ * sent successfully, any messages sent with the same MessageDeduplicationId are accepted successfully but
210
+ * aren't delivered during the 5-minute deduplication interval.
211
+ * For more information, see https://docs.aws.amazon.com/sns/latest/dg/fifo-message-dedup.html
212
+ */
213
+ public function setMessageDeduplicationId (string $ id = null ): void
214
+ {
215
+ $ this ->messageDeduplicationId = $ id ;
216
+ }
217
+
218
+ public function getMessageDeduplicationId (): ?string
219
+ {
220
+ return $ this ->messageDeduplicationId ;
221
+ }
223
222
}
0 commit comments