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

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

Verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier Subscribe action. If the token is valid, the action creates a new subscription and returns its Amazon Resource Name (ARN). This call requires an AWS signature only when the AuthenticateOnUnsubscribe flag is set to "true".
/// 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. /// /// Indicates that the customer already owns the maximum allowed number of subscriptions. ///
public ConfirmSubscriptionAsync ( string topicArn, string token, System cancellationToken = default(CancellationToken) ) : Task
topicArn string The ARN of the topic for which you wish to confirm a subscription.
token string Short-lived token sent to an endpoint during the Subscribe action.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Результат Task
        public Task<ConfirmSubscriptionResponse> ConfirmSubscriptionAsync(string topicArn, string token, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new ConfirmSubscriptionRequest();
            request.TopicArn = topicArn;
            request.Token = token;
            return ConfirmSubscriptionAsync(request, cancellationToken);
        }

Same methods

AmazonSimpleNotificationServiceClient::ConfirmSubscriptionAsync ( ConfirmSubscriptionRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonSimpleNotificationServiceClient::ConfirmSubscriptionAsync ( string topicArn, string token, string authenticateOnUnsubscribe, System cancellationToken = default(CancellationToken) ) : Task
AmazonSimpleNotificationServiceClient::ConfirmSubscriptionAsync ( ConfirmSubscriptionRequest request, ConfirmSubscriptionResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
AmazonSimpleNotificationServiceClient::ConfirmSubscriptionAsync ( string topicArn, string token, ConfirmSubscriptionResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void
AmazonSimpleNotificationServiceClient::ConfirmSubscriptionAsync ( string topicArn, string token, string authenticateOnUnsubscribe, ConfirmSubscriptionResponse>.AmazonServiceCallback callback, AsyncOptions options = null ) : void

Usage Example

Пример #1
0
 public void Confirm(string topicArn, string token)
 {
     using (var client = new AmazonSimpleNotificationServiceClient(this.AwsCredentials, this.AwsRegion)) {
         var cr = new ConfirmSubscriptionRequest();
         cr.TopicArn = topicArn;
         cr.Token    = token;
         var t = client.ConfirmSubscriptionAsync(cr);
         t.Wait();
         if (t.IsCompleted && t.Result is object)
         {
             this.ReloadExistingSubscriptions();
         }
     }
 }
AmazonSimpleNotificationServiceClient