DeleteTopicAsync() public method

Initiates the asynchronous execution of the DeleteTopic operation.
public DeleteTopicAsync ( DeleteTopicRequest request, System cancellationToken = default(CancellationToken) ) : Task
request Amazon.SimpleNotificationService.Model.DeleteTopicRequest Container for the necessary parameters to execute the DeleteTopic operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
return Task
Exemplo n.º 1
0
 public void DeleteTopic(string topicName)
 {
     using (var client = new AmazonSimpleNotificationServiceClient(_credentials))
     {
         var topic = client.ListTopicsAsync().Result.Topics.SingleOrDefault(t => t.TopicArn == topicName);
         client.DeleteTopicAsync(topic.TopicArn).Wait();
     }
 }