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

GetTopicAttributes() public method

Returns all of the properties of a topic. Topic properties returned might differ based on the authorization of the user.
/// 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 GetTopicAttributes ( GetTopicAttributesRequest request ) : GetTopicAttributesResponse
request Amazon.SimpleNotificationService.Model.GetTopicAttributesRequest Container for the necessary parameters to execute the GetTopicAttributes service method.
return Amazon.SimpleNotificationService.Model.GetTopicAttributesResponse
        public GetTopicAttributesResponse GetTopicAttributes(GetTopicAttributesRequest request)
        {
            var marshaller = new GetTopicAttributesRequestMarshaller();
            var unmarshaller = GetTopicAttributesResponseUnmarshaller.Instance;

            return Invoke<GetTopicAttributesRequest,GetTopicAttributesResponse>(request, marshaller, unmarshaller);
        }

Same methods

AmazonSimpleNotificationServiceClient::GetTopicAttributes ( string topicArn ) : GetTopicAttributesResponse

Usage Example

Example #1
0
    public static void SNSListTopics()
    {
      #region SNSListTopics
      var snsClient = new AmazonSimpleNotificationServiceClient();
      var request = new ListTopicsRequest();
      var response = new ListTopicsResponse();

      do
      {
        response = snsClient.ListTopics(request);

        foreach (var topic in response.Topics)
        {
          Console.WriteLine("Topic: {0}", topic.TopicArn);

          var attrs = snsClient.GetTopicAttributes(
            new GetTopicAttributesRequest
            {
              TopicArn = topic.TopicArn
            }).Attributes;

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

          Console.WriteLine();

        }

        request.NextToken = response.NextToken;

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

      Console.ReadLine();
    }
AmazonSimpleNotificationServiceClient