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

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

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 Unsubscribe ( UnsubscribeRequest request ) : UnsubscribeResponse
request UnsubscribeRequest Container for the necessary parameters to execute the Unsubscribe service method.
Результат UnsubscribeResponse
        public UnsubscribeResponse Unsubscribe(UnsubscribeRequest request)
        {
            var marshaller = new UnsubscribeRequestMarshaller();
            var unmarshaller = UnsubscribeResponseUnmarshaller.Instance;

            return Invoke<UnsubscribeRequest,UnsubscribeResponse>(request, marshaller, unmarshaller);
        }

Same methods

AmazonSimpleNotificationServiceClient::Unsubscribe ( string subscriptionArn ) : UnsubscribeResponse

Usage Example

Пример #1
0
        public virtual void DeleteSubscriptions(AmazonSimpleNotificationServiceClient snsClient, string topicArn)
        {
            var listSubscriptionsByTopicRequest = new ListSubscriptionsByTopicRequest
            {
                TopicArn = topicArn
            };

            ListSubscriptionsByTopicResponse listSubscriptionsByTopicResponse =
                snsClient.ListSubscriptionsByTopic(listSubscriptionsByTopicRequest);

            foreach (
                Subscription subscription in
                    listSubscriptionsByTopicResponse.Subscriptions)
            {
                var unsubscribeRequest = new UnsubscribeRequest
                {
                    SubscriptionArn = subscription.SubscriptionArn
                };
                snsClient.Unsubscribe(unsubscribeRequest);
            }
        }
All Usage Examples Of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient::Unsubscribe
AmazonSimpleNotificationServiceClient