From e75eeb979d6e7b944ba1731dff286491b46ece18 Mon Sep 17 00:00:00 2001 From: Matthew Podwysocki Date: Fri, 14 Aug 2020 16:04:27 -0400 Subject: [PATCH] Cleaning up 4.0.0 --- .../ManagementApiE2ETests.cs | 9 +- .../NamespaceManagerRetryPolicyTests.cs | 20 +- .../NotificationHubClientRetryPolicyTests.cs | 20 +- .../NotificationHubClientTest.cs | 22 +- ...ficationHubConnectionStringBuilderTests.cs | 4 +- .../TestServerProxy.cs | 18 +- .../AdmNotification.cs | 4 +- .../AdmRegistrationDescription.cs | 10 +- .../AdmTemplateRegistrationDescription.cs | 18 +- .../AndroidRegistrationDescription.cs | 14 +- .../AndroidTemplateRegistrationDescription.cs | 22 +- .../AppleNotification.cs | 10 +- .../AppleRegistrationDescription.cs | 14 +- .../AppleTemplateRegistrationDescription.cs | 18 +- .../Auth/SharedAccessSignatureBuilder.cs | 14 +- .../SharedAccessSignatureTokenProvider.cs | 19 +- .../Auth/TokenProvider.cs | 8 + .../BaiduNotification.cs | 6 +- .../BaiduRegistrationDescription.cs | 10 +- .../BaiduTemplateRegistrationDescription.cs | 18 +- .../CDataMember.cs | 10 +- .../CollectionQueryResult.cs | 6 +- .../ConfigurationException.cs | 10 +- .../EntityOperatonType.cs | 1 + .../ErrorResponse.cs | 9 + .../ExceptionUtility.cs | 24 +- .../FCMNotification.cs | 4 +- .../FcmCredential.cs | 1 + .../GCMNotification.cs | 4 +- .../INamespaceManager.cs | 158 ++ .../INotificationHubClient.cs | 1519 +++++++++++++++++ .../Messaging/BadRequestException.cs | 6 +- .../Messaging/Constants.cs | 4 +- .../Messaging/EntityDescriptionSerializer.cs | 26 +- .../Messaging/ExpressionEvaluator.cs | 15 +- .../MessagingCommunicationException.cs | 6 +- .../MessagingEntityAlreadyExistsException.cs | 6 +- .../MessagingEntityNotFoundException.cs | 6 +- .../Messaging/MessagingException.cs | 8 +- .../Messaging/MessagingExceptionDetail.cs | 6 +- .../Messaging/QuotaExceededException.cs | 6 +- .../Messaging/ServerBusyException.cs | 6 +- .../Messaging/UnauthorizedException.cs | 6 +- .../Microsoft.Azure.NotificationHubs.csproj | 2 +- .../MpnsHeaderCollection.cs | 10 +- .../MpnsNotification.cs | 10 +- .../Notification.cs | 6 +- .../NotificationDetails.cs | 8 +- .../NotificationHubClient.cs | 16 +- .../NotificationHubConnectionStringBuilder.cs | 4 +- .../NotificationHubJob.cs | 12 +- .../NotificationHubRetryOptions.cs | 4 +- .../NotificationHubRetryPolicy.cs | 14 +- .../NotificationHubSettings.cs | 8 +- .../NotificationOutcome.cs | 8 +- .../NotificationOutcomeCollection.cs | 10 +- .../NotificationPlatform.cs | 4 +- .../PNSCredential.cs | 2 + .../PNSCredentialProperties.cs | 10 +- .../PartialUpdateOperation.cs | 8 +- .../PartialUpdateOperationExtensions.cs | 8 +- .../PnsFeedback.cs | 8 +- .../PublicKeyConstants.cs | 4 + .../RegistrationDescription.cs | 25 +- .../RegistrationResult.cs | 6 +- .../RegistrationSDKHelper.cs | 13 +- .../ScheduledNotification.cs | 8 +- .../TemplateNotification.cs | 8 +- .../UpdateOperationType.cs | 4 +- .../WNSHeaderCollection.cs | 10 +- .../WindowsNotification.cs | 8 +- .../WindowsPhoneRegistrationDescription.cs | 12 +- ...owsPhoneTemplateRegistrationDescription.cs | 20 +- .../WindowsRegistrationDescription.cs | 11 +- .../WindowsTemplateRegistrationDescription.cs | 18 +- .../WnsSecondaryTile.cs | 6 +- 76 files changed, 2089 insertions(+), 341 deletions(-) diff --git a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/ManagementApiE2ETests.cs b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/ManagementApiE2ETests.cs index 2927ee2..880a166 100644 --- a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/ManagementApiE2ETests.cs +++ b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/ManagementApiE2ETests.cs @@ -1,8 +1,13 @@ -using System; +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +//------------------------------------------------------------ + +using System; using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; -using Microsoft.Azure.NotificationHubs.Auth; using Microsoft.Azure.NotificationHubs.Messaging; using Microsoft.Azure.NotificationHubs.Tests; using Microsoft.Azure.Storage; diff --git a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NamespaceManagerRetryPolicyTests.cs b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NamespaceManagerRetryPolicyTests.cs index c9707ef..546748e 100644 --- a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NamespaceManagerRetryPolicyTests.cs +++ b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NamespaceManagerRetryPolicyTests.cs @@ -4,18 +4,18 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Net.Sockets; +using System.Threading.Tasks; +using Microsoft.Azure.NotificationHubs.Messaging; +using RichardSzalay.MockHttp; +using Xunit; + namespace Microsoft.Azure.NotificationHubs.DotNetCore.Tests { - using System; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Sockets; - using System.Threading.Tasks; - using Microsoft.Azure.NotificationHubs.Messaging; - using RichardSzalay.MockHttp; - using Xunit; - public class NamespaceManagerRetryPolicyTests { private readonly string _connectionString; diff --git a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientRetryPolicyTests.cs b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientRetryPolicyTests.cs index 3342fea..5e6f0f2 100644 --- a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientRetryPolicyTests.cs +++ b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientRetryPolicyTests.cs @@ -4,18 +4,18 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Net.Sockets; +using System.Threading.Tasks; +using Microsoft.Azure.NotificationHubs.Messaging; +using RichardSzalay.MockHttp; +using Xunit; + namespace Microsoft.Azure.NotificationHubs.DotNetCore.Tests { - using System; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Net.Sockets; - using System.Threading.Tasks; - using Microsoft.Azure.NotificationHubs.Messaging; - using RichardSzalay.MockHttp; - using Xunit; - public class NotificationHubClientRetryPolicyTests { private readonly string _connectionString; diff --git a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientTest.cs b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientTest.cs index e50b8df..86bd24c 100644 --- a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientTest.cs +++ b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubClientTest.cs @@ -4,19 +4,19 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using Microsoft.Azure.NotificationHubs.Messaging; +using Microsoft.Extensions.Configuration; +using Newtonsoft.Json; +using Xunit; + namespace Microsoft.Azure.NotificationHubs.Tests { - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Runtime.CompilerServices; - using System.Threading.Tasks; - using Extensions.Configuration; - using Messaging; - using Newtonsoft.Json; - using Xunit; - public class NotificationHubClientTest { private readonly IConfigurationRoot _configuration; diff --git a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubConnectionStringBuilderTests.cs b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubConnectionStringBuilderTests.cs index 65365ed..516c741 100644 --- a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubConnectionStringBuilderTests.cs +++ b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/NotificationHubConnectionStringBuilderTests.cs @@ -4,10 +4,10 @@ // license information. //------------------------------------------------------------ +using Xunit; + namespace Microsoft.Azure.NotificationHubs.Tests { - using Xunit; - public class NotificationHubConnectionStringBuilderTests { [Fact] diff --git a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/TestServerProxy.cs b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/TestServerProxy.cs index 65c6eb1..4b8ad4b 100644 --- a/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/TestServerProxy.cs +++ b/src/Microsoft.Azure.NotificationHubs.DotNetCore.Tests/TestServerProxy.cs @@ -4,17 +4,17 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + namespace Microsoft.Azure.NotificationHubs.Tests { - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Net; - using System.Net.Http; - using System.Text; - using System.Threading; - using System.Threading.Tasks; - public class TestServerProxy : HttpClientHandler { private const string ServerUriKey = "##ServerUri##"; diff --git a/src/Microsoft.Azure.NotificationHubs/AdmNotification.cs b/src/Microsoft.Azure.NotificationHubs/AdmNotification.cs index c905a21..f677ba4 100644 --- a/src/Microsoft.Azure.NotificationHubs/AdmNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/AdmNotification.cs @@ -4,10 +4,10 @@ // license information. //---------------------------------------------------------------- +using System; + namespace Microsoft.Azure.NotificationHubs { - using System; - /// /// Represents the Amazon Device Messaging (ADM) notification. /// diff --git a/src/Microsoft.Azure.NotificationHubs/AdmRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/AdmRegistrationDescription.cs index 832fe66..8998818 100644 --- a/src/Microsoft.Azure.NotificationHubs/AdmRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/AdmRegistrationDescription.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the description of the Amazon Device Messaging (ADM) registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/AdmTemplateRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/AdmTemplateRegistrationDescription.cs index 0648748..c20a4f8 100644 --- a/src/Microsoft.Azure.NotificationHubs/AdmTemplateRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/AdmTemplateRegistrationDescription.cs @@ -4,17 +4,17 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using System.Runtime.Serialization.Json; - using System.Text; - using System.Xml; - using System.Xml.Linq; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the description of the Amazon Device Messaging (ADM) template registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/AndroidRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/AndroidRegistrationDescription.cs index 247c5b6..575be2f 100644 --- a/src/Microsoft.Azure.NotificationHubs/AndroidRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/AndroidRegistrationDescription.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents Notification Hub registration description for Google Cloud Messaging /// @@ -152,6 +152,8 @@ public FcmRegistrationDescription(string fcmRegistrationId, IEnumerable { } +#pragma warning disable CS0618 + /// /// Creates instance of class from object. /// @@ -165,6 +167,8 @@ internal FcmRegistrationDescription(GcmRegistrationDescription gcmRegistration) this.PushVariables = gcmRegistration.PushVariables; } +#pragma warning restore CS0618 + internal FcmRegistrationDescription(string notificationHubPath, string fcmRegistrationId, IEnumerable tags) : base(notificationHubPath) { diff --git a/src/Microsoft.Azure.NotificationHubs/AndroidTemplateRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/AndroidTemplateRegistrationDescription.cs index a4bcbac..a220f2a 100644 --- a/src/Microsoft.Azure.NotificationHubs/AndroidTemplateRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/AndroidTemplateRegistrationDescription.cs @@ -4,17 +4,17 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Xml.Linq; +using System.Xml; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using System.Runtime.Serialization.Json; - using System.Text; - using System.Xml.Linq; - using System.Xml; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents Notification Hub template registration description for Google Cloud Messaging /// @@ -243,6 +243,8 @@ public FcmTemplateRegistrationDescription(string fcmRegistrationId, string jsonP { } +#pragma warning disable CS0618 + /// /// Creates instance of class from object. /// @@ -254,6 +256,8 @@ internal FcmTemplateRegistrationDescription(GcmTemplateRegistrationDescription g this.TemplateName = gcmRegistration.TemplateName; } +#pragma warning restore CS0618 + internal FcmTemplateRegistrationDescription(string notificationHubPath, string fcmRegistrationId, string jsonPayload, IEnumerable tags) : base(notificationHubPath, fcmRegistrationId, tags) { diff --git a/src/Microsoft.Azure.NotificationHubs/AppleNotification.cs b/src/Microsoft.Azure.NotificationHubs/AppleNotification.cs index c576a59..cb840d7 100644 --- a/src/Microsoft.Azure.NotificationHubs/AppleNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/AppleNotification.cs @@ -4,13 +4,13 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Runtime.Serialization; - /// /// Represents the Apple notification. /// diff --git a/src/Microsoft.Azure.NotificationHubs/AppleRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/AppleRegistrationDescription.cs index 42356cf..98366e6 100644 --- a/src/Microsoft.Azure.NotificationHubs/AppleRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/AppleRegistrationDescription.cs @@ -4,15 +4,15 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Runtime.Serialization; +using System.Text.RegularExpressions; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Runtime.Serialization; - using System.Text.RegularExpressions; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the description of apple registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/AppleTemplateRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/AppleTemplateRegistrationDescription.cs index 0309247..be454f8 100644 --- a/src/Microsoft.Azure.NotificationHubs/AppleTemplateRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/AppleTemplateRegistrationDescription.cs @@ -4,17 +4,17 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Xml.Linq; +using System.Xml; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using System.Runtime.Serialization.Json; - using System.Text; - using System.Xml.Linq; - using System.Xml; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the description of the Apple template registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureBuilder.cs b/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureBuilder.cs index 388a53a..816c08f 100644 --- a/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureBuilder.cs +++ b/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureBuilder.cs @@ -4,15 +4,15 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Security.Cryptography; +using System.Text; +using System.Web; + namespace Microsoft.Azure.NotificationHubs.Auth { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Security.Cryptography; - using System.Text; - using System.Web; - internal static class SharedAccessSignatureBuilder { private const string SharedAccessSignature = "SharedAccessSignature"; diff --git a/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureTokenProvider.cs b/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureTokenProvider.cs index 814ee3f..e1a11c1 100644 --- a/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureTokenProvider.cs +++ b/src/Microsoft.Azure.NotificationHubs/Auth/SharedAccessSignatureTokenProvider.cs @@ -4,12 +4,15 @@ // license information. //------------------------------------------------------------ +using System; +using System.Text; +using Microsoft.Azure.NotificationHubs.Common; + namespace Microsoft.Azure.NotificationHubs.Auth { - using Common; - using System; - using System.Text; - + /// + /// Represents a Token Provider for Shared Access Signatures + /// public class SharedAccessSignatureTokenProvider : TokenProvider { private const int MaxKeyNameLength = 256; @@ -89,10 +92,14 @@ public static TokenProvider CreateSharedAccessSignatureTokenProvider(string keyN return new SharedAccessSignatureTokenProvider(keyName, sharedAccessKey, DefaultTokenTimeout); } + /// + /// Generates the token based upon the applies to. + /// + /// The scope of the token to generate. + /// The generated token protected override string GenerateToken(string appliesTo) { - var tokenString = BuildSignature(appliesTo); - return tokenString; + return BuildSignature(appliesTo); } private string BuildSignature(string targetUri) diff --git a/src/Microsoft.Azure.NotificationHubs/Auth/TokenProvider.cs b/src/Microsoft.Azure.NotificationHubs/Auth/TokenProvider.cs index 03b5d3a..a5983ae 100644 --- a/src/Microsoft.Azure.NotificationHubs/Auth/TokenProvider.cs +++ b/src/Microsoft.Azure.NotificationHubs/Auth/TokenProvider.cs @@ -49,6 +49,11 @@ protected TokenProvider(bool cacheTokens) _cacheTokens = cacheTokens; } + /// + /// When implemented, generates a token based upon the scope. + /// + /// The scope for the token. + /// The generated token based upon the scope. protected abstract string GenerateToken(string appliesTo); /// @@ -124,6 +129,9 @@ private string BuildKey(string appliesTo, string action) return $"{appliesTo}_{action}"; } + /// + /// Disposes the current object. + /// public void Dispose() { _tokenCache?.Dispose(); diff --git a/src/Microsoft.Azure.NotificationHubs/BaiduNotification.cs b/src/Microsoft.Azure.NotificationHubs/BaiduNotification.cs index 7d40c76..a193d11 100644 --- a/src/Microsoft.Azure.NotificationHubs/BaiduNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/BaiduNotification.cs @@ -4,11 +4,11 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Globalization; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Globalization; - /// /// Represents a Baidu notification hub notification, including the target tag /// diff --git a/src/Microsoft.Azure.NotificationHubs/BaiduRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/BaiduRegistrationDescription.cs index 5d45023..548158c 100644 --- a/src/Microsoft.Azure.NotificationHubs/BaiduRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/BaiduRegistrationDescription.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents a Baidu registration description. /// diff --git a/src/Microsoft.Azure.NotificationHubs/BaiduTemplateRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/BaiduTemplateRegistrationDescription.cs index 4151535..030ebb8 100644 --- a/src/Microsoft.Azure.NotificationHubs/BaiduTemplateRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/BaiduTemplateRegistrationDescription.cs @@ -4,17 +4,17 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using System.Runtime.Serialization.Json; - using System.Text; - using System.Xml; - using System.Xml.Linq; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents a Baidu template registration description. /// diff --git a/src/Microsoft.Azure.NotificationHubs/CDataMember.cs b/src/Microsoft.Azure.NotificationHubs/CDataMember.cs index 84b242e..3e91b2e 100644 --- a/src/Microsoft.Azure.NotificationHubs/CDataMember.cs +++ b/src/Microsoft.Azure.NotificationHubs/CDataMember.cs @@ -5,13 +5,13 @@ // license information. //------------------------------------------------------------ +using System.Runtime.Serialization; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; + namespace Microsoft.Azure.NotificationHubs { - using System.Runtime.Serialization; - using System.Xml; - using System.Xml.Schema; - using System.Xml.Serialization; - /// /// Represents the body part of Template registration descriptions. The body tag within a template XML description can be any string value /// and is treated as a CData section. diff --git a/src/Microsoft.Azure.NotificationHubs/CollectionQueryResult.cs b/src/Microsoft.Azure.NotificationHubs/CollectionQueryResult.cs index ac09199..119eb24 100644 --- a/src/Microsoft.Azure.NotificationHubs/CollectionQueryResult.cs +++ b/src/Microsoft.Azure.NotificationHubs/CollectionQueryResult.cs @@ -4,11 +4,11 @@ // license information. //------------------------------------------------------------ +using System.Collections.Generic; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System.Collections.Generic; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents a collection query result. /// diff --git a/src/Microsoft.Azure.NotificationHubs/ConfigurationException.cs b/src/Microsoft.Azure.NotificationHubs/ConfigurationException.cs index f7ade26..f82be58 100644 --- a/src/Microsoft.Azure.NotificationHubs/ConfigurationException.cs +++ b/src/Microsoft.Azure.NotificationHubs/ConfigurationException.cs @@ -4,11 +4,19 @@ // license information. // ---------------------------------------------------------------- +using System; + namespace Microsoft.Azure.NotificationHubs { - using System; + /// + /// Represnets an exception based upon invalid configuration. + /// public class ConfigurationException : Exception { + /// + /// Creates a ConfigurationException with a message. + /// + /// The message for the ConfigurationException instance. public ConfigurationException(string message) : base(message) { } diff --git a/src/Microsoft.Azure.NotificationHubs/EntityOperatonType.cs b/src/Microsoft.Azure.NotificationHubs/EntityOperatonType.cs index 262b6c6..5ccac4b 100644 --- a/src/Microsoft.Azure.NotificationHubs/EntityOperatonType.cs +++ b/src/Microsoft.Azure.NotificationHubs/EntityOperatonType.cs @@ -3,6 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // ---------------------------------------------------------------- + namespace Microsoft.Azure.NotificationHubs { internal enum EntityOperatonType diff --git a/src/Microsoft.Azure.NotificationHubs/ErrorResponse.cs b/src/Microsoft.Azure.NotificationHubs/ErrorResponse.cs index 118ad54..ab01c19 100644 --- a/src/Microsoft.Azure.NotificationHubs/ErrorResponse.cs +++ b/src/Microsoft.Azure.NotificationHubs/ErrorResponse.cs @@ -8,12 +8,21 @@ namespace Microsoft.Azure.NotificationHubs { + /// + /// Represents an error response with error code and detail. + /// [DataContract(Name = "Error", Namespace = "")] public class ErrorResponse { + /// + /// Gets or sets the error code. + /// [DataMember] public string Code { get; set; } + /// + /// Gets or sets the error detail. + /// [DataMember] public string Detail { get; set; } } diff --git a/src/Microsoft.Azure.NotificationHubs/ExceptionUtility.cs b/src/Microsoft.Azure.NotificationHubs/ExceptionUtility.cs index 902f6cc..5f658ae 100644 --- a/src/Microsoft.Azure.NotificationHubs/ExceptionUtility.cs +++ b/src/Microsoft.Azure.NotificationHubs/ExceptionUtility.cs @@ -4,19 +4,19 @@ // license information. //------------------------------------------------------------ +using Microsoft.Azure.NotificationHubs.Messaging; +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Net.Sockets; +using System.Threading.Tasks; +using System.Xml; +using static Microsoft.Azure.NotificationHubs.Messaging.MessagingExceptionDetail; + namespace Microsoft.Azure.NotificationHubs { - using Microsoft.Azure.NotificationHubs.Messaging; - using System; - using System.Globalization; - using System.IO; - using System.Net; - using System.Net.Http; - using System.Net.Sockets; - using System.Threading.Tasks; - using System.Xml; - using static Microsoft.Azure.NotificationHubs.Messaging.MessagingExceptionDetail; - internal static class ExceptionsUtility { private static readonly string ConflictOperationInProgressSubCode = @@ -95,7 +95,7 @@ internal static string FormatExceptionMessage(string responseBody, HttpStatusCod reader.ReadStartElement(DetailTag); exceptionMessage = string.Format(CultureInfo.InvariantCulture, "{0} {1}", exceptionMessage, reader.ReadString()); } - catch (XmlException ex) + catch (XmlException) { // Ignore this exception } diff --git a/src/Microsoft.Azure.NotificationHubs/FCMNotification.cs b/src/Microsoft.Azure.NotificationHubs/FCMNotification.cs index edb6c59..f3e2d83 100644 --- a/src/Microsoft.Azure.NotificationHubs/FCMNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/FCMNotification.cs @@ -4,10 +4,10 @@ // license information. //---------------------------------------------------------------- +using System; + namespace Microsoft.Azure.NotificationHubs { - using System; - /// /// Represents a Firebase Cloud Messaging notification. /// diff --git a/src/Microsoft.Azure.NotificationHubs/FcmCredential.cs b/src/Microsoft.Azure.NotificationHubs/FcmCredential.cs index 3b145bc..5e102a9 100644 --- a/src/Microsoft.Azure.NotificationHubs/FcmCredential.cs +++ b/src/Microsoft.Azure.NotificationHubs/FcmCredential.cs @@ -3,6 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. //------------------------------------------------------------ + using Microsoft.Azure.NotificationHubs.Messaging; using System.Runtime.Serialization; diff --git a/src/Microsoft.Azure.NotificationHubs/GCMNotification.cs b/src/Microsoft.Azure.NotificationHubs/GCMNotification.cs index 2df0348..4a81284 100644 --- a/src/Microsoft.Azure.NotificationHubs/GCMNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/GCMNotification.cs @@ -4,10 +4,10 @@ // license information. //---------------------------------------------------------------- +using System; + namespace Microsoft.Azure.NotificationHubs { - using System; - /// /// Represents a Google Cloud Messaging notification. /// diff --git a/src/Microsoft.Azure.NotificationHubs/INamespaceManager.cs b/src/Microsoft.Azure.NotificationHubs/INamespaceManager.cs index 799dd2b..21ccd3d 100644 --- a/src/Microsoft.Azure.NotificationHubs/INamespaceManager.cs +++ b/src/Microsoft.Azure.NotificationHubs/INamespaceManager.cs @@ -10,34 +10,192 @@ namespace Microsoft.Azure.NotificationHubs { + /// + /// Represents a namespace manager + /// public interface INamespaceManager { + /// + /// Creates a notification hub. + /// + /// The notification hub description. + /// An instance of the class NotificationHubDescription CreateNotificationHub(NotificationHubDescription description); + + /// + /// Creates a notification hub. + /// + /// The notification hub description name. + /// An instance of the class NotificationHubDescription CreateNotificationHub(string hubName); + + /// + /// Creates the notification hub asynchronously. + /// + /// The notification hub description. + /// A task that represents the asynchronous create hub operation Task CreateNotificationHubAsync(NotificationHubDescription description); + + /// + /// Creates the notification hub asynchronously. + /// + /// The notification hub description. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous create hub operation Task CreateNotificationHubAsync(NotificationHubDescription description, CancellationToken cancellationToken); + + /// + /// Creates a notification hub. + /// + /// The notification hub description name. + /// An instance of the class Task CreateNotificationHubAsync(string hubName); + + /// + /// Creates a notification hub. + /// + /// The notification hub description name. + /// A to observe while waiting for a task to complete. + /// An instance of the class Task CreateNotificationHubAsync(string hubName, CancellationToken cancellationToken); + + /// + /// Delete the notification hub. + /// + /// The notification hub path. void DeleteNotificationHub(string path); + + /// + /// Delete the notification hub. + /// + /// The notification hub path. Task DeleteNotificationHubAsync(string path); + + /// + /// Delete the notification hub. + /// + /// A to observe while waiting for a task to complete. + /// The notification hub path. Task DeleteNotificationHubAsync(string path, CancellationToken cancellationToken); + + /// + /// Gets the notification hub. + /// + /// The notification hub path. + /// A notification hub description object. NotificationHubDescription GetNotificationHub(string path); + + /// + /// Gets the notification hub asynchronously. + /// + /// The notification hub path. + /// A task that represents the asynchronous get hub operation Task GetNotificationHubAsync(string path); + + /// + /// Gets the notification hub asynchronously. + /// + /// The notification hub path. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous get hub operation Task GetNotificationHubAsync(string path, CancellationToken cancellationToken); + + /// Gets the notification hub job asynchronously. + /// The job identifier. + /// The notification hub path. + /// A task that represents the asynchronous get job operation Task GetNotificationHubJobAsync(string jobId, string notificationHubPath); + + /// Gets the notification hub job asynchronously. + /// The job identifier. + /// The notification hub path. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous get job operation Task GetNotificationHubJobAsync(string jobId, string notificationHubPath, CancellationToken cancellationToken); + + /// Gets the notification hub jobs asynchronously. + /// The notification hub path. + /// A task that represents the asynchronous get jobs operation Task> GetNotificationHubJobsAsync(string notificationHubPath); + + /// Gets the notification hub jobs asynchronously. + /// The notification hub path. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous get jobs operation Task> GetNotificationHubJobsAsync(string notificationHubPath, CancellationToken cancellationToken); + + /// + /// Gets the notification hubs. + /// + /// A collection of notification hubs IEnumerable GetNotificationHubs(); + + /// + /// Gets the notification hubs asynchronously. + /// + /// A task that represents the asynchronous get hubs operation Task> GetNotificationHubsAsync(); + + /// + /// Gets the notification hubs asynchronously. + /// + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous get hubs operation Task> GetNotificationHubsAsync(CancellationToken cancellationToken); + + /// Checks whether a notifications hub exists. + /// The notification hub path. + /// True if the hub exists bool NotificationHubExists(string path); + + /// + /// Checks whether a notification hub exists asynchronously. + /// + /// The notification hub path. + /// A task that represents the asynchronous hub check operation Task NotificationHubExistsAsync(string path); + + /// + /// Checks whether a notification hub exists asynchronously. + /// + /// The notification hub path. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous hub check operation Task NotificationHubExistsAsync(string path, CancellationToken cancellationToken); + + /// Submits the notification hub job asynchronously. + /// The job to submit. + /// The notification hub path. + /// A task that represents the asynchronous get job operation Task SubmitNotificationHubJobAsync(NotificationHubJob job, string notificationHubPath); + + /// Submits the notification hub job asynchronously. + /// The job to submit. + /// The notification hub path.\ + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous get job operation Task SubmitNotificationHubJobAsync(NotificationHubJob job, string notificationHubPath, CancellationToken cancellationToken); + + /// + /// Updates the notification hub. + /// + /// The notification hub description. + /// The updated hub object NotificationHubDescription UpdateNotificationHub(NotificationHubDescription description); + + /// + /// Updates the notification hub asynchronously. + /// + /// The description. + /// A task that represents the asynchronous hub update operation Task UpdateNotificationHubAsync(NotificationHubDescription description); + + /// + /// Updates the notification hub asynchronously. + /// + /// The description. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous hub update operation Task UpdateNotificationHubAsync(NotificationHubDescription description, CancellationToken cancellationToken); } } \ No newline at end of file diff --git a/src/Microsoft.Azure.NotificationHubs/INotificationHubClient.cs b/src/Microsoft.Azure.NotificationHubs/INotificationHubClient.cs index 70d4e33..5f50044 100644 --- a/src/Microsoft.Azure.NotificationHubs/INotificationHubClient.cs +++ b/src/Microsoft.Azure.NotificationHubs/INotificationHubClient.cs @@ -11,167 +11,1686 @@ namespace Microsoft.Azure.NotificationHubs { + /// + /// Represents a notification hub client. + /// public interface INotificationHubClient { + /// + /// Gets or sets a value indicating whether the client enables a test send. + /// + /// + /// true if the client enables a test send; otherwise, false. + /// + /// + /// When test send is enabled, the following occurs: + ///
  • All notifications only reach up to 10 devices for each send call.
  • The Send* methods return a list of the outcomes for all those notification deliveries. The possible outcomes are + /// the same as displayed in telemetry. Outcomes includes things like authentication errors, throttling errors, successful deliveries, + /// and so on.

This mode is for test purposes only, not for production, and is throttled.

+ ///
bool EnableTestSend { get; } + /// + /// Cancels the notification asynchronously. + /// + /// The scheduled notification identifier. + /// A task that represents the asynchronous operation. Task CancelNotificationAsync(string scheduledNotificationId); + + /// + /// Cancels the notification asynchronously. + /// + /// The scheduled notification identifier. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. Task CancelNotificationAsync(string scheduledNotificationId, CancellationToken cancellationToken); + + /// + /// Asynchronously creates a native administrative registration. + /// + /// The administrative registration identifier. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmNativeRegistrationAsync(string admRegistrationId); + + /// + /// Asynchronously creates a native administrative registration. + /// + /// The administrative registration identifier. + /// A to observe while waiting for a task to complete. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmNativeRegistrationAsync(string admRegistrationId, CancellationToken cancellationToken); + + /// + /// Asynchronously creates a native administrative registration. + /// + /// The administrative registration identifier. + /// The tags for the registration. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmNativeRegistrationAsync(string admRegistrationId, IEnumerable tags); + + /// + /// Asynchronously creates a native administrative registration. + /// + /// The administrative registration identifier. + /// The tags for the registration. + /// A to observe while waiting for a task to complete. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmNativeRegistrationAsync(string admRegistrationId, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously creates an administrative template registration. + /// + /// The administrative registration identifier. + /// The JSON payload. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmTemplateRegistrationAsync(string admRegistrationId, string jsonPayload); + + /// + /// Asynchronously creates an administrative template registration. + /// + /// The administrative registration identifier. + /// The JSON payload. + /// A to observe while waiting for a task to complete. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmTemplateRegistrationAsync(string admRegistrationId, string jsonPayload, CancellationToken cancellationToken); + + /// + /// Asynchronously creates an administrative template registration. + /// + /// The administrative registration identifier. + /// The JSON payload. + /// The tags. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmTemplateRegistrationAsync(string admRegistrationId, string jsonPayload, IEnumerable tags); + + /// + /// Asynchronously creates an administrative template registration. + /// + /// The administrative registration identifier. + /// The JSON payload. + /// The tags. + /// A to observe while waiting for a task to complete. + /// + /// The task object representing the asynchronous operation. + /// Task CreateAdmTemplateRegistrationAsync(string admRegistrationId, string jsonPayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously creates an Apple native registration. + /// + /// The device token. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleNativeRegistrationAsync(string deviceToken); + + /// + /// Asynchronously creates an Apple native registration. + /// + /// The device token. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleNativeRegistrationAsync(string deviceToken, CancellationToken cancellationToken); + + /// + /// Asynchronously creates an Apple native registration. + /// + /// The device token. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleNativeRegistrationAsync(string deviceToken, IEnumerable tags); + + /// + /// Asynchronously creates an Apple native registration. + /// + /// The device token. + /// The tags. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleNativeRegistrationAsync(string deviceToken, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously creates an Apple template registration. To specify additional properties at creation, use the method. + /// + /// The device token. + /// The JSON payload. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleTemplateRegistrationAsync(string deviceToken, string jsonPayload); + + /// + /// Asynchronously creates an Apple template registration. To specify additional properties at creation, use the method. + /// + /// The device token. + /// The JSON payload. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleTemplateRegistrationAsync(string deviceToken, string jsonPayload, CancellationToken cancellationToken); + + /// + /// Asynchronously creates an Apple template registration. To specify additional properties at creation, use the method. + /// + /// The device token. + /// The JSON payload. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleTemplateRegistrationAsync(string deviceToken, string jsonPayload, IEnumerable tags); + + /// + /// Asynchronously creates an Apple template registration. To specify additional properties at creation, use the method. + /// + /// The device token. + /// The JSON payload. + /// The tags. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateAppleTemplateRegistrationAsync(string deviceToken, string jsonPayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Creates the baidu native registration asynchronously. + /// + /// The user identifier. + /// The channel identifier. + /// A task that represents the asynchronous operation. Task CreateBaiduNativeRegistrationAsync(string userId, string channelId); + + /// + /// Creates the baidu native registration asynchronously. + /// + /// The user identifier. + /// The channel identifier. + /// The tags. + /// A task that represents the asynchronous operation. Task CreateBaiduNativeRegistrationAsync(string userId, string channelId, IEnumerable tags); + + /// + /// Creates the baidu template registration asynchronously. + /// + /// The user identifier. + /// The channel identifier. + /// The json payload. + /// A task that represents the asynchronous operation. Task CreateBaiduTemplateRegistrationAsync(string userId, string channelId, string jsonPayload); + + /// + /// Creates the baidu template registration asynchronously. + /// + /// The user identifier. + /// The channel identifier. + /// The json payload. + /// The tags. + /// A task that represents the asynchronous operation. Task CreateBaiduTemplateRegistrationAsync(string userId, string channelId, string jsonPayload, IEnumerable tags); + + /// + /// Asynchronously creates FCM native registration. + /// + /// The FCM registration ID. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmNativeRegistrationAsync(string fcmRegistrationId); + + /// + /// Asynchronously creates FCM native registration. + /// + /// The FCM registration ID. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmNativeRegistrationAsync(string fcmRegistrationId, CancellationToken cancellationToken); + + /// + /// Asynchronously creates FCM native registration. + /// + /// The FCM registration ID. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmNativeRegistrationAsync(string fcmRegistrationId, IEnumerable tags); + + /// + /// Asynchronously creates FCM native registration. + /// + /// The FCM registration ID. + /// The tags. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmNativeRegistrationAsync(string fcmRegistrationId, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously creates FCM template registration. + /// + /// The FCM registration ID. + /// The JSON payload. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmTemplateRegistrationAsync(string fcmRegistrationId, string jsonPayload); + + /// + /// Asynchronously creates FCM template registration. + /// + /// The FCM registration ID. + /// The JSON payload. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmTemplateRegistrationAsync(string fcmRegistrationId, string jsonPayload, CancellationToken cancellationToken); + + /// + /// Asynchronously creates FCM template registration. + /// + /// The FCM registration ID. + /// The JSON payload. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmTemplateRegistrationAsync(string fcmRegistrationId, string jsonPayload, IEnumerable tags); + + /// + /// Asynchronously creates FCM template registration. + /// + /// The FCM registration ID. + /// The JSON payload. + /// The tags. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateFcmTemplateRegistrationAsync(string fcmRegistrationId, string jsonPayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously creates MPNS native registration. + /// + /// The channel URI. + /// + /// The task that completes the asynchronous operation. + /// Task CreateMpnsNativeRegistrationAsync(string channelUri); + + /// + /// Asynchronously creates MPNS native registration. + /// + /// The channel URI. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateMpnsNativeRegistrationAsync(string channelUri, IEnumerable tags); + + /// + /// Asynchronously creates MPNS template registration. To specify additional properties at creation, use the method. + /// + /// The channel URI. + /// The XML template. + /// + /// The task that completes the asynchronous operation. + /// Task CreateMpnsTemplateRegistrationAsync(string channelUri, string xmlTemplate); + + /// + /// Asynchronously creates MPNS template registration. To specify additional properties at creation, use the method. + /// + /// The channel URI. + /// The XML template. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateMpnsTemplateRegistrationAsync(string channelUri, string xmlTemplate, IEnumerable tags); + + /// + /// Creates or updates a device installation. + /// + /// The device installation object. void CreateOrUpdateInstallation(Installation installation); + + /// + /// Creates or updates a device installation asynchronously. + /// + /// The device installation object. + /// A task that represents the asynchronous operation. + /// Thrown when the installation object is null + /// InstallationId must be specified Task CreateOrUpdateInstallationAsync(Installation installation); + + /// + /// Creates or updates a device installation asynchronously. + /// + /// The device installation object. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. + /// Thrown when the installation object is null + /// InstallationId must be specified Task CreateOrUpdateInstallationAsync(Installation installation, CancellationToken cancellationToken); + + /// + /// Asynchronously creates or updates the client registration. + /// + /// The type of registration. + /// The registration to be created or updated. + /// + /// The task object representing the asynchronous operation. + /// + /// Thrown when RegistrationId object is null Task CreateOrUpdateRegistrationAsync(T registration) where T : RegistrationDescription; + + /// + /// Asynchronously creates or updates the client registration. + /// + /// The type of registration. + /// The registration to be created or updated. + /// A to observe while waiting for a task to complete. + /// + /// The task object representing the asynchronous operation. + /// + /// Thrown when RegistrationId object is null Task CreateOrUpdateRegistrationAsync(T registration, CancellationToken cancellationToken) where T : RegistrationDescription; + + /// + /// Asynchronously creates a registration. + /// + /// The type of registration. + /// The registration to create. + /// + /// The task that completes the asynchronous operation. + /// + /// + /// NotificationHubPath in RegistrationDescription is not valid. + /// or + /// RegistrationId should be null or empty + /// Task CreateRegistrationAsync(T registration) where T : RegistrationDescription; + + /// + /// Asynchronously creates a registration. + /// + /// The type of registration. + /// The registration to create. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// + /// + /// NotificationHubPath in RegistrationDescription is not valid. + /// or + /// RegistrationId should be null or empty + /// Task CreateRegistrationAsync(T registration, CancellationToken cancellationToken) where T : RegistrationDescription; + + /// + /// Asynchronously creates a registration identifier. + /// + /// + /// The task object representing the asynchronous operation. + /// Task CreateRegistrationIdAsync(); + + /// + /// Asynchronously creates a registration identifier. + /// + /// A to observe while waiting for a task to complete. + /// + /// The task object representing the asynchronous operation. + /// Task CreateRegistrationIdAsync(CancellationToken cancellationToken); + + /// + /// Asynchronously creates Windows native registration. + /// + /// The channel URI. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsNativeRegistrationAsync(string channelUri); + + /// + /// Asynchronously creates Windows native registration. + /// + /// The channel URI. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsNativeRegistrationAsync(string channelUri, CancellationToken cancellationToken); + + /// + /// Asynchronously creates Windows native registration. + /// + /// The channel URI. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsNativeRegistrationAsync(string channelUri, IEnumerable tags); + + /// + /// Asynchronously creates Windows native registration. + /// + /// The channel URI. + /// The tags. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsNativeRegistrationAsync(string channelUri, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously creates Windows template registration. + /// + /// The channel URI. + /// The XML template. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsTemplateRegistrationAsync(string channelUri, string xmlTemplate); + + /// + /// Asynchronously creates Windows template registration. + /// + /// The channel URI. + /// The XML template. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsTemplateRegistrationAsync(string channelUri, string xmlTemplate, CancellationToken cancellationToken); + + /// + /// Asynchronously creates Windows template registration. + /// + /// The channel URI. + /// The XML template. + /// The tags. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsTemplateRegistrationAsync(string channelUri, string xmlTemplate, IEnumerable tags); + + /// + /// Asynchronously creates Windows template registration. + /// + /// The channel URI. + /// The XML template. + /// The tags. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task CreateWindowsTemplateRegistrationAsync(string channelUri, string xmlTemplate, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Deletes the installation. + /// + /// The installation identifier. void DeleteInstallation(string installationId); + + /// + /// Deletes the installation asynchronously. + /// + /// The installation identifier. + /// A task that represents the asynchronous operation. + /// Thrown when the installationId object is null Task DeleteInstallationAsync(string installationId); + + /// + /// Deletes the installation asynchronously. + /// + /// The installation identifier. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. + /// Thrown when the installationId object is null Task DeleteInstallationAsync(string installationId, CancellationToken cancellationToken); + + /// + /// Asynchronously deletes the registration. + /// + /// The registration to delete. + /// + /// The task that completes the asynchronous operation. + /// + /// Thrown when registration object is null. Task DeleteRegistrationAsync(RegistrationDescription registration); + + /// + /// Asynchronously deletes the registration. + /// + /// The registration to delete. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// + /// Thrown when registration object is null. Task DeleteRegistrationAsync(RegistrationDescription registration, CancellationToken cancellationToken); + + /// + /// Asynchronously deletes the registration. + /// + /// The registration ID. + /// + /// The task that completes the asynchronous operation. + /// Task DeleteRegistrationAsync(string registrationId); + + /// + /// Asynchronously deletes the registration. + /// + /// The registration ID. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task DeleteRegistrationAsync(string registrationId, CancellationToken cancellationToken); + + /// + /// Asynchronously deletes the registration. + /// + /// The registration ID. + /// The entity tag. + /// + /// The task that completes the asynchronous operation. + /// + /// registrationId Task DeleteRegistrationAsync(string registrationId, string etag); + + /// + /// Asynchronously deletes the registration. + /// + /// The registration ID. + /// The entity tag. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// + /// registrationId Task DeleteRegistrationAsync(string registrationId, string etag, CancellationToken cancellationToken); + + /// + /// Asynchronously deletes the registrations by channel. + /// + /// The PNS handle. + /// + /// The task that completes the asynchronous operation. + /// + /// pnsHandle Task DeleteRegistrationsByChannelAsync(string pnsHandle); + + /// + /// Asynchronously deletes the registrations by channel. + /// + /// The PNS handle. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// + /// pnsHandle Task DeleteRegistrationsByChannelAsync(string pnsHandle, CancellationToken cancellationToken); + + /// + /// Asynchronously retrieves all registrations in this notification hub. + /// + /// The location of the registration. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetAllRegistrationsAsync(int top); + + /// + /// Asynchronously retrieves all registrations in this notification hub. + /// + /// The location of the registration. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetAllRegistrationsAsync(int top, CancellationToken cancellationToken); + + /// + /// Asynchronously retrieves all registrations in this notification hub. + /// + /// The continuation token. + /// The location of the registration. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetAllRegistrationsAsync(string continuationToken, int top); + + /// + /// Asynchronously retrieves all registrations in this notification hub. + /// + /// The continuation token. + /// The location of the registration. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetAllRegistrationsAsync(string continuationToken, int top, CancellationToken cancellationToken); + + /// + /// Returns the base URI for the notification hub client. + /// + /// + /// The base URI of the notification hub. + /// Uri GetBaseUri(); + + /// + /// Gets the feedback container URI asynchronously. + /// + /// A task that represents the asynchronous operation. Task GetFeedbackContainerUriAsync(); + + /// + /// Gets the feedback container URI asynchronously. + /// + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. Task GetFeedbackContainerUriAsync(CancellationToken cancellationToken); + + /// + /// Gets a device installation object. + /// + /// The installation identifier. + /// The device installation object Installation GetInstallation(string installationId); + + /// + /// Gets the installation asynchronously. + /// + /// The installation identifier. + /// A task that represents the asynchronous operation. + /// Thrown when the installationId object is null Task GetInstallationAsync(string installationId); + + /// + /// Gets the installation asynchronously. + /// + /// The installation identifier. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. + /// Thrown when the installationId object is null Task GetInstallationAsync(string installationId, CancellationToken cancellationToken); + + /// + /// Given a jobId, returns the associated . This method + /// is used to get the status of the job to see if that job completed, failed, or is still in progress. + /// This API is only available for Standard namespaces. + /// + /// The jobId is returned after creating a new job using . + /// + /// The current state of the . + /// Task GetNotificationHubJobAsync(string jobId); + + /// + /// Given a jobId, returns the associated . This method + /// is used to get the status of the job to see if that job completed, failed, or is still in progress. + /// This API is only available for Standard namespaces. + /// + /// The jobId is returned after creating a new job using . + /// A to observe while waiting for a task to complete. + /// + /// The current state of the . + /// Task GetNotificationHubJobAsync(string jobId, CancellationToken cancellationToken); + + /// + /// Returns all known s. This method + /// is used to get the status of all job to see if those jobs completed, failed, or are still in progress. + /// This API is only available for Standard namespaces. + /// + /// + /// The current state of the s. + /// Task> GetNotificationHubJobsAsync(); + + /// + /// Returns all known s. This method + /// is used to get the status of all job to see if those jobs completed, failed, or are still in progress. + /// This API is only available for Standard namespaces. + /// + /// A to observe while waiting for a task to complete. + /// + /// The current state of the s. + /// Task> GetNotificationHubJobsAsync(CancellationToken cancellationToken); + + /// + /// Retrieves the results of a Send* operation. This can retrieve intermediate results if the send is being processed + /// or final results if the Send* has completed. This API can only be called for Standard namespaces. + /// + /// which was returned + /// when calling Send*. + /// + /// The result of the Send operation, as expressed by a . + /// + /// notificationId Task GetNotificationOutcomeDetailsAsync(string notificationId); + + /// + /// Retrieves the results of a Send* operation. This can retrieve intermediate results if the send is being processed + /// or final results if the Send* has completed. This API can only be called for Standard namespaces. + /// + /// which was returned + /// when calling Send*. + /// A to observe while waiting for a task to complete. + /// + /// The result of the Send operation, as expressed by a . + /// + /// notificationId Task GetNotificationOutcomeDetailsAsync(string notificationId, CancellationToken cancellationToken); + + /// + /// Asynchronously retrieves a registration with a given ID. The type of the registration depends upon the specified TRegistrationDescription parameter. + /// + /// The type of registration description. + /// The registration ID. + /// + /// The task that completes the asynchronous operation. + /// + /// Thrown when registrationId is null Task GetRegistrationAsync(string registrationId) where TRegistrationDescription : RegistrationDescription; + + /// + /// Asynchronously retrieves a registration with a given ID. The type of the registration depends upon the specified TRegistrationDescription parameter. + /// + /// The type of registration description. + /// The registration ID. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// + /// Thrown when registrationId is null Task GetRegistrationAsync(string registrationId, CancellationToken cancellationToken) where TRegistrationDescription : RegistrationDescription; + + /// + /// Asynchronously gets the registrations by channel. + /// + /// The PNS handle. + /// The location of the registration. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetRegistrationsByChannelAsync(string pnsHandle, int top); + + /// + /// Asynchronously gets the registrations by channel. + /// + /// The PNS handle. + /// The location of the registration. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetRegistrationsByChannelAsync(string pnsHandle, int top, CancellationToken cancellationToken); + + /// + /// Asynchronously gets the registrations by channel. + /// + /// The PNS handle. + /// The continuation token. + /// The location of the registration. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// + /// pnsHandle Task> GetRegistrationsByChannelAsync(string pnsHandle, string continuationToken, int top); + + /// + /// Asynchronously gets the registrations by channel. + /// + /// The PNS handle. + /// The continuation token. + /// The location of the registration. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// + /// pnsHandle Task> GetRegistrationsByChannelAsync(string pnsHandle, string continuationToken, int top, CancellationToken cancellationToken); + + /// + /// Asynchronously gets the registrations by tag. + /// + /// The tag. + /// The location where to get the registrations. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetRegistrationsByTagAsync(string tag, int top); + + /// + /// Asynchronously gets the registrations by tag. + /// + /// The tag. + /// The location where to get the registrations. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// Task> GetRegistrationsByTagAsync(string tag, int top, CancellationToken cancellationToken); + + /// + /// Asynchronously gets the registrations by tag. + /// + /// The tag. + /// The continuation token. + /// The location where to get the registrations. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// + /// Thrown when tag object is null Task> GetRegistrationsByTagAsync(string tag, string continuationToken, int top); + + /// + /// Asynchronously gets the registrations by tag. + /// + /// The tag. + /// The continuation token. + /// The location where to get the registrations. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation, which will contain a null or empty continuation token when there is no additional data available in the query. + /// + /// Thrown when tag object is null Task> GetRegistrationsByTagAsync(string tag, string continuationToken, int top, CancellationToken cancellationToken); + + /// + /// Determines whether the given installation exists based upon the installation identifier. + /// + /// The installation identifier. + /// true if the installation exists, else false. bool InstallationExists(string installationId); + + /// + /// Determines whether the given installation exists based upon the installation identifier. + /// + /// The installation identifier. + /// Returns a task which is true if the installation exists, else false. Task InstallationExistsAsync(string installationId); + + /// + /// Determines whether the given installation exists based upon the installation identifier. + /// + /// The installation identifier. + /// A to observe while waiting for a task to complete. + /// Returns a task which is true if the installation exists, else false. Task InstallationExistsAsync(string installationId, CancellationToken cancellationToken); + + /// + /// Patches the installation. + /// + /// The installation identifier. + /// The collection of update operations. void PatchInstallation(string installationId, IList operations); + + /// + /// Patches the installation asynchronously. + /// + /// The installation identifier. + /// The collection of update operations. + /// A task that represents the asynchronous operation. + /// + /// Thrown when the installationId or operations object is null + /// + /// Thrown when the operations list is empty Task PatchInstallationAsync(string installationId, IList operations); + + /// + /// Patches the installation asynchronously. + /// + /// The installation identifier. + /// The collection of update operations. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. + /// + /// Thrown when the installationId or operations object is null + /// + /// Thrown when the operations list is empty Task PatchInstallationAsync(string installationId, IList operations, CancellationToken cancellationToken); + + /// + /// Asynchronously indicates that the registration already exists. + /// + /// The registration ID. + /// + /// The task that completes the asynchronous operation. + /// Task RegistrationExistsAsync(string registrationId); + + /// + /// Asynchronously indicates that the registration already exists. + /// + /// The registration ID. + /// A to observe while waiting for a task to complete. + /// + /// The task that completes the asynchronous operation. + /// Task RegistrationExistsAsync(string registrationId, CancellationToken cancellationToken); + + /// + /// Schedules the notification asynchronously. + /// + /// The notification. + /// The scheduled time. + /// A task that represents the asynchronous operation. Task ScheduleNotificationAsync(Notification notification, DateTimeOffset scheduledTime); + + /// + /// Schedules the notification asynchronously. + /// + /// The notification. + /// The scheduled time. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. Task ScheduleNotificationAsync(Notification notification, DateTimeOffset scheduledTime, CancellationToken cancellationToken); + + /// + /// Schedules the notification asynchronously. + /// + /// The notification. + /// The scheduled time. + /// The tags. + /// A task that represents the asynchronous operation. + /// Thrown when tags object is null + /// tags argument should contain at least one tag Task ScheduleNotificationAsync(Notification notification, DateTimeOffset scheduledTime, IEnumerable tags); + + /// + /// Schedules the notification asynchronously. + /// + /// The notification. + /// The scheduled time. + /// The tags. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. + /// Thrown when tags object is null + /// tags argument should contain at least one tag Task ScheduleNotificationAsync(Notification notification, DateTimeOffset scheduledTime, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Schedules the notification asynchronously. + /// + /// The notification. + /// The scheduled time. + /// The tag expression. + /// A task that represents the asynchronous operation. Task ScheduleNotificationAsync(Notification notification, DateTimeOffset scheduledTime, string tagExpression); + + /// + /// Schedules the notification asynchronously. + /// + /// The notification. + /// The scheduled time. + /// The tag expression. + /// A to observe while waiting for a task to complete. + /// A task that represents the asynchronous operation. Task ScheduleNotificationAsync(Notification notification, DateTimeOffset scheduledTime, string tagExpression, CancellationToken cancellationToken); + + /// + /// Sends the Amazon Device Messaging (ADM) native notification. + /// + /// A valid, ADM JSON payload, described in detail here. + /// + /// which describes the result of the Send operation. + /// Task SendAdmNativeNotificationAsync(string jsonPayload); + + /// + /// Sends the Amazon Device Messaging (ADM) native notification. + /// + /// A valid, ADM JSON payload, described in detail here. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendAdmNativeNotificationAsync(string jsonPayload, CancellationToken cancellationToken); + + /// + /// Sends the Amazon Device Messaging (ADM) native notification. + /// + /// A valid, ADM JSON payload, described in detail here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// Task SendAdmNativeNotificationAsync(string jsonPayload, IEnumerable tags); + + /// + /// Sends the Amazon Device Messaging (ADM) native notification. + /// + /// A valid, ADM JSON payload, described in detail here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendAdmNativeNotificationAsync(string jsonPayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Sends the Amazon Device Messaging (ADM) native notification. + /// + /// A valid, ADM JSON payload, described in detail here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// Task SendAdmNativeNotificationAsync(string jsonPayload, string tagExpression); + + /// + /// Sends the Amazon Device Messaging (ADM) native notification. + /// + /// A valid, ADM JSON payload, described in detail here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendAdmNativeNotificationAsync(string jsonPayload, string tagExpression, CancellationToken cancellationToken); + + /// + /// Sends an Apple native notification. To specify an expiry, use the method. + /// + /// This is a valid Apple Push Notification Service (APNS) payload. + /// Documentation on the APNS payload can be found + /// here. + /// + /// which describes the result of the Send operation. + /// Task SendAppleNativeNotificationAsync(string jsonPayload); + + /// + /// Sends an Apple native notification. To specify an expiry, use the method. + /// + /// This is a valid Apple Push Notification Service (APNS) payload. + /// Documentation on the APNS payload can be found + /// here. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendAppleNativeNotificationAsync(string jsonPayload, CancellationToken cancellationToken); + + /// + /// Asynchronously sends an Apple native notification to a non-empty set of tags (maximum 20). This is equivalent to a tagged expression with boolean ORs ("||"). To specify an expiry, use the method. + /// + /// This is a valid Apple Push Notification Service (APNS) payload. + /// Documentation on the APNS payload can be found + /// here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// Task SendAppleNativeNotificationAsync(string jsonPayload, IEnumerable tags); + + /// + /// Asynchronously sends an Apple native notification to a non-empty set of tags (maximum 20). This is equivalent to a tagged expression with boolean ORs ("||"). To specify an expiry, use the method. + /// + /// This is a valid Apple Push Notification Service (APNS) payload. + /// Documentation on the APNS payload can be found + /// here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendAppleNativeNotificationAsync(string jsonPayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously sends an Apple native notification to a tag expression (a single tag "tag" is a valid tag expression). To specify an expiry, use the method. + /// + /// This is a valid Apple Push Notification Service (APNS) payload. + /// Documentation on the APNS payload can be found + /// here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// Task SendAppleNativeNotificationAsync(string jsonPayload, string tagExpression); + + /// + /// Asynchronously sends an Apple native notification to a tag expression (a single tag "tag" is a valid tag expression). To specify an expiry, use the method. + /// + /// This is a valid Apple Push Notification Service (APNS) payload. + /// Documentation on the APNS payload can be found + /// here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendAppleNativeNotificationAsync(string jsonPayload, string tagExpression, CancellationToken cancellationToken); + + /// + /// Sends a Baidu native notification. + /// + /// This is a json request. Baidu documents the format for the json here. + /// + /// which describes the result of the Send operation. + /// Task SendBaiduNativeNotificationAsync(string message); + + /// + /// Sends a Baidu native notification. + /// + /// This is a json request. Baidu documents the format for the json here. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendBaiduNativeNotificationAsync(string message, CancellationToken cancellationToken); + + /// + /// Sends Baidu native notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// This is a json request. Baidu documents the format for the json here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// Task SendBaiduNativeNotificationAsync(string message, IEnumerable tags); + + /// + /// Sends Baidu native notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// This is a json request. Baidu documents the format for the json here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendBaiduNativeNotificationAsync(string message, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Sends Baidu native notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// This is a json request. Baidu documents the format for the json here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// Task SendBaiduNativeNotificationAsync(string message, string tagExpression); + + /// + /// Sends Baidu native notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// This is a json request. Baidu documents the format for the json here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendBaiduNativeNotificationAsync(string message, string tagExpression, CancellationToken cancellationToken); + + /// + /// Sends a notification directly to all devices listed in deviceHandles (a valid tokens as expressed by the Notification type). + /// Users of this API do not use Registrations or Installations. Instead, users of this API manage all devices + /// on their own and use Azure Notification Hub solely as a pass through service to communicate with + /// the various Push Notification Services. + /// + /// A instance of a Notification, identifying which Push Notification Service to send to. + /// A list of valid device identifiers. + /// + /// + /// Thrown when notification or deviceHandles object is null + /// Task SendDirectNotificationAsync(Notification notification, IList deviceHandles); + + /// + /// Sends a notification directly to all devices listed in deviceHandles (a valid tokens as expressed by the Notification type). + /// Users of this API do not use Registrations or Installations. Instead, users of this API manage all devices + /// on their own and use Azure Notification Hub solely as a pass through service to communicate with + /// the various Push Notification Services. + /// + /// A instance of a Notification, identifying which Push Notification Service to send to. + /// A list of valid device identifiers. + /// A to observe while waiting for a task to complete. + /// + /// + /// Thrown when notification or deviceHandles object is null + /// Task SendDirectNotificationAsync(Notification notification, IList deviceHandles, CancellationToken cancellationToken); + + /// + /// Sends a notification directly to a deviceHandle (a valid token as expressed by the Notification type). + /// Users of this API do not use Registrations or Installations. Instead, users of this API manage all devices + /// on their own and use Azure Notification Hub solely as a pass through service to communicate with + /// the various Push Notification Services. + /// + /// A instance of a Notification, identifying which Push Notification Service to send to. + /// A valid device identifier. + /// + /// + /// Thrown when notification or deviceHandle object is null + /// Task SendDirectNotificationAsync(Notification notification, string deviceHandle); + + /// + /// Sends a notification directly to a deviceHandle (a valid token as expressed by the Notification type). + /// Users of this API do not use Registrations or Installations. Instead, users of this API manage all devices + /// on their own and use Azure Notification Hub solely as a pass through service to communicate with + /// the various Push Notification Services. + /// + /// A instance of a Notification, identifying which Push Notification Service to send to. + /// A valid device identifier. + /// A to observe while waiting for a task to complete. + /// + /// + /// Thrown when notification or deviceHandle object is null + /// Task SendDirectNotificationAsync(Notification notification, string deviceHandle, CancellationToken cancellationToken); + + /// + /// Sends Firebase Cloud Messaging (FCM) native notification. + /// + /// The JSON payload. Documentation on proper formatting of a FCM message can be found here. + /// + /// which describes the result of the Send operation. + /// Task SendFcmNativeNotificationAsync(string jsonPayload); + + /// + /// Sends Firebase Cloud Messaging (FCM) native notification. + /// + /// The JSON payload. Documentation on proper formatting of a FCM message can be found here. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendFcmNativeNotificationAsync(string jsonPayload, CancellationToken cancellationToken); + + /// + /// Sends a FCM native notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The JSON payload. Documentation on proper formatting of a FCM message can be found here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// Task SendFcmNativeNotificationAsync(string jsonPayload, IEnumerable tags); + + /// + /// Sends a FCM native notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The JSON payload. Documentation on proper formatting of a FCM message can be found here. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendFcmNativeNotificationAsync(string jsonPayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Sends FCM native notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// The JSON payload. Documentation on proper formatting of a FCM message can be found here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// Task SendFcmNativeNotificationAsync(string jsonPayload, string tagExpression); + + /// + /// Sends FCM native notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// The JSON payload. Documentation on proper formatting of a FCM message can be found here. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendFcmNativeNotificationAsync(string jsonPayload, string tagExpression, CancellationToken cancellationToken); + + /// + /// Sends a Microsoft Push Notification Service (MPNS) native notification. To specify headers for MPNS, use the method. + /// + /// The native payload. + /// + /// which describes the result of the Send operation. + /// Task SendMpnsNativeNotificationAsync(string nativePayload); + + /// + /// Sends a Microsoft Push Notification Service (MPNS) native notification. To specify headers for MPNS, use the method. + /// + /// The native payload. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendMpnsNativeNotificationAsync(string nativePayload, CancellationToken cancellationToken); + + /// + /// Sends a Microsoft Push Notification Service (MPNS) native notification to a non-empty set of tags (maximum 20). This is equivalent to a tag expression with boolean ORs ("||"). To specify headers for MPNS, use the method. + /// + /// The notification payload. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// Task SendMpnsNativeNotificationAsync(string nativePayload, IEnumerable tags); + + /// + /// Sends a Microsoft Push Notification Service (MPNS) native notification to a non-empty set of tags (maximum 20). This is equivalent to a tag expression with boolean ORs ("||"). To specify headers for MPNS, use the method. + /// + /// The notification payload. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendMpnsNativeNotificationAsync(string nativePayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Sends a Microsoft Push Notification Service (MPNS) native notification to a tag expression (a single tag "tag" is a valid tag expression). To specify headers for MPNS, use the method. + /// + /// The native payload. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// Task SendMpnsNativeNotificationAsync(string nativePayload, string tagExpression); + + /// + /// Sends a Microsoft Push Notification Service (MPNS) native notification to a tag expression (a single tag "tag" is a valid tag expression). To specify headers for MPNS, use the method. + /// + /// The native payload. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendMpnsNativeNotificationAsync(string nativePayload, string tagExpression, CancellationToken cancellationToken); + + /// + /// Sends a notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The notification to send. + /// + /// which describes the result of the Send operation. + /// + /// notification Task SendNotificationAsync(Notification notification); + + /// + /// Sends a notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The notification to send. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// + /// notification Task SendNotificationAsync(Notification notification, CancellationToken cancellationToken); + + /// + /// Asynchronously sends a notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The notification to send. + /// A non-empty set of tags (max 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// + /// + /// Thrown when notification or tag object is null + /// + /// + /// notification.Tag property should not be null + /// or + /// tags argument should contain at least one tag + /// Task SendNotificationAsync(Notification notification, IEnumerable tags); + + /// + /// Asynchronously sends a notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The notification to send. + /// A non-empty set of tags (max 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// + /// + /// Thrown when notification or tag object is null + /// + /// + /// notification.Tag property should not be null + /// or + /// tags argument should contain at least one tag + /// Task SendNotificationAsync(Notification notification, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Sends a notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// The notification to send. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// + /// notification + /// notification.Tag property should be null Task SendNotificationAsync(Notification notification, string tagExpression); + + /// + /// Sends a notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// The notification to send. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// + /// notification + /// notification.Tag property should be null Task SendNotificationAsync(Notification notification, string tagExpression, CancellationToken cancellationToken); + + /// + /// Sends a template notification. + /// + /// The properties to apply to the template. + /// + /// which describes the result of the Send operation. + /// Task SendTemplateNotificationAsync(IDictionary properties); + + /// + /// Sends a template notification. + /// + /// The properties to apply to the template. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendTemplateNotificationAsync(IDictionary properties, CancellationToken cancellationToken); + + /// + /// Sends a template notification to a non-empty set of tags (maximum 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The properties to apply to the template. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// Task SendTemplateNotificationAsync(IDictionary properties, IEnumerable tags); + + /// + /// Sends a template notification to a non-empty set of tags (maximum 20). This is equivalent to a tag expression with boolean ORs ("||"). + /// + /// The properties to apply to the template. + /// A non-empty set of tags (maximum 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendTemplateNotificationAsync(IDictionary properties, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Sends a template notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// The properties to apply to the template. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// Task SendTemplateNotificationAsync(IDictionary properties, string tagExpression); + + /// + /// Sends a template notification to a tag expression (a single tag "tag" is a valid tag expression). + /// + /// The properties to apply to the template. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendTemplateNotificationAsync(IDictionary properties, string tagExpression, CancellationToken cancellationToken); + + /// + /// Asynchronously sends a Windows native notification. To specify headers for WNS, use the method. + /// + /// The Windows native payload. This can be used to send any valid WNS notification, + /// including Tile, Toast, and Badge values, as described in the WNS documentation. + /// + /// which describes the result of the Send operation. + /// Task SendWindowsNativeNotificationAsync(string windowsNativePayload); + + /// + /// Asynchronously sends a Windows native notification. To specify headers for WNS, use the method. + /// + /// The Windows native payload. This can be used to send any valid WNS notification, + /// including Tile, Toast, and Badge values, as described in the WNS documentation. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendWindowsNativeNotificationAsync(string windowsNativePayload, CancellationToken cancellationToken); + + /// + /// Asynchronously sends a Windows native notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). To specify headers for WNS, use the method. + /// + /// The Windows native payload. This can be used to send any valid WNS notification, including Tile, Toast, and Badge values, as described in the WNS documentation. + /// A non-empty set of tags (max 20 tags). Each string in the set can contain a single tag. + /// + /// which describes the result of the Send operation. + /// Task SendWindowsNativeNotificationAsync(string windowsNativePayload, IEnumerable tags); + + /// + /// Asynchronously sends a Windows native notification to a non-empty set of tags (max 20). This is equivalent to a tag expression with boolean ORs ("||"). To specify headers for WNS, use the method. + /// + /// The Windows native payload. This can be used to send any valid WNS notification, including Tile, Toast, and Badge values, as described in the WNS documentation. + /// A non-empty set of tags (max 20 tags). Each string in the set can contain a single tag. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendWindowsNativeNotificationAsync(string windowsNativePayload, IEnumerable tags, CancellationToken cancellationToken); + + /// + /// Asynchronously sends a Windows native notification to a tag expression (a single tag "tag" is a valid tag expression). To specify headers for WNS, use the method. + /// + /// The Windows native payload. This can be used to send any valid WNS notification, including Tile, Toast, and Badge values, as described in the WNS documentation. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// + /// which describes the result of the Send operation. + /// Task SendWindowsNativeNotificationAsync(string windowsNativePayload, string tagExpression); + + /// + /// Asynchronously sends a Windows native notification to a tag expression (a single tag "tag" is a valid tag expression). To specify headers for WNS, use the method. + /// + /// The Windows native payload. This can be used to send any valid WNS notification, including Tile, Toast, and Badge values, as described in the WNS documentation. + /// A tag expression is any boolean expression constructed using the logical operators AND (&&), OR (||), NOT (!), and round parentheses. For example: (A || B) && !C. If an expression uses only ORs, it can contain at most 20 tags. Other expressions are limited to 6 tags. Note that a single tag "A" is a valid expression. + /// A to observe while waiting for a task to complete. + /// + /// which describes the result of the Send operation. + /// Task SendWindowsNativeNotificationAsync(string windowsNativePayload, string tagExpression, CancellationToken cancellationToken); + + /// + /// Creates a . This API is only + /// available for Standard namespaces. + /// + /// The to + /// export registrations, import registrations, or create registrations. + /// + /// The submitted s. + /// Task SubmitNotificationHubJobAsync(NotificationHubJob job); + + /// + /// Creates a . This API is only + /// available for Standard namespaces. + /// + /// The to + /// export registrations, import registrations, or create registrations. + /// A to observe while waiting for a task to complete. + /// + /// The submitted s. + /// Task SubmitNotificationHubJobAsync(NotificationHubJob job, CancellationToken cancellationToken); + + /// + /// Asynchronously updates the registration. + /// + /// The type of registration. + /// The registration to update. + /// + /// A task that will complete when the update finishes. + /// + /// + /// Thrown when RegistrationId or ETag object is null + /// Task UpdateRegistrationAsync(T registration) where T : RegistrationDescription; + + /// + /// Asynchronously updates the registration. + /// + /// The type of registration. + /// The registration to update. + /// A to observe while waiting for a task to complete. + /// + /// A task that will complete when the update finishes. + /// + /// + /// Thrown when RegistrationId or ETag object is null + /// Task UpdateRegistrationAsync(T registration, CancellationToken cancellationToken) where T : RegistrationDescription; } } \ No newline at end of file diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/BadRequestException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/BadRequestException.cs index c5cfda9..674796d 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/BadRequestException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/BadRequestException.cs @@ -4,11 +4,11 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Runtime.Serialization; - /// Exception for signaling bad request data errors. [Serializable] public class BadRequestException : MessagingException diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/Constants.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/Constants.cs index 00715cb..39517d3 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/Constants.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/Constants.cs @@ -4,10 +4,10 @@ // license information. //------------------------------------------------------------ +using System; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - static class Constants { public static readonly int MaximumTagSize = 120; diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/EntityDescriptionSerializer.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/EntityDescriptionSerializer.cs index 06bd969..6fe2eb1 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/EntityDescriptionSerializer.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/EntityDescriptionSerializer.cs @@ -4,16 +4,14 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using System.Xml; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.IO; - using System.Runtime.Serialization; - using System.Text; - using System.Xml; - using System.Collections.Generic; - using Microsoft.Azure.NotificationHubs; - internal class EntityDescriptionSerializer { const int MaxItemsInObjectGraph = 256; @@ -43,18 +41,26 @@ public EntityDescriptionSerializer() typeof(AppleTemplateRegistrationDescription).Name, this.CreateSerializer()); +#pragma warning disable CS0618 + this.entirySerializers.Add( typeof(GcmRegistrationDescription).Name, this.CreateSerializer()); +#pragma warning restore CS0618 + this.entirySerializers.Add( typeof(FcmRegistrationDescription).Name, this.CreateSerializer()); +#pragma warning disable CS0618 + this.entirySerializers.Add( typeof(GcmTemplateRegistrationDescription).Name, this.CreateSerializer()); +#pragma warning restore CS0618 + this.entirySerializers.Add( typeof(FcmTemplateRegistrationDescription).Name, this.CreateSerializer()); @@ -128,6 +134,8 @@ public string Serialize(EntityDescription description) return stringBuilder.ToString(); } +#pragma warning disable CS0618 + public void Serialize(EntityDescription description, XmlWriter writer) { // Convert FCM descriptions into their GCM counterparts @@ -154,6 +162,8 @@ public void Serialize(EntityDescription description, XmlWriter writer) serializer.WriteObject(writer, description); } +#pragma warning restore CS0618 + private DataContractSerializer GetSerializer(string typeName) { if (this.entirySerializers.TryGetValue(typeName, out var serializer)) diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/ExpressionEvaluator.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/ExpressionEvaluator.cs index 95a5867..dabe8bf 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/ExpressionEvaluator.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/ExpressionEvaluator.cs @@ -4,17 +4,14 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Runtime.Serialization; - using System.Text; - using System.Text.RegularExpressions; - using Microsoft.Azure.NotificationHubs; - using Microsoft.Azure.NotificationHubs.Common; - static class ExpressionEvaluator { public const string InternalBodyProperty = "READ_ONCE_BODY_PUSHNOTIFICATION"; diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingCommunicationException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingCommunicationException.cs index 16e87b0..cb7f384 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingCommunicationException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingCommunicationException.cs @@ -4,11 +4,11 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Runtime.Serialization; - /// /// Exception for signaling general communication errors related to messaging operations. /// diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityAlreadyExistsException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityAlreadyExistsException.cs index 2c58277..d6bc22d 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityAlreadyExistsException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityAlreadyExistsException.cs @@ -4,11 +4,11 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Runtime.Serialization; - /// Exception for signalling messaging entity already exists errors. [Serializable] public sealed class MessagingEntityAlreadyExistsException : MessagingException diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityNotFoundException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityNotFoundException.cs index f11d002..d8801d2 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityNotFoundException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingEntityNotFoundException.cs @@ -4,11 +4,11 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Runtime.Serialization; - /// Exception for signalling messaging entity not found errors. [Serializable] public sealed class MessagingEntityNotFoundException : MessagingException diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingException.cs index 1dc0e44..6127300 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingException.cs @@ -4,12 +4,12 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Collections; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Collections; - using System.Runtime.Serialization; - /// Exception for signalling messaging errors. /// Any class that derives from this should be added to Microsoft.Notifications.Messaging.MessagingExceptionHelper.ErrorCodes [Serializable] diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingExceptionDetail.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingExceptionDetail.cs index 77df3fd..58b7014 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingExceptionDetail.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/MessagingExceptionDetail.cs @@ -4,11 +4,11 @@ // license information. //------------------------------------------------------------ +using System; +using System.Net; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Net; - /// /// Details about the cause of a Messaging Exception that map errors to specific exceptions. /// diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/QuotaExceededException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/QuotaExceededException.cs index efff5d4..a668700 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/QuotaExceededException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/QuotaExceededException.cs @@ -4,11 +4,11 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Runtime.Serialization; - /// Exception for signaling quota exceeded errors. [Serializable] public class QuotaExceededException : MessagingException diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/ServerBusyException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/ServerBusyException.cs index e39bde5..a13eee6 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/ServerBusyException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/ServerBusyException.cs @@ -4,11 +4,11 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Runtime.Serialization; - /// /// The exception that is thrown when a server is busy. /// diff --git a/src/Microsoft.Azure.NotificationHubs/Messaging/UnauthorizedException.cs b/src/Microsoft.Azure.NotificationHubs/Messaging/UnauthorizedException.cs index 0843f11..45e31dd 100644 --- a/src/Microsoft.Azure.NotificationHubs/Messaging/UnauthorizedException.cs +++ b/src/Microsoft.Azure.NotificationHubs/Messaging/UnauthorizedException.cs @@ -4,11 +4,11 @@ // license information. //----------------------------------------------------------------------------- +using System; +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs.Messaging { - using System; - using System.Runtime.Serialization; - /// Exception for signaling authorization errors. [Serializable] public class UnauthorizedException : MessagingException diff --git a/src/Microsoft.Azure.NotificationHubs/Microsoft.Azure.NotificationHubs.csproj b/src/Microsoft.Azure.NotificationHubs/Microsoft.Azure.NotificationHubs.csproj index ae0bb70..c5b20a3 100644 --- a/src/Microsoft.Azure.NotificationHubs/Microsoft.Azure.NotificationHubs.csproj +++ b/src/Microsoft.Azure.NotificationHubs/Microsoft.Azure.NotificationHubs.csproj @@ -9,7 +9,7 @@ Microsoft.Azure.NotificationHubs 4.0.0 Microsoft - http://go.microsoft.com/fwlink/?LinkId=218949 + MIT https://aka.ms/NHNuget http://go.microsoft.com/fwlink/?LinkID=288890 true diff --git a/src/Microsoft.Azure.NotificationHubs/MpnsHeaderCollection.cs b/src/Microsoft.Azure.NotificationHubs/MpnsHeaderCollection.cs index 9ef1a47..6a6e4ef 100644 --- a/src/Microsoft.Azure.NotificationHubs/MpnsHeaderCollection.cs +++ b/src/Microsoft.Azure.NotificationHubs/MpnsHeaderCollection.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Provides a collection of MPNS header. /// diff --git a/src/Microsoft.Azure.NotificationHubs/MpnsNotification.cs b/src/Microsoft.Azure.NotificationHubs/MpnsNotification.cs index b199b0f..134f583 100644 --- a/src/Microsoft.Azure.NotificationHubs/MpnsNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/MpnsNotification.cs @@ -4,12 +4,12 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Xml; + namespace Microsoft.Azure.NotificationHubs -{ - using System; - using System.Collections.Generic; - using System.Xml; - +{ /// /// Provides notification for Microsoft Push Notification Service (MPNS). /// diff --git a/src/Microsoft.Azure.NotificationHubs/Notification.cs b/src/Microsoft.Azure.NotificationHubs/Notification.cs index c1ffbf5..18ebd68 100644 --- a/src/Microsoft.Azure.NotificationHubs/Notification.cs +++ b/src/Microsoft.Azure.NotificationHubs/Notification.cs @@ -4,11 +4,11 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Collections.Generic; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - /// /// Abstract class representing a generic notification hub notification, including the target tag. /// diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationDetails.cs b/src/Microsoft.Azure.NotificationHubs/NotificationDetails.cs index 534bf4e..ebfeae0 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationDetails.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationDetails.cs @@ -4,12 +4,12 @@ // license information. //------------------------------------------------------------ +using System; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents notification details /// diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationHubClient.cs b/src/Microsoft.Azure.NotificationHubs/NotificationHubClient.cs index d1dc236..d207298 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationHubClient.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationHubClient.cs @@ -1116,7 +1116,7 @@ public Task CreateOrUpdateInstallationAsync(Installation installation) /// InstallationId must be specified public async Task CreateOrUpdateInstallationAsync(Installation installation, CancellationToken cancellationToken) { - if (installation==null) + if (installation == null) { throw new ArgumentNullException(nameof(installation)); } @@ -3199,6 +3199,8 @@ private async Task> ReadEntitiesAsync(Stream source) wher xmlReader.ReadStartElement(); var entity = (TEntity)_entitySerializer.Deserialize(xmlReader, xmlReader.Name); +#pragma warning disable CS0618 + if (entity is GcmTemplateRegistrationDescription) { var fcmTemplateRegistrationDescription = new FcmTemplateRegistrationDescription(entity as GcmTemplateRegistrationDescription); @@ -3210,7 +3212,9 @@ private async Task> ReadEntitiesAsync(Stream source) wher var fcmRegistrationDescription = new FcmRegistrationDescription(entity as GcmRegistrationDescription); entity = (fcmRegistrationDescription as TEntity); } - + +#pragma warning restore CS0618 + result.Add(entity); } } @@ -3234,6 +3238,8 @@ private async Task ReadEntityAsync(Stream source) where TEntit var entity = _entitySerializer.Deserialize(xmlReader, xmlReader.Name); +#pragma warning disable CS0618 + if (typeof(GcmRegistrationDescription).IsAssignableFrom(typeof(TEntity))) { return (TEntity)entity; @@ -3251,6 +3257,8 @@ private async Task ReadEntityAsync(Stream source) where TEntit return (fcmRegistrationDescription as TEntity); } +#pragma warning restore CS0618 + return (TEntity)entity; } } @@ -3285,6 +3293,8 @@ private static void AddToQuery(UriBuilder uriBuilder, string query) } } +#pragma warning disable CS0618 + private static Notification FcmToGcmNotificationTypeCast(Notification notification) { if (notification.GetType().Name == "FcmNotification") @@ -3294,5 +3304,7 @@ private static Notification FcmToGcmNotificationTypeCast(Notification notificati return notification; } + +#pragma warning restore CS0618 } } diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationHubConnectionStringBuilder.cs b/src/Microsoft.Azure.NotificationHubs/NotificationHubConnectionStringBuilder.cs index 6ab4d25..c84d6d7 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationHubConnectionStringBuilder.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationHubConnectionStringBuilder.cs @@ -4,10 +4,10 @@ // license information. //------------------------------------------------------------ +using System; + namespace Microsoft.Azure.NotificationHubs { - using System; - /// /// This class can be used to construct a connection string to be used /// in creating messaging client entities. It can also be used to perform diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationHubJob.cs b/src/Microsoft.Azure.NotificationHubs/NotificationHubJob.cs index 37e25b2..b097427 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationHubJob.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationHubJob.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs -{ - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - +{ /// /// Allowed export/import job types when bulk registration operations are to be done /// diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryOptions.cs b/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryOptions.cs index f966c61..3ab6a09 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryOptions.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryOptions.cs @@ -4,10 +4,10 @@ // license information. //------------------------------------------------------------ +using System; + namespace Microsoft.Azure.NotificationHubs { - using System; - /// /// The set of options that can be specified to influence how /// retry attempts are made, and a failure is eligible to be retried. diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryPolicy.cs b/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryPolicy.cs index 402dc08..9b4375b 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryPolicy.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationHubRetryPolicy.cs @@ -4,15 +4,15 @@ // license information. //------------------------------------------------------------ +using System; +using System.ComponentModel; +using System.Runtime.ExceptionServices; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.ComponentModel; - using System.Runtime.ExceptionServices; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// An abstract representation of a policy to govern retrying of messaging operations. /// diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationHubSettings.cs b/src/Microsoft.Azure.NotificationHubs/NotificationHubSettings.cs index 29227b1..d3e0dc2 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationHubSettings.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationHubSettings.cs @@ -4,12 +4,12 @@ // license information. // ---------------------------------------------------------------- +using System; +using System.Net; +using System.Net.Http; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Net; - using System.Net.Http; - /// /// Notification Hubs client settings /// diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationOutcome.cs b/src/Microsoft.Azure.NotificationHubs/NotificationOutcome.cs index 3d9143d..17afa90 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationOutcome.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationOutcome.cs @@ -4,12 +4,12 @@ // license information. //------------------------------------------------------------ +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using Microsoft.Azure.NotificationHubs.Messaging; - using System.Collections.Generic; - using System.Runtime.Serialization; - /// /// Represents a notification outcome. /// diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationOutcomeCollection.cs b/src/Microsoft.Azure.NotificationHubs/NotificationOutcomeCollection.cs index 1a05fe5..1ae5f60 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationOutcomeCollection.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationOutcomeCollection.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Notification outcome dictionary /// diff --git a/src/Microsoft.Azure.NotificationHubs/NotificationPlatform.cs b/src/Microsoft.Azure.NotificationHubs/NotificationPlatform.cs index 45d5a0d..fd473be 100644 --- a/src/Microsoft.Azure.NotificationHubs/NotificationPlatform.cs +++ b/src/Microsoft.Azure.NotificationHubs/NotificationPlatform.cs @@ -4,10 +4,10 @@ // license information. //------------------------------------------------------------ +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs { - using System.Runtime.Serialization; - /// /// Supported Intallation Platforms /// diff --git a/src/Microsoft.Azure.NotificationHubs/PNSCredential.cs b/src/Microsoft.Azure.NotificationHubs/PNSCredential.cs index 959a1cd..1be677f 100644 --- a/src/Microsoft.Azure.NotificationHubs/PNSCredential.cs +++ b/src/Microsoft.Azure.NotificationHubs/PNSCredential.cs @@ -14,7 +14,9 @@ namespace Microsoft.Azure.NotificationHubs /// [DataContract(Name = ManagementStrings.PnsCredential, Namespace = ManagementStrings.Namespace)] [KnownType(typeof(ApnsCredential))] +#pragma warning disable CS0618 [KnownType(typeof(GcmCredential))] +#pragma warning restore CS0618 [KnownType(typeof(FcmCredential))] [KnownType(typeof(MpnsCredential))] [KnownType(typeof(WnsCredential))] diff --git a/src/Microsoft.Azure.NotificationHubs/PNSCredentialProperties.cs b/src/Microsoft.Azure.NotificationHubs/PNSCredentialProperties.cs index a75256e..2d319db 100644 --- a/src/Microsoft.Azure.NotificationHubs/PNSCredentialProperties.cs +++ b/src/Microsoft.Azure.NotificationHubs/PNSCredentialProperties.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Messaging; - /// /// Represents credential properties for a push notification service. /// diff --git a/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperation.cs b/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperation.cs index bc310c6..1e869ed 100644 --- a/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperation.cs +++ b/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperation.cs @@ -4,12 +4,12 @@ // license information. //------------------------------------------------------------ +using System.Collections.Generic; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + namespace Microsoft.Azure.NotificationHubs { - using System.Collections.Generic; - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - /// /// Patch an installation with this object /// diff --git a/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperationExtensions.cs b/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperationExtensions.cs index b60e16c..51c7a5c 100644 --- a/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperationExtensions.cs +++ b/src/Microsoft.Azure.NotificationHubs/PartialUpdateOperationExtensions.cs @@ -4,12 +4,12 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - internal static class PartialUpdateOperationExtensions { internal static string ToJson(this IList operations) diff --git a/src/Microsoft.Azure.NotificationHubs/PnsFeedback.cs b/src/Microsoft.Azure.NotificationHubs/PnsFeedback.cs index dce7539..eab0004 100644 --- a/src/Microsoft.Azure.NotificationHubs/PnsFeedback.cs +++ b/src/Microsoft.Azure.NotificationHubs/PnsFeedback.cs @@ -4,12 +4,12 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the PNS Feedback /// diff --git a/src/Microsoft.Azure.NotificationHubs/PublicKeyConstants.cs b/src/Microsoft.Azure.NotificationHubs/PublicKeyConstants.cs index 3137c7b..ffdc22b 100644 --- a/src/Microsoft.Azure.NotificationHubs/PublicKeyConstants.cs +++ b/src/Microsoft.Azure.NotificationHubs/PublicKeyConstants.cs @@ -39,6 +39,10 @@ public sealed class PublicKeyConstants /// Complete Phrase used in "InternalsVisibleTo" attribute in AssemblyInfo.cs /// public const string PublicKeyPhrase = ", PublicKey=" + PublicKeyValue; + + /// + /// Public Test Key Phrase. + /// public const string PublicTestKeyPhrase = ", PublicKey=" + PublicKeyTestValue; } } \ No newline at end of file diff --git a/src/Microsoft.Azure.NotificationHubs/RegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/RegistrationDescription.cs index 9d1bc2f..ad7017f 100644 --- a/src/Microsoft.Azure.NotificationHubs/RegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/RegistrationDescription.cs @@ -4,27 +4,28 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using System.Xml; +using Microsoft.Azure.NotificationHubs.Messaging; +using Newtonsoft.Json; namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Runtime.Serialization; - using System.Text; - using System.Text.RegularExpressions; - using System.Collections.Generic; - using System.Xml; - using Microsoft.Azure.NotificationHubs.Messaging; - using Newtonsoft.Json; - /// /// Represents a registration description. /// [DataContract(Namespace = ManagementStrings.Namespace)] +#pragma warning disable CS0618 [KnownType(typeof(GcmRegistrationDescription))] [KnownType(typeof(GcmTemplateRegistrationDescription))] +#pragma warning restore CS0618 [KnownType(typeof(FcmRegistrationDescription))] [KnownType(typeof(FcmTemplateRegistrationDescription))] [KnownType(typeof(AppleRegistrationDescription))] diff --git a/src/Microsoft.Azure.NotificationHubs/RegistrationResult.cs b/src/Microsoft.Azure.NotificationHubs/RegistrationResult.cs index 3dbbe94..bb86f30 100644 --- a/src/Microsoft.Azure.NotificationHubs/RegistrationResult.cs +++ b/src/Microsoft.Azure.NotificationHubs/RegistrationResult.cs @@ -4,11 +4,11 @@ // license information. //------------------------------------------------------------ +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the result of the registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/RegistrationSDKHelper.cs b/src/Microsoft.Azure.NotificationHubs/RegistrationSDKHelper.cs index ef5d11a..d1e6d37 100644 --- a/src/Microsoft.Azure.NotificationHubs/RegistrationSDKHelper.cs +++ b/src/Microsoft.Azure.NotificationHubs/RegistrationSDKHelper.cs @@ -4,15 +4,14 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Xml; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Xml; - using Microsoft.Azure.NotificationHubs; - internal static class RegistrationSDKHelper { internal const int TemplateMaxLength = 200; diff --git a/src/Microsoft.Azure.NotificationHubs/ScheduledNotification.cs b/src/Microsoft.Azure.NotificationHubs/ScheduledNotification.cs index 7826e75..bc74171 100644 --- a/src/Microsoft.Azure.NotificationHubs/ScheduledNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/ScheduledNotification.cs @@ -4,12 +4,12 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the scheduled . /// diff --git a/src/Microsoft.Azure.NotificationHubs/TemplateNotification.cs b/src/Microsoft.Azure.NotificationHubs/TemplateNotification.cs index 49302ee..35596d6 100644 --- a/src/Microsoft.Azure.NotificationHubs/TemplateNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/TemplateNotification.cs @@ -4,12 +4,12 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - /// /// Represents a template notification. /// diff --git a/src/Microsoft.Azure.NotificationHubs/UpdateOperationType.cs b/src/Microsoft.Azure.NotificationHubs/UpdateOperationType.cs index 5dd3545..bd080dd 100644 --- a/src/Microsoft.Azure.NotificationHubs/UpdateOperationType.cs +++ b/src/Microsoft.Azure.NotificationHubs/UpdateOperationType.cs @@ -4,10 +4,10 @@ // license information. //------------------------------------------------------------ +using System.Runtime.Serialization; + namespace Microsoft.Azure.NotificationHubs { - using System.Runtime.Serialization; - /// /// Update Operation Types /// diff --git a/src/Microsoft.Azure.NotificationHubs/WNSHeaderCollection.cs b/src/Microsoft.Azure.NotificationHubs/WNSHeaderCollection.cs index d83413f..804132a 100644 --- a/src/Microsoft.Azure.NotificationHubs/WNSHeaderCollection.cs +++ b/src/Microsoft.Azure.NotificationHubs/WNSHeaderCollection.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the collection of Windows Push Notification Services (WNS) headers. /// diff --git a/src/Microsoft.Azure.NotificationHubs/WindowsNotification.cs b/src/Microsoft.Azure.NotificationHubs/WindowsNotification.cs index 1118665..02367ce 100644 --- a/src/Microsoft.Azure.NotificationHubs/WindowsNotification.cs +++ b/src/Microsoft.Azure.NotificationHubs/WindowsNotification.cs @@ -4,12 +4,12 @@ // license information. //---------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Xml; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Xml; - /// /// Represents the Windows notification. /// diff --git a/src/Microsoft.Azure.NotificationHubs/WindowsPhoneRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/WindowsPhoneRegistrationDescription.cs index 81e76a5..3d61306 100644 --- a/src/Microsoft.Azure.NotificationHubs/WindowsPhoneRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/WindowsPhoneRegistrationDescription.cs @@ -4,14 +4,14 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the description of the MPNS registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/WindowsPhoneTemplateRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/WindowsPhoneTemplateRegistrationDescription.cs index 6ba5760..c83e4a5 100644 --- a/src/Microsoft.Azure.NotificationHubs/WindowsPhoneTemplateRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/WindowsPhoneTemplateRegistrationDescription.cs @@ -4,18 +4,18 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Runtime.Serialization; - using System.Runtime.Serialization.Json; - using System.Text; - using System.Xml; - using System.Xml.Linq; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Represents the description of the MPNS template registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/WindowsRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/WindowsRegistrationDescription.cs index 3ad7b72..58b8bde 100644 --- a/src/Microsoft.Azure.NotificationHubs/WindowsRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/WindowsRegistrationDescription.cs @@ -4,13 +4,13 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Provides description for Windows registration. /// @@ -147,7 +147,6 @@ internal WindowsRegistrationDescription(string notificationHubPath, Uri channelU /// /// Called when validate event occurs. /// - /// The version. /// internal override void OnValidate() { diff --git a/src/Microsoft.Azure.NotificationHubs/WindowsTemplateRegistrationDescription.cs b/src/Microsoft.Azure.NotificationHubs/WindowsTemplateRegistrationDescription.cs index 35898ab..f600dd5 100644 --- a/src/Microsoft.Azure.NotificationHubs/WindowsTemplateRegistrationDescription.cs +++ b/src/Microsoft.Azure.NotificationHubs/WindowsTemplateRegistrationDescription.cs @@ -4,17 +4,17 @@ // license information. //------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using Microsoft.Azure.NotificationHubs.Messaging; + namespace Microsoft.Azure.NotificationHubs { - using System; - using System.Collections.Generic; - using System.Runtime.Serialization; - using System.Runtime.Serialization.Json; - using System.Text; - using System.Xml; - using System.Xml.Linq; - using Microsoft.Azure.NotificationHubs.Messaging; - /// /// Provides description for Windows template registration. /// diff --git a/src/Microsoft.Azure.NotificationHubs/WnsSecondaryTile.cs b/src/Microsoft.Azure.NotificationHubs/WnsSecondaryTile.cs index 8b7bbe5..2f864dd 100644 --- a/src/Microsoft.Azure.NotificationHubs/WnsSecondaryTile.cs +++ b/src/Microsoft.Azure.NotificationHubs/WnsSecondaryTile.cs @@ -4,11 +4,11 @@ // license information. //------------------------------------------------------------ +using System.Collections.Generic; +using Newtonsoft.Json; + namespace Microsoft.Azure.NotificationHubs { - using System.Collections.Generic; - using Newtonsoft.Json; - /// /// Represents the WNS secondary tile ///