diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INamespacesOperations.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INamespacesOperations.cs
index ded99f2b0d7b..c34fd7fa4506 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INamespacesOperations.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INamespacesOperations.cs
@@ -164,7 +164,7 @@ public partial interface INamespacesOperations
/// The namespace name.
///
///
- /// Aauthorization Rule Name.
+ /// Authorization Rule Name.
///
///
/// The shared access authorization rule.
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsManagementClient.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsManagementClient.cs
index 192bfee7ad41..3ddd10078b42 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsManagementClient.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsManagementClient.cs
@@ -53,19 +53,20 @@ public partial interface INotificationHubsManagementClient : System.IDisposable
string ApiVersion { get; }
///
- /// Gets or sets the preferred language for the response.
+ /// The preferred language for the response.
///
string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running
- /// Operations. Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default
+ /// value is 30.
///
int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is generated
- /// and included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When
+ /// set to true a unique x-ms-client-request-id value is generated and
+ /// included in each request. Default is true.
///
bool? GenerateClientRequestId { get; set; }
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsOperations.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsOperations.cs
index e6e7b808df44..ec3301c86e33 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsOperations.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/INotificationHubsOperations.cs
@@ -85,6 +85,37 @@ public partial interface INotificationHubsOperations
///
Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string notificationHubName, NotificationHubCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Patch a NotificationHub in a namespace.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Parameters supplied to patch a NotificationHub Resource.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> PatchWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string notificationHubName, NotificationHubPatchParameters parameters = default(NotificationHubPatchParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Deletes a notification hub associated with a namespace.
///
///
@@ -138,6 +169,37 @@ public partial interface INotificationHubsOperations
///
Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string notificationHubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// test send a push notification
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Debug send parameters
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> DebugSendWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string notificationHubName, object parameters = default(object), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Creates/Updates an authorization rule for a NotificationHub
///
///
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ApnsCredential.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ApnsCredential.cs
index 3855f658dfc2..4bc16869536a 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ApnsCredential.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ApnsCredential.cs
@@ -32,18 +32,32 @@ public ApnsCredential()
///
/// Initializes a new instance of the ApnsCredential class.
///
- /// The APNS certificate.
- /// The certificate key.
- /// The endpoint of this credential.
- /// The Apns certificate Thumbprint
+ /// The APNS certificate. Specify if
+ /// using Certificate Authentication Mode.
+ /// The APNS certificate password if it
+ /// exists.
+ /// The APNS endpoint of this credential. If
+ /// using Certificate Authentication Mode and Sandbox specify
+ /// 'gateway.sandbox.push.apple.com'. If using Certificate
+ /// Authentication Mode and Production specify
+ /// 'gateway.push.apple.com'. If using Token Authentication Mode and
+ /// Sandbox specify
+ /// 'https://api.development.push.apple.com:443/3/device'. If using
+ /// Token Authentication Mode and Production specify
+ /// 'https://api.push.apple.com:443/3/device'.
+ /// The APNS certificate thumbprint. Specify
+ /// if using Certificate Authentication Mode.
/// A 10-character key identifier (kid) key,
- /// obtained from your developer account
- /// The name of the application
- /// The issuer (iss) registered claim key, whose
- /// value is your 10-character Team ID, obtained from your developer
- /// account
+ /// obtained from your developer account. Specify if using Token
+ /// Authentication Mode.
+ /// The name of the application or BundleId.
+ /// Specify if using Token Authentication Mode.
+ /// The issuer (iss) registered claim key. The
+ /// value is a 10-character TeamId, obtained from your developer
+ /// account. Specify if using Token Authentication Mode.
/// Provider Authentication Token, obtained through
- /// your developer account
+ /// your developer account. Specify if using Token Authentication
+ /// Mode.
public ApnsCredential(string apnsCertificate = default(string), string certificateKey = default(string), string endpoint = default(string), string thumbprint = default(string), string keyId = default(string), string appName = default(string), string appId = default(string), string token = default(string))
{
ApnsCertificate = apnsCertificate;
@@ -63,52 +77,64 @@ public ApnsCredential()
partial void CustomInit();
///
- /// Gets or sets the APNS certificate.
+ /// Gets or sets the APNS certificate. Specify if using Certificate
+ /// Authentication Mode.
///
[JsonProperty(PropertyName = "properties.apnsCertificate")]
public string ApnsCertificate { get; set; }
///
- /// Gets or sets the certificate key.
+ /// Gets or sets the APNS certificate password if it exists.
///
[JsonProperty(PropertyName = "properties.certificateKey")]
public string CertificateKey { get; set; }
///
- /// Gets or sets the endpoint of this credential.
+ /// Gets or sets the APNS endpoint of this credential. If using
+ /// Certificate Authentication Mode and Sandbox specify
+ /// 'gateway.sandbox.push.apple.com'. If using Certificate
+ /// Authentication Mode and Production specify
+ /// 'gateway.push.apple.com'. If using Token Authentication Mode and
+ /// Sandbox specify
+ /// 'https://api.development.push.apple.com:443/3/device'. If using
+ /// Token Authentication Mode and Production specify
+ /// 'https://api.push.apple.com:443/3/device'.
///
[JsonProperty(PropertyName = "properties.endpoint")]
public string Endpoint { get; set; }
///
- /// Gets or sets the Apns certificate Thumbprint
+ /// Gets or sets the APNS certificate thumbprint. Specify if using
+ /// Certificate Authentication Mode.
///
[JsonProperty(PropertyName = "properties.thumbprint")]
public string Thumbprint { get; set; }
///
/// Gets or sets a 10-character key identifier (kid) key, obtained from
- /// your developer account
+ /// your developer account. Specify if using Token Authentication Mode.
///
[JsonProperty(PropertyName = "properties.keyId")]
public string KeyId { get; set; }
///
- /// Gets or sets the name of the application
+ /// Gets or sets the name of the application or BundleId. Specify if
+ /// using Token Authentication Mode.
///
[JsonProperty(PropertyName = "properties.appName")]
public string AppName { get; set; }
///
- /// Gets or sets the issuer (iss) registered claim key, whose value is
- /// your 10-character Team ID, obtained from your developer account
+ /// Gets or sets the issuer (iss) registered claim key. The value is a
+ /// 10-character TeamId, obtained from your developer account. Specify
+ /// if using Token Authentication Mode.
///
[JsonProperty(PropertyName = "properties.appId")]
public string AppId { get; set; }
///
/// Gets or sets provider Authentication Token, obtained through your
- /// developer account
+ /// developer account. Specify if using Token Authentication Mode.
///
[JsonProperty(PropertyName = "properties.token")]
public string Token { get; set; }
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityParameters.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityParameters.cs
index 5cdc59ecafa4..b04b7a9d685f 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityParameters.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityParameters.cs
@@ -36,15 +36,15 @@ public CheckAvailabilityParameters()
/// class.
///
/// Resource name
- /// Resource location
/// Resource Id
/// Resource type
+ /// Resource location
/// Resource tags
/// The sku of the created namespace
/// True if the name is available and can be
/// used to create new Namespace/NotificationHub. Otherwise
/// false.
- public CheckAvailabilityParameters(string name, string location, string id = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), bool? isAvailiable = default(bool?))
+ public CheckAvailabilityParameters(string name, string id = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), bool? isAvailiable = default(bool?))
{
Id = id;
Name = name;
@@ -116,10 +116,6 @@ public virtual void Validate()
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name");
}
- if (Location == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "Location");
- }
if (Sku != null)
{
Sku.Validate();
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityResult.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityResult.cs
index 9f7feaef2765..5d0dd9208fe6 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityResult.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/CheckAvailabilityResult.cs
@@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.NotificationHubs.Models
using System.Linq;
///
- /// Description of a CheckAvailibility resource.
+ /// Description of a CheckAvailability resource.
///
public partial class CheckAvailabilityResult : Resource
{
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/DebugSendResponse.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/DebugSendResponse.cs
new file mode 100644
index 000000000000..074956ce4713
--- /dev/null
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/DebugSendResponse.cs
@@ -0,0 +1,89 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.NotificationHubs.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Description of a NotificationHub Resource.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class DebugSendResponse : Resource
+ {
+ ///
+ /// Initializes a new instance of the DebugSendResponse class.
+ ///
+ public DebugSendResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DebugSendResponse class.
+ ///
+ /// Resource Id
+ /// Resource name
+ /// Resource type
+ /// Resource location
+ /// Resource tags
+ /// The sku of the created namespace
+ /// successful send
+ /// send failure
+ /// actual failure description
+ public DebugSendResponse(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), double? success = default(double?), double? failure = default(double?), object results = default(object))
+ : base(id, name, type, location, tags, sku)
+ {
+ Success = success;
+ Failure = failure;
+ Results = results;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets successful send
+ ///
+ [JsonProperty(PropertyName = "properties.success")]
+ public double? Success { get; set; }
+
+ ///
+ /// Gets or sets send failure
+ ///
+ [JsonProperty(PropertyName = "properties.failure")]
+ public double? Failure { get; set; }
+
+ ///
+ /// Gets or sets actual failure description
+ ///
+ [JsonProperty(PropertyName = "properties.results")]
+ public object Results { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public override void Validate()
+ {
+ base.Validate();
+ }
+ }
+}
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ErrorResponse.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ErrorResponse.cs
index 7c410da20574..a59a5f4ec948 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ErrorResponse.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/ErrorResponse.cs
@@ -14,8 +14,9 @@ namespace Microsoft.Azure.Management.NotificationHubs.Models
using System.Linq;
///
- /// Error reponse indicates NotificationHubs service is not able to process
- /// the incoming request. The reason is provided in the error message.
+ /// Error response indicates NotificationHubs service is not able to
+ /// process the incoming request. The reason is provided in the error
+ /// message.
///
public partial class ErrorResponse
{
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/GcmCredential.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/GcmCredential.cs
index f254a3aebbed..8c8ab8481975 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/GcmCredential.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/GcmCredential.cs
@@ -32,7 +32,8 @@ public GcmCredential()
///
/// Initializes a new instance of the GcmCredential class.
///
- /// The GCM endpoint.
+ /// The FCM legacy endpoint. Default value is
+ /// 'https://fcm.googleapis.com/fcm/send'
/// The Google API key.
public GcmCredential(string gcmEndpoint = default(string), string googleApiKey = default(string))
{
@@ -47,7 +48,8 @@ public GcmCredential()
partial void CustomInit();
///
- /// Gets or sets the GCM endpoint.
+ /// Gets or sets the FCM legacy endpoint. Default value is
+ /// 'https://fcm.googleapis.com/fcm/send'
///
[JsonProperty(PropertyName = "properties.gcmEndpoint")]
public string GcmEndpoint { get; set; }
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/MpnsCredential.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/MpnsCredential.cs
index 5e686015960e..c7d028b3561d 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/MpnsCredential.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/MpnsCredential.cs
@@ -35,7 +35,7 @@ public MpnsCredential()
/// The MPNS certificate.
/// The certificate key for this
/// credential.
- /// The Mpns certificate Thumbprint
+ /// The MPNS certificate Thumbprint
public MpnsCredential(string mpnsCertificate = default(string), string certificateKey = default(string), string thumbprint = default(string))
{
MpnsCertificate = mpnsCertificate;
@@ -62,7 +62,7 @@ public MpnsCredential()
public string CertificateKey { get; set; }
///
- /// Gets or sets the Mpns certificate Thumbprint
+ /// Gets or sets the MPNS certificate Thumbprint
///
[JsonProperty(PropertyName = "properties.thumbprint")]
public string Thumbprint { get; set; }
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceCreateOrUpdateParameters.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceCreateOrUpdateParameters.cs
index 7fb988da0457..d5c15cbaaa06 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceCreateOrUpdateParameters.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceCreateOrUpdateParameters.cs
@@ -48,9 +48,10 @@ public NamespaceCreateOrUpdateParameters()
/// Namespace.
/// Specifies the targeted region in which the
/// namespace should be created. It can be any of the following values:
- /// Australia EastAustralia SoutheastCentral USEast USEast US 2West
- /// USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil
- /// SouthJapan EastJapan WestNorth EuropeWest Europe
+ /// Australia East, Australia Southeast, Central US, East US, East US
+ /// 2, West US, North Central US, South Central US, East Asia,
+ /// Southeast Asia, Brazil South, Japan East, Japan West, North Europe,
+ /// West Europe
/// Identifier for Azure Insights
/// metrics
/// Status of the namespace. It can be any of
@@ -111,9 +112,9 @@ public NamespaceCreateOrUpdateParameters()
///
/// Gets or sets specifies the targeted region in which the namespace
/// should be created. It can be any of the following values: Australia
- /// EastAustralia SoutheastCentral USEast USEast US 2West USNorth
- /// Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan
- /// EastJapan WestNorth EuropeWest Europe
+ /// East, Australia Southeast, Central US, East US, East US 2, West US,
+ /// North Central US, South Central US, East Asia, Southeast Asia,
+ /// Brazil South, Japan East, Japan West, North Europe, West Europe
///
[JsonProperty(PropertyName = "properties.region")]
public string Region { get; set; }
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceResource.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceResource.cs
index 1ef7918a4bcf..787e7e448277 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceResource.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NamespaceResource.cs
@@ -46,9 +46,10 @@ public NamespaceResource()
/// Namespace.
/// Specifies the targeted region in which the
/// namespace should be created. It can be any of the following values:
- /// Australia EastAustralia SoutheastCentral USEast USEast US 2West
- /// USNorth Central USSouth Central USEast AsiaSoutheast AsiaBrazil
- /// SouthJapan EastJapan WestNorth EuropeWest Europe
+ /// Australia East, Australia Southeast, Central US, East US, East US
+ /// 2, West US, North Central US, South Central US, East Asia,
+ /// Southeast Asia, Brazil South, Japan East, Japan West, North Europe,
+ /// West Europe
/// Identifier for Azure Insights
/// metrics
/// Status of the namespace. It can be any of
@@ -109,9 +110,9 @@ public NamespaceResource()
///
/// Gets or sets specifies the targeted region in which the namespace
/// should be created. It can be any of the following values: Australia
- /// EastAustralia SoutheastCentral USEast USEast US 2West USNorth
- /// Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan
- /// EastJapan WestNorth EuropeWest Europe
+ /// East, Australia Southeast, Central US, East US, East US 2, West US,
+ /// North Central US, South Central US, East Asia, Southeast Asia,
+ /// Brazil South, Japan East, Japan West, North Europe, West Europe
///
[JsonProperty(PropertyName = "properties.region")]
public string Region { get; set; }
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NotificationHubPatchParameters.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NotificationHubPatchParameters.cs
new file mode 100644
index 000000000000..4db7ecca33e0
--- /dev/null
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/Models/NotificationHubPatchParameters.cs
@@ -0,0 +1,148 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.NotificationHubs.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Parameters supplied to the patch NotificationHub operation.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class NotificationHubPatchParameters : Resource
+ {
+ ///
+ /// Initializes a new instance of the NotificationHubPatchParameters
+ /// class.
+ ///
+ public NotificationHubPatchParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the NotificationHubPatchParameters
+ /// class.
+ ///
+ /// Resource Id
+ /// Resource name
+ /// Resource type
+ /// Resource location
+ /// Resource tags
+ /// The sku of the created namespace
+ /// The
+ /// NotificationHub name.
+ /// The RegistrationTtl of the created
+ /// NotificationHub
+ /// The AuthorizationRules of the
+ /// created NotificationHub
+ /// The ApnsCredential of the created
+ /// NotificationHub
+ /// The WnsCredential of the created
+ /// NotificationHub
+ /// The GcmCredential of the created
+ /// NotificationHub
+ /// The MpnsCredential of the created
+ /// NotificationHub
+ /// The AdmCredential of the created
+ /// NotificationHub
+ /// The BaiduCredential of the created
+ /// NotificationHub
+ public NotificationHubPatchParameters(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string notificationHubPatchParametersName = default(string), string registrationTtl = default(string), IList authorizationRules = default(IList), ApnsCredential apnsCredential = default(ApnsCredential), WnsCredential wnsCredential = default(WnsCredential), GcmCredential gcmCredential = default(GcmCredential), MpnsCredential mpnsCredential = default(MpnsCredential), AdmCredential admCredential = default(AdmCredential), BaiduCredential baiduCredential = default(BaiduCredential))
+ : base(id, name, type, location, tags, sku)
+ {
+ NotificationHubPatchParametersName = notificationHubPatchParametersName;
+ RegistrationTtl = registrationTtl;
+ AuthorizationRules = authorizationRules;
+ ApnsCredential = apnsCredential;
+ WnsCredential = wnsCredential;
+ GcmCredential = gcmCredential;
+ MpnsCredential = mpnsCredential;
+ AdmCredential = admCredential;
+ BaiduCredential = baiduCredential;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the NotificationHub name.
+ ///
+ [JsonProperty(PropertyName = "properties.name")]
+ public string NotificationHubPatchParametersName { get; set; }
+
+ ///
+ /// Gets or sets the RegistrationTtl of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.registrationTtl")]
+ public string RegistrationTtl { get; set; }
+
+ ///
+ /// Gets or sets the AuthorizationRules of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.authorizationRules")]
+ public IList AuthorizationRules { get; set; }
+
+ ///
+ /// Gets or sets the ApnsCredential of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.apnsCredential")]
+ public ApnsCredential ApnsCredential { get; set; }
+
+ ///
+ /// Gets or sets the WnsCredential of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.wnsCredential")]
+ public WnsCredential WnsCredential { get; set; }
+
+ ///
+ /// Gets or sets the GcmCredential of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.gcmCredential")]
+ public GcmCredential GcmCredential { get; set; }
+
+ ///
+ /// Gets or sets the MpnsCredential of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.mpnsCredential")]
+ public MpnsCredential MpnsCredential { get; set; }
+
+ ///
+ /// Gets or sets the AdmCredential of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.admCredential")]
+ public AdmCredential AdmCredential { get; set; }
+
+ ///
+ /// Gets or sets the BaiduCredential of the created NotificationHub
+ ///
+ [JsonProperty(PropertyName = "properties.baiduCredential")]
+ public BaiduCredential BaiduCredential { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public override void Validate()
+ {
+ base.Validate();
+ }
+ }
+}
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperations.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperations.cs
index 5d22b1c6d602..46c2d2eb6851 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperations.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperations.cs
@@ -922,7 +922,7 @@ internal NamespacesOperations(NotificationHubsManagementClient client)
/// The namespace name.
///
///
- /// Aauthorization Rule Name.
+ /// Authorization Rule Name.
///
///
/// The shared access authorization rule.
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperationsExtensions.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperationsExtensions.cs
index 5057b56e6855..b66a161247d5 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperationsExtensions.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NamespacesOperationsExtensions.cs
@@ -249,7 +249,7 @@ public static NamespaceResource Get(this INamespacesOperations operations, strin
/// The namespace name.
///
///
- /// Aauthorization Rule Name.
+ /// Authorization Rule Name.
///
///
/// The shared access authorization rule.
@@ -272,7 +272,7 @@ public static SharedAccessAuthorizationRuleResource CreateOrUpdateAuthorizationR
/// The namespace name.
///
///
- /// Aauthorization Rule Name.
+ /// Authorization Rule Name.
///
///
/// The shared access authorization rule.
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsManagementClient.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsManagementClient.cs
index ec21cd723b00..19412c065daa 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsManagementClient.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsManagementClient.cs
@@ -59,19 +59,20 @@ public partial class NotificationHubsManagementClient : ServiceClient
- /// Gets or sets the preferred language for the response.
+ /// The preferred language for the response.
///
public string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running Operations.
- /// Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default value is
+ /// 30.
///
public int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is generated and
- /// included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When set to
+ /// true a unique x-ms-client-request-id value is generated and included in
+ /// each request. Default is true.
///
public bool? GenerateClientRequestId { get; set; }
@@ -90,6 +91,19 @@ public partial class NotificationHubsManagementClient : ServiceClient
public virtual INotificationHubsOperations NotificationHubs { get; private set; }
+ ///
+ /// Initializes a new instance of the NotificationHubsManagementClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling NotificationHubsManagementClient.Dispose(). False: will not dispose provided httpClient
+ protected NotificationHubsManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
+
///
/// Initializes a new instance of the NotificationHubsManagementClient class.
///
@@ -185,6 +199,33 @@ public NotificationHubsManagementClient(ServiceClientCredentials credentials, pa
}
}
+ ///
+ /// Initializes a new instance of the NotificationHubsManagementClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling NotificationHubsManagementClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public NotificationHubsManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
///
/// Initializes a new instance of the NotificationHubsManagementClient class.
///
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperations.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperations.cs
index 933fb37d15ab..245c69a4f674 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperations.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperations.cs
@@ -505,6 +505,221 @@ internal NotificationHubsOperations(NotificationHubsManagementClient client)
return _result;
}
+ ///
+ /// Patch a NotificationHub in a namespace.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Parameters supplied to patch a NotificationHub Resource.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string notificationHubName, NotificationHubPatchParameters parameters = default(NotificationHubPatchParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (namespaceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName");
+ }
+ if (notificationHubName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "notificationHubName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("namespaceName", namespaceName);
+ tracingParameters.Add("notificationHubName", notificationHubName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName));
+ _url = _url.Replace("{notificationHubName}", System.Uri.EscapeDataString(notificationHubName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// Deletes a notification hub associated with a namespace.
///
@@ -894,6 +1109,221 @@ internal NotificationHubsOperations(NotificationHubsManagementClient client)
return _result;
}
+ ///
+ /// test send a push notification
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Debug send parameters
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> DebugSendWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string notificationHubName, object parameters = default(object), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (namespaceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName");
+ }
+ if (notificationHubName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "notificationHubName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("namespaceName", namespaceName);
+ tracingParameters.Add("notificationHubName", notificationHubName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "DebugSend", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName));
+ _url = _url.Replace("{notificationHubName}", System.Uri.EscapeDataString(notificationHubName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 201)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// Creates/Updates an authorization rule for a NotificationHub
///
diff --git a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperationsExtensions.cs b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperationsExtensions.cs
index 061809545a1c..0a8924fd6571 100644
--- a/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperationsExtensions.cs
+++ b/sdk/notificationhubs/Microsoft.Azure.Management.NotificationHubs/src/Generated/NotificationHubsOperationsExtensions.cs
@@ -119,6 +119,58 @@ public static NotificationHubResource CreateOrUpdate(this INotificationHubsOpera
}
}
+ ///
+ /// Patch a NotificationHub in a namespace.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Parameters supplied to patch a NotificationHub Resource.
+ ///
+ public static NotificationHubResource Patch(this INotificationHubsOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, NotificationHubPatchParameters parameters = default(NotificationHubPatchParameters))
+ {
+ return operations.PatchAsync(resourceGroupName, namespaceName, notificationHubName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Patch a NotificationHub in a namespace.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Parameters supplied to patch a NotificationHub Resource.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task PatchAsync(this INotificationHubsOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, NotificationHubPatchParameters parameters = default(NotificationHubPatchParameters), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, namespaceName, notificationHubName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Deletes a notification hub associated with a namespace.
///
@@ -208,6 +260,58 @@ public static NotificationHubResource Get(this INotificationHubsOperations opera
}
}
+ ///
+ /// test send a push notification
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Debug send parameters
+ ///
+ public static DebugSendResponse DebugSend(this INotificationHubsOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, object parameters = default(object))
+ {
+ return operations.DebugSendAsync(resourceGroupName, namespaceName, notificationHubName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// test send a push notification
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The namespace name.
+ ///
+ ///
+ /// The notification hub name.
+ ///
+ ///
+ /// Debug send parameters
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DebugSendAsync(this INotificationHubsOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, object parameters = default(object), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.DebugSendWithHttpMessagesAsync(resourceGroupName, namespaceName, notificationHubName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Creates/Updates an authorization rule for a NotificationHub
///