Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.UnsubscribeAsync C# (CSharp) Метод

UnsubscribeAsync() публичный Метод

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, System cancellationToken = default(CancellationToken) ) : Task
subscriptionArn string The ARN of the subscription to be deleted.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Результат Task
        public Task<UnsubscribeResponse> UnsubscribeAsync(string subscriptionArn, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new UnsubscribeRequest();
            request.SubscriptionArn = subscriptionArn;
            return UnsubscribeAsync(request, cancellationToken);
        }

Same methods

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

Usage 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