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

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

Finds an existing Amazon SNS topic by iterating all SNS topics until a match is found asynchronously.

The ListTopics method is used to fetch upto 100 SNS topics at a time until a SNS topic with an TopicArn that matches topicName is found.

public FindTopicAsync ( string topicName ) : Task
topicName string The name of the topic find
Результат Task
        public async Task<Topic> FindTopicAsync(string topicName)
        {
            var nextToken = string.Empty;

            do
            {
                var response = await this.ListTopicsAsync(new ListTopicsRequest { NextToken = nextToken }).ConfigureAwait(false);

                var matchedTopic = response.Topics.FirstOrDefault(x => TopicNameMatcher(x.TopicArn, topicName));

                if (matchedTopic != null)
                {
                    return matchedTopic;
                }

                nextToken = response.NextToken;

            } while (!string.IsNullOrEmpty(nextToken));

            return null;
        }
AmazonSimpleNotificationServiceClient