Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.UnsubscribeAsync C# (CSharp) Method

UnsubscribeAsync() public method

Deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the topic's owner can unsubscribe, and an AWS signature is required. If the Unsubscribe call does not require authentication and the requester is not the subscription owner, a final cancellation message is delivered to the endpoint, so that the endpoint owner can easily resubscribe to the topic if the Unsubscribe request was unintended.
/// Indicates that the user has been denied access to the requested resource. /// /// Indicates an internal service error. /// /// Indicates that a request parameter does not comply with the associated constraints. /// /// Indicates that the requested resource does not exist. ///
public UnsubscribeAsync ( string subscriptionArn, UnsubscribeResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
subscriptionArn string The ARN of the subscription to be deleted.
callback UnsubscribeResponse>.AmazonServiceCallback An Action delegate that is invoked when the operation completes.
options AsyncOptions /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. ///
return void
        public void UnsubscribeAsync(string subscriptionArn,  AmazonServiceCallback<UnsubscribeRequest, UnsubscribeResponse> callback, AsyncOptions options = null)
        {
            var request = new UnsubscribeRequest();
            request.SubscriptionArn = subscriptionArn;
            UnsubscribeAsync(request, callback, options);
        }

Same methods

AmazonSimpleNotificationServiceClient::UnsubscribeAsync ( UnsubscribeRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonSimpleNotificationServiceClient::UnsubscribeAsync ( string subscriptionArn, System cancellationToken = default(CancellationToken) ) : Task
AmazonSimpleNotificationServiceClient::UnsubscribeAsync ( UnsubscribeRequest request, UnsubscribeResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

Example #1
0
 private void UnSubscribe(string subscriptionArn)
 {
     using (var client = new AmazonSimpleNotificationServiceClient(this.AwsCredentials, this.AwsRegion)) {
         Task <UnsubscribeResponse> t;
         t = client.UnsubscribeAsync(subscriptionArn);
         t.Wait();
         if (t.IsCompleted)
         {
             this.ReloadExistingSubscriptions();
         }
     }
 }
All Usage Examples Of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient::UnsubscribeAsync
AmazonSimpleNotificationServiceClient