User guide

{
Console.WriteLine(" {0}", sub.SubscriptionArn);
}
}
var attrs = client.GetTopicAttributes(
new GetTopicAttributesRequest
{
TopicArn = topic.TopicArn
}).Attributes;
if (attrs.Any())
{
Console.WriteLine(" Attributes:");
foreach (var attr in attrs)
{
Console.WriteLine(" {0} = {1}", attr.Key, attr.Value);
}
}
Console.WriteLine();
}
request.NextToken = response.NextToken;
} while (!string.IsNullOrEmpty(response.NextToken));
For related API reference information, see Amazon.SimpleNotificationService,
Amazon.SimpleNotificationService.Model, and Amazon.SimpleNotificationService.Util
in the AWS SDK for .NET API Reference.
Resource APIs
The SDK for .NET provides the AWS Resource APIs for .NET for programming with Amazon SNS.These
resource APIs provide a resource-level programming model that enables you to write code to work more
directly with Amazon SNS resources as compared to their low-level API counterparts. (For more information
about the AWS Resource APIs for .NET, including how to download and reference these resource APIs,
see AWS Resource APIs for .NET (p. 41).)
The following example shows how to use the AWS Resource APIs for .NET to list accessible topics in
Amazon SNS:
// using Amazon.SimpleNotificationService.Resources;
var sns = new SimpleNotificationService();
var topics = sns.GetTopics();
if (topics.Any())
{
Console.WriteLine("Topics:");
foreach (var topic in topics)
{
Console.WriteLine(" Topic ARN: {0}", topic.Arn);
Version v2.0.0
118
AWS SDK for .NET Developer Guide
Programming Models