File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ public function createTopic(array $args): Result
3838 return $ this ->callApi ('createTopic ' , $ args );
3939 }
4040
41+ public function deleteTopic (string $ topicArn ): Result
42+ {
43+ return $ this ->callApi ('DeleteTopic ' , [
44+ 'TopicArn ' => $ topicArn ,
45+ ]);
46+ }
47+
4148 public function publish (array $ args ): Result
4249 {
4350 return $ this ->callApi ('publish ' , $ args );
Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ public function declareTopic(SnsDestination $destination): void
7777 $ this ->topicArns [$ destination ->getTopicName ()] = (string ) $ result ->get ('TopicArn ' );
7878 }
7979
80+ public function deleteTopic (SnsDestination $ destination ): void
81+ {
82+ $ this ->client ->deleteTopic ($ this ->getTopicArn ($ destination ));
83+
84+ unset($ this ->topicArns [$ destination ->getTopicName ()]);
85+ }
86+
8087 public function subscribe (SnsSubscribe $ subscribe ): void
8188 {
8289 foreach ($ this ->getSubscriptions ($ subscribe ->getTopic ()) as $ subscription ) {
You can’t perform that action at this time.
0 commit comments