User guide
• Specifying Server-Side Encryption with Customer-Provided Encryption Keys
Amazon Simple Notification Service
Programming with the AWS SDK for .NET
The AWS SDK for .NET supports Amazon Simple Notification Service (Amazon SNS), which is a web
service that enables applications, end-users, and devices to instantly send and receive notifications from
the cloud. For more information, see Amazon SNS.
The following information introduces you to the Amazon SNS programming models in the SDK for .NET.
Programming Models
The SDK for .NET provides two programming models for working with Amazon SNS.These programming
models are known as the low-level and resource models. The following information describes these
models, how to use them, and why you would want to use them.
Low-Level APIs
The SDK for .NET provides low-level APIs for programming with Amazon SNS. These low-level APIs
typically consist of sets of matching request-and-response objects that correspond to HTTP-based API
calls focusing on their corresponding service-level constructs.
The following example shows how to use the low-level APIs to list accessible topics in Amazon SNS:
// using Amazon.SimpleNotificationService;
// using Amazon.SimpleNotificationService.Model;
var client = new AmazonSimpleNotificationServiceClient();
var request = new ListTopicsRequest();
var response = new ListTopicsResponse();
do
{
response = client.ListTopics(request);
foreach (var topic in response.Topics)
{
Console.WriteLine("Topic: {0}", topic.TopicArn);
var subs = client.ListSubscriptionsByTopic(
new ListSubscriptionsByTopicRequest
{
TopicArn = topic.TopicArn
});
var ss = subs.Subscriptions;
if (ss.Any())
{
Console.WriteLine(" Subscriptions:");
foreach (var sub in ss)
Version v2.0.0
117
AWS SDK for .NET Developer Guide
Amazon Simple Notification Service (Amazon SNS)