File tree 3 files changed +26
-0
lines changed
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ public function unsubscribe(array $args): Result
60
60
return $ this ->callApi ('unsubscribe ' , $ args );
61
61
}
62
62
63
+ public function setSubscriptionAttributes (array $ args ): Result
64
+ {
65
+ return $ this ->callApi ('setSubscriptionAttributes ' , $ args );
66
+ }
67
+
63
68
public function listSubscriptionsByTopic (array $ args ): Result
64
69
{
65
70
return $ this ->callApi ('ListSubscriptionsByTopic ' , $ args );
Original file line number Diff line number Diff line change @@ -145,6 +145,16 @@ public function getSubscriptions(SnsDestination $destination): array
145
145
return $ subscriptions ;
146
146
}
147
147
148
+ public function setSubscriptionAttributes (SnsSubscribe $ subscribe ): void
149
+ {
150
+ foreach ($ this ->getSubscriptions ($ subscribe ->getTopic ()) as $ subscription ) {
151
+ $ this ->client ->setSubscriptionAttributes (array_merge (
152
+ $ subscribe ->getAttributes (),
153
+ ['SubscriptionArn ' => $ subscription ['SubscriptionArn ' ]],
154
+ ));
155
+ }
156
+ }
157
+
148
158
public function getTopicArn (SnsDestination $ destination ): string
149
159
{
150
160
if (false == array_key_exists ($ destination ->getTopicName (), $ this ->topicArns )) {
Original file line number Diff line number Diff line change @@ -173,6 +173,17 @@ public function close(): void
173
173
$ this ->getSqsContext ()->close ();
174
174
}
175
175
176
+ public function setSubscriptionAttributes (SnsQsTopic $ topic , SnsQsQueue $ queue , array $ attributes ): void
177
+ {
178
+ $ this ->getSnsContext ()->setSubscriptionAttributes (new SnsSubscribe (
179
+ $ topic ,
180
+ $ this ->getSqsContext ()->getQueueArn ($ queue ),
181
+ SnsSubscribe::PROTOCOL_SQS ,
182
+ false ,
183
+ $ attributes ,
184
+ ));
185
+ }
186
+
176
187
private function getSnsContext (): SnsContext
177
188
{
178
189
if (null === $ this ->snsContext ) {
You can’t perform that action at this time.
0 commit comments