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

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

Creates a topic to which notifications can be published. Users can create at most 100,000 topics. For more information, see http://aws.amazon.com/sns. This action is idempotent, so if the requester already owns a topic with the specified name, that topic's ARN is returned without creating a new topic.
/// 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 customer already owns the maximum allowed number of topics. ///
public CreateTopic ( CreateTopicRequest request ) : CreateTopicResponse
request Amazon.SimpleNotificationService.Model.CreateTopicRequest Container for the necessary parameters to execute the CreateTopic service method.
Результат Amazon.SimpleNotificationService.Model.CreateTopicResponse
        public CreateTopicResponse CreateTopic(CreateTopicRequest request)
        {
            var marshaller = new CreateTopicRequestMarshaller();
            var unmarshaller = CreateTopicResponseUnmarshaller.Instance;

            return Invoke<CreateTopicRequest,CreateTopicResponse>(request, marshaller, unmarshaller);
        }

Same methods

AmazonSimpleNotificationServiceClient::CreateTopic ( string name ) : CreateTopicResponse

Usage Example

Пример #1
0
        private void CreatePlatformApplication()
        {
            using (var sns = new Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient())
            {
                // Create target topic
                var topicArn = sns.CreateTopic(new CreateTopicRequest
                {
                    Name = "TestTopic" + new Random().Next()
                }).TopicArn;
                topicArns.Add(topicArn);

                var platformAppName = "NetSDKTestApp" + new Random().Next();

                // Create a platform application for GCM.
                platformApplicationArn = sns.CreatePlatformApplication(new CreatePlatformApplicationRequest
                {
                    Name       = platformAppName,
                    Platform   = "GCM",
                    Attributes = new Dictionary <string, string>
                    {
                        { "PlatformCredential", PlatformCredential },
                        { "PlatformPrincipal", "NA" },
                        { "EventEndpointCreated", topicArn },
                        { "EventEndpointDeleted", topicArn },
                        { "EventEndpointUpdated", topicArn },
                        { "EventDeliveryAttemptFailure", topicArn },
                        { "EventDeliveryFailure", topicArn },
                    }
                }).PlatformApplicationArn;
            }
        }
All Usage Examples Of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient::CreateTopic
AmazonSimpleNotificationServiceClient