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

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

Returns all of the properties of a subscription.
/// 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 GetSubscriptionAttributes ( GetSubscriptionAttributesRequest request ) : GetSubscriptionAttributesResponse
request Amazon.SimpleNotificationService.Model.GetSubscriptionAttributesRequest Container for the necessary parameters to execute the GetSubscriptionAttributes service method.
Результат Amazon.SimpleNotificationService.Model.GetSubscriptionAttributesResponse
        public GetSubscriptionAttributesResponse GetSubscriptionAttributes(GetSubscriptionAttributesRequest request)
        {
            var marshaller = new GetSubscriptionAttributesRequestMarshaller();
            var unmarshaller = GetSubscriptionAttributesResponseUnmarshaller.Instance;

            return Invoke<GetSubscriptionAttributesRequest,GetSubscriptionAttributesResponse>(request, marshaller, unmarshaller);
        }

Same methods

AmazonSimpleNotificationServiceClient::GetSubscriptionAttributes ( string subscriptionArn ) : GetSubscriptionAttributesResponse

Usage Example

Пример #1
0
    public static void SNSListSubscriptionsByTopic()
    {
      #region SNSListSubscriptionsByTopic
      var snsClient = new AmazonSimpleNotificationServiceClient();
      var request = new ListSubscriptionsByTopicRequest();
      var response = new ListSubscriptionsByTopicResponse();

      request.TopicArn = "arn:aws:sns:us-east-1:80398EXAMPLE:CodingTestResults";

      do
      {
        response = snsClient.ListSubscriptionsByTopic(request);

        foreach (var sub in response.Subscriptions)
        {
          Console.WriteLine("Subscription: {0}", sub.SubscriptionArn);

          var subAttrs = snsClient.GetSubscriptionAttributes(
            new GetSubscriptionAttributesRequest
            {
              SubscriptionArn = sub.SubscriptionArn
            }).Attributes;

          if (subAttrs.Count > 0)
          {
            foreach (var subAttr in subAttrs)
            {
              Console.WriteLine(" -{0} : {1}", subAttr.Key, subAttr.Value);
            }
          }

          Console.WriteLine();
        }

        request.NextToken = response.NextToken;

      } while (!string.IsNullOrEmpty(response.NextToken));
      #endregion

      Console.ReadLine();
    }
AmazonSimpleNotificationServiceClient