diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperations.cs index 428bc0be3b81..66f13993e44f 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperations.cs @@ -1413,6 +1413,9 @@ internal DisasterRecoveryConfigsOperations(ServiceBusManagementClient client) /// /// The Disaster Recovery configuration name /// + /// + /// Parameters required to create an Alias(Disaster Recovery configuration) + /// /// /// Headers that will be added to request. /// @@ -1431,7 +1434,7 @@ internal DisasterRecoveryConfigsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task FailOverWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task FailOverWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, FailoverProperties parameters = default(FailoverProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1496,6 +1499,7 @@ internal DisasterRecoveryConfigsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "FailOver", tracingParameters); } @@ -1549,6 +1553,12 @@ internal DisasterRecoveryConfigsOperations(ServiceBusManagementClient client) // 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) { @@ -1717,7 +1727,7 @@ internal DisasterRecoveryConfigsOperations(ServiceBusManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); @@ -1970,7 +1980,7 @@ internal DisasterRecoveryConfigsOperations(ServiceBusManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); @@ -2224,7 +2234,7 @@ internal DisasterRecoveryConfigsOperations(ServiceBusManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}/listKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs index c7740f80f9f9..1c5c147b3800 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs @@ -311,9 +311,12 @@ public static void BreakPairing(this IDisasterRecoveryConfigsOperations operatio /// /// The Disaster Recovery configuration name /// - public static void FailOver(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias) + /// + /// Parameters required to create an Alias(Disaster Recovery configuration) + /// + public static void FailOver(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias, FailoverProperties parameters = default(FailoverProperties)) { - operations.FailOverAsync(resourceGroupName, namespaceName, alias).GetAwaiter().GetResult(); + operations.FailOverAsync(resourceGroupName, namespaceName, alias, parameters).GetAwaiter().GetResult(); } /// @@ -332,12 +335,15 @@ public static void FailOver(this IDisasterRecoveryConfigsOperations operations, /// /// The Disaster Recovery configuration name /// + /// + /// Parameters required to create an Alias(Disaster Recovery configuration) + /// /// /// The cancellation token. /// - public static async Task FailOverAsync(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task FailOverAsync(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias, FailoverProperties parameters = default(FailoverProperties), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.FailOverWithHttpMessagesAsync(resourceGroupName, namespaceName, alias, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.FailOverWithHttpMessagesAsync(resourceGroupName, namespaceName, alias, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/EventHubsOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/EventHubsOperationsExtensions.cs deleted file mode 100644 index 2883e0aec734..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/EventHubsOperationsExtensions.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// 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.ServiceBus -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for EventHubsOperations. - /// - public static partial class EventHubsOperationsExtensions - { - /// - /// Gets all the Event Hubs in a service bus Namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name - /// - public static IPage ListByNamespace(this IEventHubsOperations operations, string resourceGroupName, string namespaceName) - { - return operations.ListByNamespaceAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the Event Hubs in a service bus Namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name - /// - /// - /// The cancellation token. - /// - public static async Task> ListByNamespaceAsync(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByNamespaceWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all the Event Hubs in a service bus Namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByNamespaceNext(this IEventHubsOperations operations, string nextPageLink) - { - return operations.ListByNamespaceNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the Event Hubs in a service bus Namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByNamespaceNextAsync(this IEventHubsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByNamespaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IDisasterRecoveryConfigsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IDisasterRecoveryConfigsOperations.cs index a51700fe49ae..14236bca7280 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IDisasterRecoveryConfigsOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IDisasterRecoveryConfigsOperations.cs @@ -201,6 +201,10 @@ public partial interface IDisasterRecoveryConfigsOperations /// /// The Disaster Recovery configuration name /// + /// + /// Parameters required to create an Alias(Disaster Recovery + /// configuration) + /// /// /// The headers that will be added to request. /// @@ -213,7 +217,7 @@ public partial interface IDisasterRecoveryConfigsOperations /// /// Thrown when a required parameter is null /// - Task FailOverWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task FailOverWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, FailoverProperties parameters = default(FailoverProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the authorization rules for a namespace. /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs index 29a4a7d572bc..ee78dd6ae840 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs @@ -23,28 +23,6 @@ namespace Microsoft.Azure.Management.ServiceBus /// public partial interface INamespacesOperations { - /// - /// Check the give namespace name availability. - /// - /// - /// Parameters to check availability of the given namespace name - /// - /// - /// 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> CheckNameAvailabilityMethodWithHttpMessagesAsync(CheckNameAvailability parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the available namespaces within the subscription, /// irrespective of the resource groups. @@ -200,8 +178,7 @@ public partial interface INamespacesOperations /// Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, SBNamespaceUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the authorization rules for a namespace. - /// + /// Create or update NetworkRuleSet for a Namespace. /// /// /// Name of the Resource group within the Azure subscription. @@ -209,6 +186,9 @@ public partial interface INamespacesOperations /// /// The namespace name /// + /// + /// The Namespace IpFilterRule. + /// /// /// The headers that will be added to request. /// @@ -224,10 +204,9 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, NetworkRuleSet parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates an authorization rule for a namespace. - /// + /// Gets NetworkRuleSet for a Namespace. /// /// /// Name of the Resource group within the Azure subscription. @@ -235,11 +214,30 @@ public partial interface INamespacesOperations /// /// The namespace name /// - /// - /// The authorization rule name. + /// + /// The headers that will be added to request. /// - /// - /// The shared access authorization rule. + /// + /// 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> GetNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name /// /// /// The headers that will be added to request. @@ -256,10 +254,10 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNetworkRuleSetsWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a namespace authorization rule. - /// + /// Gets the authorization rules for a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -267,9 +265,6 @@ public partial interface INamespacesOperations /// /// The namespace name /// - /// - /// The authorization rule name. - /// /// /// The headers that will be added to request. /// @@ -279,13 +274,16 @@ public partial interface INamespacesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets an authorization rule for a namespace by rule name. - /// + /// Creates or updates an authorization rule for a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -296,6 +294,9 @@ public partial interface INamespacesOperations /// /// The authorization rule name. /// + /// + /// The shared access authorization rule. + /// /// /// The headers that will be added to request. /// @@ -311,11 +312,10 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the primary and secondary connection strings for the - /// namespace. - /// + /// Deletes a namespace authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -335,17 +335,13 @@ public partial interface INamespacesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Regenerates the primary or secondary connection strings for the - /// namespace. - /// + /// Gets an authorization rule for a namespace by rule name. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -356,9 +352,6 @@ public partial interface INamespacesOperations /// /// The authorization rule name. /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// The headers that will be added to request. /// @@ -374,9 +367,11 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// This operation Migrate the given namespace to provided name type + /// Gets the primary and secondary connection strings for the + /// namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -384,8 +379,8 @@ public partial interface INamespacesOperations /// /// The namespace name /// - /// - /// Parameters supplied to migrate namespace type. + /// + /// The authorization rule name. /// /// /// The headers that will be added to request. @@ -396,12 +391,17 @@ public partial interface INamespacesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task MigrateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, SBNamespaceMigrate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update NetworkRuleSet for a Namespace. + /// Regenerates the primary or secondary connection strings for the + /// namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -409,8 +409,11 @@ public partial interface INamespacesOperations /// /// The namespace name /// + /// + /// The authorization rule name. + /// /// - /// The Namespace IpFilterRule. + /// Parameters supplied to regenerate the authorization rule. /// /// /// The headers that will be added to request. @@ -427,15 +430,12 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, NetworkRuleSet parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets NetworkRuleSet for a Namespace. + /// Check the give namespace name availability. /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name + /// + /// Parameters to check availability of the given namespace name /// /// /// The headers that will be added to request. @@ -452,7 +452,7 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> GetNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckNameAvailabilityMethodWithHttpMessagesAsync(CheckNameAvailability parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates a service namespace. Once created, this /// namespace's resource manifest is immutable. This operation is @@ -556,6 +556,28 @@ public partial interface INamespacesOperations /// Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNetworkRuleSetsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets the authorization rules for a namespace. /// /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPremiumMessagingRegionsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPremiumMessagingRegionsOperations.cs deleted file mode 100644 index ed4814d4ed9c..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPremiumMessagingRegionsOperations.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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.ServiceBus -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// PremiumMessagingRegionsOperations operations. - /// - public partial interface IPremiumMessagingRegionsOperations - { - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 000000000000..fdd0192812a9 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,190 @@ +// +// 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.ServiceBus +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + public partial interface IPrivateEndpointConnectionsOperations + { + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates PrivateEndpointConnections of service namespace. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// Parameters supplied to update Status of PrivateEndPoint Connection + /// to namespace 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an existing Private Endpoint Connection. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a description for the specified Private Endpoint Connection. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an existing Private Endpoint Connection. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IEventHubsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPrivateLinkResourcesOperations.cs similarity index 50% rename from sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IEventHubsOperations.cs rename to sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPrivateLinkResourcesOperations.cs index 993bbe5dac27..11d369649a60 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IEventHubsOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IPrivateLinkResourcesOperations.cs @@ -19,12 +19,13 @@ namespace Microsoft.Azure.Management.ServiceBus using System.Threading.Tasks; /// - /// EventHubsOperations operations. + /// PrivateLinkResourcesOperations operations. /// - public partial interface IEventHubsOperations + public partial interface IPrivateLinkResourcesOperations { /// - /// Gets all the Event Hubs in a service bus Namespace. + /// Gets lists of resources that supports Privatelinks. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -47,28 +48,6 @@ public partial interface IEventHubsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all the Event Hubs in a service bus Namespace. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IQueuesOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IQueuesOperations.cs index 656db53f110d..16bd9448484a 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IQueuesOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IQueuesOperations.cs @@ -24,8 +24,8 @@ namespace Microsoft.Azure.Management.ServiceBus public partial interface IQueuesOperations { /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -33,15 +33,8 @@ public partial interface IQueuesOperations /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skip parameter that - /// specifies a starting point to use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The queue name. /// /// /// The headers that will be added to request. @@ -58,11 +51,9 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a Service Bus queue. This operation is - /// idempotent. - /// + /// Creates an authorization rule for a queue. /// /// /// Name of the Resource group within the Azure subscription. @@ -73,8 +64,11 @@ public partial interface IQueuesOperations /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create or update a queue resource. + /// The shared access authorization rule. /// /// /// The headers that will be added to request. @@ -91,10 +85,10 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, SBQueue parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a queue from the specified namespace in a resource group. - /// + /// Deletes a queue authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -105,6 +99,9 @@ public partial interface IQueuesOperations /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// The headers that will be added to request. /// @@ -117,10 +114,10 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Returns a description for the specified queue. - /// + /// Gets an authorization rule for a queue by rule name. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -131,6 +128,9 @@ public partial interface IQueuesOperations /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// The headers that will be added to request. /// @@ -146,10 +146,10 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all authorization rules for a queue. - /// + /// Primary and secondary connection strings to the queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -160,6 +160,9 @@ public partial interface IQueuesOperations /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// The headers that will be added to request. /// @@ -175,9 +178,11 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates an authorization rule for a queue. + /// Regenerates the primary or secondary connection strings to the + /// queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -192,7 +197,7 @@ public partial interface IQueuesOperations /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// /// /// The headers that will be added to request. @@ -209,10 +214,10 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a queue authorization rule. - /// + /// Gets the queues within a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -220,11 +225,15 @@ public partial interface IQueuesOperations /// /// The namespace name /// - /// - /// The queue name. + /// + /// Skip is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skip parameter that + /// specifies a starting point to use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// /// /// The headers that will be added to request. @@ -235,13 +244,17 @@ public partial interface IQueuesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets an authorization rule for a queue by rule name. - /// + /// Creates or updates a Service Bus queue. This operation is + /// idempotent. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -252,8 +265,8 @@ public partial interface IQueuesOperations /// /// The queue name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create or update a queue resource. /// /// /// The headers that will be added to request. @@ -270,10 +283,10 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, SBQueue parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Primary and secondary connection strings to the queue. - /// + /// Deletes a queue from the specified namespace in a resource group. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -284,9 +297,6 @@ public partial interface IQueuesOperations /// /// The queue name. /// - /// - /// The authorization rule name. - /// /// /// The headers that will be added to request. /// @@ -296,17 +306,13 @@ public partial interface IQueuesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Regenerates the primary or secondary connection strings to the - /// queue. - /// + /// Returns a description for the specified queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -317,12 +323,6 @@ public partial interface IQueuesOperations /// /// The queue name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// The headers that will be added to request. /// @@ -338,10 +338,10 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -361,10 +361,10 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all authorization rules for a queue. - /// + /// Gets the queues within a namespace. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -384,6 +384,6 @@ public partial interface IQueuesOperations /// /// Thrown when a required parameter is null /// - Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IRegionsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IRegionsOperations.cs deleted file mode 100644 index 1a6524070f32..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IRegionsOperations.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// 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.ServiceBus -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// RegionsOperations operations. - /// - public partial interface IRegionsOperations - { - /// - /// Gets the available Regions for a given sku - /// - /// - /// The sku type. - /// - /// - /// 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>> ListBySkuWithHttpMessagesAsync(string sku, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the available Regions for a given sku - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListBySkuNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IServiceBusManagementClient.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IServiceBusManagementClient.cs index 03c3dd9a4c8f..7af385d797ca 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IServiceBusManagementClient.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/IServiceBusManagementClient.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.ServiceBus using Newtonsoft.Json; /// - /// Azure Service Bus client /// public partial interface IServiceBusManagementClient : System.IDisposable { @@ -72,14 +71,24 @@ public partial interface IServiceBusManagementClient : System.IDisposable /// - /// Gets the IOperations. + /// Gets the INamespacesOperations. /// - IOperations Operations { get; } + INamespacesOperations Namespaces { get; } /// - /// Gets the INamespacesOperations. + /// Gets the IPrivateEndpointConnectionsOperations. /// - INamespacesOperations Namespaces { get; } + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } /// /// Gets the IDisasterRecoveryConfigsOperations. @@ -101,30 +110,15 @@ public partial interface IServiceBusManagementClient : System.IDisposable /// ITopicsOperations Topics { get; } - /// - /// Gets the ISubscriptionsOperations. - /// - ISubscriptionsOperations Subscriptions { get; } - /// /// Gets the IRulesOperations. /// IRulesOperations Rules { get; } /// - /// Gets the IRegionsOperations. - /// - IRegionsOperations Regions { get; } - - /// - /// Gets the IPremiumMessagingRegionsOperations. - /// - IPremiumMessagingRegionsOperations PremiumMessagingRegions { get; } - - /// - /// Gets the IEventHubsOperations. + /// Gets the ISubscriptionsOperations. /// - IEventHubsOperations EventHubs { get; } + ISubscriptionsOperations Subscriptions { get; } } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ITopicsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ITopicsOperations.cs index b30a0a5184fd..fd5ceea7c7b8 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ITopicsOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ITopicsOperations.cs @@ -24,8 +24,8 @@ namespace Microsoft.Azure.Management.ServiceBus public partial interface ITopicsOperations { /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -33,15 +33,8 @@ public partial interface ITopicsOperations /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skip parameter that - /// specifies a starting point to use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The topic name. /// /// /// The headers that will be added to request. @@ -58,10 +51,10 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a topic in the specified namespace. - /// + /// Creates an authorization rule for the specified topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -72,8 +65,11 @@ public partial interface ITopicsOperations /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create a topic resource. + /// The shared access authorization rule. /// /// /// The headers that will be added to request. @@ -90,10 +86,10 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, SBTopic parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a topic from the specified namespace and resource group. - /// + /// Returns the specified authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -104,6 +100,9 @@ public partial interface ITopicsOperations /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// The headers that will be added to request. /// @@ -113,13 +112,16 @@ public partial interface ITopicsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Returns a description for the specified topic. - /// + /// Deletes a topic authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -130,6 +132,9 @@ public partial interface ITopicsOperations /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// The headers that will be added to request. /// @@ -139,16 +144,13 @@ public partial interface ITopicsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets authorization rules for a topic. - /// + /// Gets the primary and secondary connection strings for the topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -159,6 +161,9 @@ public partial interface ITopicsOperations /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// The headers that will be added to request. /// @@ -174,10 +179,10 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates an authorization rule for the specified topic. - /// + /// Regenerates primary or secondary connection strings for the topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -192,7 +197,7 @@ public partial interface ITopicsOperations /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// /// /// The headers that will be added to request. @@ -209,10 +214,10 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Returns the specified authorization rule. - /// + /// Gets all the topics in a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -220,11 +225,15 @@ public partial interface ITopicsOperations /// /// The namespace name /// - /// - /// The topic name. + /// + /// Skip is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skip parameter that + /// specifies a starting point to use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// /// /// The headers that will be added to request. @@ -241,10 +250,10 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a topic authorization rule. - /// + /// Creates a topic in the specified namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -255,8 +264,8 @@ public partial interface ITopicsOperations /// /// The topic name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create a topic resource. /// /// /// The headers that will be added to request. @@ -267,13 +276,16 @@ public partial interface ITopicsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, SBTopic parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the primary and secondary connection strings for the topic. - /// + /// Deletes a topic from the specified namespace and resource group. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -284,9 +296,6 @@ public partial interface ITopicsOperations /// /// The topic name. /// - /// - /// The authorization rule name. - /// /// /// The headers that will be added to request. /// @@ -296,16 +305,13 @@ public partial interface ITopicsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Regenerates primary or secondary connection strings for the topic. - /// + /// Returns a description for the specified topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -316,12 +322,6 @@ public partial interface ITopicsOperations /// /// The topic name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// The headers that will be added to request. /// @@ -337,10 +337,10 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -360,10 +360,10 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets authorization rules for a topic. - /// + /// Gets all the topics in a namespace. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -383,6 +383,6 @@ public partial interface ITopicsOperations /// /// Thrown when a required parameter is null /// - Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ArmDisasterRecovery.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ArmDisasterRecovery.cs index ef3dbe10f368..3bbae023780a 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ArmDisasterRecovery.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ArmDisasterRecovery.cs @@ -50,7 +50,9 @@ public ArmDisasterRecovery() /// 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible /// values include: 'Primary', 'PrimaryNotReplicating', /// 'Secondary' - public ArmDisasterRecovery(string id = default(string), string name = default(string), string type = default(string), ProvisioningStateDR? provisioningState = default(ProvisioningStateDR?), long? pendingReplicationOperationsCount = default(long?), string partnerNamespace = default(string), string alternateName = default(string), RoleDisasterRecovery? role = default(RoleDisasterRecovery?)) + /// The system meta data relating to this + /// resource. + public ArmDisasterRecovery(string id = default(string), string name = default(string), string type = default(string), ProvisioningStateDR? provisioningState = default(ProvisioningStateDR?), long? pendingReplicationOperationsCount = default(long?), string partnerNamespace = default(string), string alternateName = default(string), RoleDisasterRecovery? role = default(RoleDisasterRecovery?), SystemData systemData = default(SystemData)) : base(id, name, type) { ProvisioningState = provisioningState; @@ -58,6 +60,7 @@ public ArmDisasterRecovery() PartnerNamespace = partnerNamespace; AlternateName = alternateName; Role = role; + SystemData = systemData; CustomInit(); } @@ -103,5 +106,11 @@ public ArmDisasterRecovery() [JsonProperty(PropertyName = "properties.role")] public RoleDisasterRecovery? Role { get; private set; } + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/CaptureDescription.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/CaptureDescription.cs deleted file mode 100644 index 0454230094ad..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/CaptureDescription.cs +++ /dev/null @@ -1,125 +0,0 @@ -// -// 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.ServiceBus.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Properties to configure capture description for eventhub - /// - public partial class CaptureDescription - { - /// - /// Initializes a new instance of the CaptureDescription class. - /// - public CaptureDescription() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CaptureDescription class. - /// - /// A value that indicates whether capture - /// description is enabled. - /// Enumerates the possible values for the - /// encoding format of capture description. Possible values include: - /// 'Avro', 'AvroDeflate' - /// The time window allows you to set - /// the frequency with which the capture to Azure Blobs will happen, - /// value should between 60 to 900 seconds - /// The size window defines the amount - /// of data built up in your Event Hub before an capture operation, - /// value should be between 10485760 and 524288000 bytes - /// Properties of Destination where capture - /// will be stored. (Storage Account, Blob Names) - public CaptureDescription(bool? enabled = default(bool?), EncodingCaptureDescription? encoding = default(EncodingCaptureDescription?), int? intervalInSeconds = default(int?), int? sizeLimitInBytes = default(int?), Destination destination = default(Destination)) - { - Enabled = enabled; - Encoding = encoding; - IntervalInSeconds = intervalInSeconds; - SizeLimitInBytes = sizeLimitInBytes; - Destination = destination; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a value that indicates whether capture description is - /// enabled. - /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } - - /// - /// Gets or sets enumerates the possible values for the encoding format - /// of capture description. Possible values include: 'Avro', - /// 'AvroDeflate' - /// - [JsonProperty(PropertyName = "encoding")] - public EncodingCaptureDescription? Encoding { get; set; } - - /// - /// Gets or sets the time window allows you to set the frequency with - /// which the capture to Azure Blobs will happen, value should between - /// 60 to 900 seconds - /// - [JsonProperty(PropertyName = "intervalInSeconds")] - public int? IntervalInSeconds { get; set; } - - /// - /// Gets or sets the size window defines the amount of data built up in - /// your Event Hub before an capture operation, value should be between - /// 10485760 and 524288000 bytes - /// - [JsonProperty(PropertyName = "sizeLimitInBytes")] - public int? SizeLimitInBytes { get; set; } - - /// - /// Gets or sets properties of Destination where capture will be - /// stored. (Storage Account, Blob Names) - /// - [JsonProperty(PropertyName = "destination")] - public Destination Destination { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (IntervalInSeconds > 900) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "IntervalInSeconds", 900); - } - if (IntervalInSeconds < 60) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "IntervalInSeconds", 60); - } - if (SizeLimitInBytes > 524288000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "SizeLimitInBytes", 524288000); - } - if (SizeLimitInBytes < 10485760) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "SizeLimitInBytes", 10485760); - } - } - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ConnectionState.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ConnectionState.cs new file mode 100644 index 000000000000..d127f68ed952 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ConnectionState.cs @@ -0,0 +1,62 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// ConnectionState information. + /// + public partial class ConnectionState + { + /// + /// Initializes a new instance of the ConnectionState class. + /// + public ConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionState class. + /// + /// Status of the connection. Possible values + /// include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + /// Description of the connection + /// state. + public ConnectionState(string status = default(string), string description = default(string)) + { + Status = status; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the connection. Possible values include: + /// 'Pending', 'Approved', 'Rejected', 'Disconnected' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets description of the connection state. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/CreatedByType.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..477b55771b8a --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// 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.ServiceBus.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Destination.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Destination.cs deleted file mode 100644 index 8813d3bb6781..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Destination.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// 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.ServiceBus.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Capture storage details for capture description - /// - [Rest.Serialization.JsonTransformation] - public partial class Destination - { - /// - /// Initializes a new instance of the Destination class. - /// - public Destination() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Destination class. - /// - /// Name for capture destination - /// Resource id of the storage - /// account to be used to create the blobs - /// Blob container Name - /// Blob naming convention for archive, - /// e.g. - /// {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. - /// Here all the parameters (Namespace,EventHub .. etc) are mandatory - /// irrespective of order - public Destination(string name = default(string), string storageAccountResourceId = default(string), string blobContainer = default(string), string archiveNameFormat = default(string)) - { - Name = name; - StorageAccountResourceId = storageAccountResourceId; - BlobContainer = blobContainer; - ArchiveNameFormat = archiveNameFormat; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name for capture destination - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets resource id of the storage account to be used to - /// create the blobs - /// - [JsonProperty(PropertyName = "properties.storageAccountResourceId")] - public string StorageAccountResourceId { get; set; } - - /// - /// Gets or sets blob container Name - /// - [JsonProperty(PropertyName = "properties.blobContainer")] - public string BlobContainer { get; set; } - - /// - /// Gets or sets blob naming convention for archive, e.g. - /// {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. - /// Here all the parameters (Namespace,EventHub .. etc) are mandatory - /// irrespective of order - /// - [JsonProperty(PropertyName = "properties.archiveNameFormat")] - public string ArchiveNameFormat { get; set; } - - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/EncodingCaptureDescription.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/EncodingCaptureDescription.cs deleted file mode 100644 index aa9d8b9079d8..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/EncodingCaptureDescription.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// 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.ServiceBus.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for EncodingCaptureDescription. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum EncodingCaptureDescription - { - [EnumMember(Value = "Avro")] - Avro, - [EnumMember(Value = "AvroDeflate")] - AvroDeflate - } - internal static class EncodingCaptureDescriptionEnumExtension - { - internal static string ToSerializedValue(this EncodingCaptureDescription? value) - { - return value == null ? null : ((EncodingCaptureDescription)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this EncodingCaptureDescription value) - { - switch( value ) - { - case EncodingCaptureDescription.Avro: - return "Avro"; - case EncodingCaptureDescription.AvroDeflate: - return "AvroDeflate"; - } - return null; - } - - internal static EncodingCaptureDescription? ParseEncodingCaptureDescription(this string value) - { - switch( value ) - { - case "Avro": - return EncodingCaptureDescription.Avro; - case "AvroDeflate": - return EncodingCaptureDescription.AvroDeflate; - } - return null; - } - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Encryption.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Encryption.cs new file mode 100644 index 000000000000..848a70705704 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Encryption.cs @@ -0,0 +1,73 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties to configure Encryption + /// + public partial class Encryption + { + /// + /// Initializes a new instance of the Encryption class. + /// + public Encryption() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Encryption class. + /// + /// Properties of KeyVault + /// Enumerates the possible value of keySource + /// for Encryption. Possible values include: + /// 'Microsoft.KeyVault' + /// Enable Infrastructure + /// Encryption (Double Encryption) + public Encryption(IList keyVaultProperties = default(IList), KeySource? keySource = default(KeySource?), bool? requireInfrastructureEncryption = default(bool?)) + { + KeyVaultProperties = keyVaultProperties; + KeySource = keySource; + RequireInfrastructureEncryption = requireInfrastructureEncryption; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets properties of KeyVault + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public IList KeyVaultProperties { get; set; } + + /// + /// Gets or sets enumerates the possible value of keySource for + /// Encryption. Possible values include: 'Microsoft.KeyVault' + /// + [JsonProperty(PropertyName = "keySource")] + public KeySource? KeySource { get; set; } + + /// + /// Gets or sets enable Infrastructure Encryption (Double Encryption) + /// + [JsonProperty(PropertyName = "requireInfrastructureEncryption")] + public bool? RequireInfrastructureEncryption { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/EndPointProvisioningState.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/EndPointProvisioningState.cs new file mode 100644 index 000000000000..cba32e7eb0f0 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/EndPointProvisioningState.cs @@ -0,0 +1,26 @@ +// +// 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.ServiceBus.Models +{ + + /// + /// Defines values for EndPointProvisioningState. + /// + public static class EndPointProvisioningState + { + public const string Creating = "Creating"; + public const string Updating = "Updating"; + public const string Deleting = "Deleting"; + public const string Succeeded = "Succeeded"; + public const string Canceled = "Canceled"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PremiumMessagingRegionsProperties.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorAdditionalInfo.cs similarity index 51% rename from sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PremiumMessagingRegionsProperties.cs rename to sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorAdditionalInfo.cs index de6da67dc523..fd751f17b153 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PremiumMessagingRegionsProperties.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorAdditionalInfo.cs @@ -13,27 +13,28 @@ namespace Microsoft.Azure.Management.ServiceBus.Models using Newtonsoft.Json; using System.Linq; - public partial class PremiumMessagingRegionsProperties + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo { /// - /// Initializes a new instance of the PremiumMessagingRegionsProperties - /// class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - public PremiumMessagingRegionsProperties() + public ErrorAdditionalInfo() { CustomInit(); } /// - /// Initializes a new instance of the PremiumMessagingRegionsProperties - /// class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// Region code - /// Full name of the region - public PremiumMessagingRegionsProperties(string code = default(string), string fullName = default(string)) + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) { - Code = code; - FullName = fullName; + Type = type; + Info = info; CustomInit(); } @@ -43,16 +44,16 @@ public PremiumMessagingRegionsProperties() partial void CustomInit(); /// - /// Gets region code + /// Gets the additional info type. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } /// - /// Gets full name of the region + /// Gets the additional info. /// - [JsonProperty(PropertyName = "fullName")] - public string FullName { get; private set; } + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorResponse.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorResponse.cs index 406a594906dc..292bd0bf818d 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorResponse.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorResponse.cs @@ -14,8 +14,7 @@ namespace Microsoft.Azure.Management.ServiceBus.Models using System.Linq; /// - /// Error response indicates ServiceBus service is not able to process the - /// incoming request. The reason is provided in the error message. + /// The resource management error response. /// public partial class ErrorResponse { @@ -30,13 +29,10 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// Error code. - /// Error message indicating why the operation - /// failed. - public ErrorResponse(string code = default(string), string message = default(string)) + /// The error object. + public ErrorResponse(ErrorResponseError error = default(ErrorResponseError)) { - Code = code; - Message = message; + Error = error; CustomInit(); } @@ -46,16 +42,10 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets or sets error code. + /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets error message indicating why the operation failed. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + [JsonProperty(PropertyName = "error")] + public ErrorResponseError Error { get; set; } } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorResponseError.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorResponseError.cs new file mode 100644 index 000000000000..841d0af339c0 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ErrorResponseError.cs @@ -0,0 +1,85 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error object. + /// + public partial class ErrorResponseError + { + /// + /// Initializes a new instance of the ErrorResponseError class. + /// + public ErrorResponseError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseError class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorResponseError(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Eventhub.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Eventhub.cs deleted file mode 100644 index 64bc02a84e90..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Eventhub.cs +++ /dev/null @@ -1,151 +0,0 @@ -// -// 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.ServiceBus.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Single item in List or Get Event Hub operation - /// - [Rest.Serialization.JsonTransformation] - public partial class Eventhub : Resource - { - /// - /// Initializes a new instance of the Eventhub class. - /// - public Eventhub() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Eventhub class. - /// - /// Resource Id - /// Resource name - /// Resource type - /// Current number of shards on the Event - /// Hub. - /// Exact time the Event Hub was - /// created. - /// The exact time the message was - /// updated. - /// Number of days to retain the - /// events for this Event Hub, value should be 1 to 7 days - /// Number of partitions created for the - /// Event Hub, allowed values are from 1 to 32 partitions. - /// Enumerates the possible values for the status - /// of the Event Hub. Possible values include: 'Active', 'Disabled', - /// 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', - /// 'Deleting', 'Renaming', 'Unknown' - /// Properties of capture - /// description - public Eventhub(string id = default(string), string name = default(string), string type = default(string), IList partitionIds = default(IList), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), long? messageRetentionInDays = default(long?), long? partitionCount = default(long?), EntityStatus? status = default(EntityStatus?), CaptureDescription captureDescription = default(CaptureDescription)) - : base(id, name, type) - { - PartitionIds = partitionIds; - CreatedAt = createdAt; - UpdatedAt = updatedAt; - MessageRetentionInDays = messageRetentionInDays; - PartitionCount = partitionCount; - Status = status; - CaptureDescription = captureDescription; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets current number of shards on the Event Hub. - /// - [JsonProperty(PropertyName = "properties.partitionIds")] - public IList PartitionIds { get; private set; } - - /// - /// Gets exact time the Event Hub was created. - /// - [JsonProperty(PropertyName = "properties.createdAt")] - public System.DateTime? CreatedAt { get; private set; } - - /// - /// Gets the exact time the message was updated. - /// - [JsonProperty(PropertyName = "properties.updatedAt")] - public System.DateTime? UpdatedAt { get; private set; } - - /// - /// Gets or sets number of days to retain the events for this Event - /// Hub, value should be 1 to 7 days - /// - [JsonProperty(PropertyName = "properties.messageRetentionInDays")] - public long? MessageRetentionInDays { get; set; } - - /// - /// Gets or sets number of partitions created for the Event Hub, - /// allowed values are from 1 to 32 partitions. - /// - [JsonProperty(PropertyName = "properties.partitionCount")] - public long? PartitionCount { get; set; } - - /// - /// Gets or sets enumerates the possible values for the status of the - /// Event Hub. Possible values include: 'Active', 'Disabled', - /// 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', - /// 'Deleting', 'Renaming', 'Unknown' - /// - [JsonProperty(PropertyName = "properties.status")] - public EntityStatus? Status { get; set; } - - /// - /// Gets or sets properties of capture description - /// - [JsonProperty(PropertyName = "properties.captureDescription")] - public CaptureDescription CaptureDescription { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (MessageRetentionInDays > 7) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MessageRetentionInDays", 7); - } - if (MessageRetentionInDays < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MessageRetentionInDays", 1); - } - if (PartitionCount > 32) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PartitionCount", 32); - } - if (PartitionCount < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PartitionCount", 1); - } - if (CaptureDescription != null) - { - CaptureDescription.Validate(); - } - } - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/FailoverProperties.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/FailoverProperties.cs new file mode 100644 index 000000000000..dece71d08015 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/FailoverProperties.cs @@ -0,0 +1,59 @@ +// +// 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.ServiceBus.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Safe failover is to indicate the service should wait for pending + /// replication to finish before switching to the secondary. + /// + [Rest.Serialization.JsonTransformation] + public partial class FailoverProperties + { + /// + /// Initializes a new instance of the FailoverProperties class. + /// + public FailoverProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FailoverProperties class. + /// + /// Safe failover is to indicate the + /// service should wait for pending replication to finish before + /// switching to the secondary. + public FailoverProperties(bool? isSafeFailover = default(bool?)) + { + IsSafeFailover = isSafeFailover; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets safe failover is to indicate the service should wait + /// for pending replication to finish before switching to the + /// secondary. + /// + [JsonProperty(PropertyName = "properties.IsSafeFailover")] + public bool? IsSafeFailover { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Identity.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Identity.cs new file mode 100644 index 000000000000..4d8e3c1418fc --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Identity.cs @@ -0,0 +1,83 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties to configure User Assigned Identities for Bring your Own + /// Keys + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// ObjectId from the KeyVault + /// TenantId from the KeyVault + /// Type of managed service identity. Possible + /// values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + /// Properties for User Assigned + /// Identities + public Identity(string principalId = default(string), string tenantId = default(string), ManagedServiceIdentityType? type = default(ManagedServiceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets objectId from the KeyVault + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets tenantId from the KeyVault + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets type of managed service identity. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public ManagedServiceIdentityType? Type { get; set; } + + /// + /// Gets or sets properties for User Assigned Identities + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/KeySource.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/KeySource.cs new file mode 100644 index 000000000000..27ec583001a3 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/KeySource.cs @@ -0,0 +1,54 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for KeySource. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KeySource + { + [EnumMember(Value = "Microsoft.KeyVault")] + MicrosoftKeyVault + } + internal static class KeySourceEnumExtension + { + internal static string ToSerializedValue(this KeySource? value) + { + return value == null ? null : ((KeySource)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this KeySource value) + { + switch( value ) + { + case KeySource.MicrosoftKeyVault: + return "Microsoft.KeyVault"; + } + return null; + } + + internal static KeySource? ParseKeySource(this string value) + { + switch( value ) + { + case "Microsoft.KeyVault": + return KeySource.MicrosoftKeyVault; + } + return null; + } + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/KeyVaultProperties.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 000000000000..4d50a4f342ce --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,73 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties to configure keyVault Properties + /// + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// Name of the Key from KeyVault + /// Uri of KeyVault + /// Version of KeyVault + public KeyVaultProperties(string keyName = default(string), string keyVaultUri = default(string), string keyVersion = default(string), UserAssignedIdentityProperties identity = default(UserAssignedIdentityProperties)) + { + KeyName = keyName; + KeyVaultUri = keyVaultUri; + KeyVersion = keyVersion; + Identity = identity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the Key from KeyVault + /// + [JsonProperty(PropertyName = "keyName")] + public string KeyName { get; set; } + + /// + /// Gets or sets uri of KeyVault + /// + [JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri { get; set; } + + /// + /// Gets or sets version of KeyVault + /// + [JsonProperty(PropertyName = "keyVersion")] + public string KeyVersion { get; set; } + + /// + /// + [JsonProperty(PropertyName = "identity")] + public UserAssignedIdentityProperties Identity { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..82c1f4d582e1 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,72 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ManagedServiceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ManagedServiceIdentityType + { + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + [EnumMember(Value = "UserAssigned")] + UserAssigned, + [EnumMember(Value = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + [EnumMember(Value = "None")] + None + } + internal static class ManagedServiceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ManagedServiceIdentityType? value) + { + return value == null ? null : ((ManagedServiceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ManagedServiceIdentityType value) + { + switch( value ) + { + case ManagedServiceIdentityType.SystemAssigned: + return "SystemAssigned"; + case ManagedServiceIdentityType.UserAssigned: + return "UserAssigned"; + case ManagedServiceIdentityType.SystemAssignedUserAssigned: + return "SystemAssigned, UserAssigned"; + case ManagedServiceIdentityType.None: + return "None"; + } + return null; + } + + internal static ManagedServiceIdentityType? ParseManagedServiceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ManagedServiceIdentityType.SystemAssigned; + case "UserAssigned": + return ManagedServiceIdentityType.UserAssigned; + case "SystemAssigned, UserAssigned": + return ManagedServiceIdentityType.SystemAssignedUserAssigned; + case "None": + return ManagedServiceIdentityType.None; + } + return null; + } + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/MigrationConfigProperties.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/MigrationConfigProperties.cs index 16b691cb681a..f020c81ea7c3 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/MigrationConfigProperties.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/MigrationConfigProperties.cs @@ -46,7 +46,9 @@ public MigrationConfigProperties() /// State in which Standard to Premium /// Migration is, possible values : Unknown, Reverting, Completing, /// Initiating, Syncing, Active - public MigrationConfigProperties(string targetNamespace, string postMigrationName, string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), long? pendingReplicationOperationsCount = default(long?), string migrationState = default(string)) + /// The system meta data relating to this + /// resource. + public MigrationConfigProperties(string targetNamespace, string postMigrationName, string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), long? pendingReplicationOperationsCount = default(long?), string migrationState = default(string), SystemData systemData = default(SystemData)) : base(id, name, type) { ProvisioningState = provisioningState; @@ -54,6 +56,7 @@ public MigrationConfigProperties() TargetNamespace = targetNamespace; PostMigrationName = postMigrationName; MigrationState = migrationState; + SystemData = systemData; CustomInit(); } @@ -95,6 +98,12 @@ public MigrationConfigProperties() [JsonProperty(PropertyName = "properties.migrationState")] public string MigrationState { get; private set; } + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/NameSpaceType.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/NameSpaceType.cs deleted file mode 100644 index fdb93c31ec33..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/NameSpaceType.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// 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.ServiceBus.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for NameSpaceType. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum NameSpaceType - { - [EnumMember(Value = "Messaging")] - Messaging, - [EnumMember(Value = "NotificationHub")] - NotificationHub, - [EnumMember(Value = "Mixed")] - Mixed, - [EnumMember(Value = "EventHub")] - EventHub, - [EnumMember(Value = "Relay")] - Relay - } - internal static class NameSpaceTypeEnumExtension - { - internal static string ToSerializedValue(this NameSpaceType? value) - { - return value == null ? null : ((NameSpaceType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this NameSpaceType value) - { - switch( value ) - { - case NameSpaceType.Messaging: - return "Messaging"; - case NameSpaceType.NotificationHub: - return "NotificationHub"; - case NameSpaceType.Mixed: - return "Mixed"; - case NameSpaceType.EventHub: - return "EventHub"; - case NameSpaceType.Relay: - return "Relay"; - } - return null; - } - - internal static NameSpaceType? ParseNameSpaceType(this string value) - { - switch( value ) - { - case "Messaging": - return NameSpaceType.Messaging; - case "NotificationHub": - return NameSpaceType.NotificationHub; - case "Mixed": - return NameSpaceType.Mixed; - case "EventHub": - return NameSpaceType.EventHub; - case "Relay": - return NameSpaceType.Relay; - } - return null; - } - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/NetworkRuleSet.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/NetworkRuleSet.cs index 66dc9c0ccaf2..1ec7b63fc5ee 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/NetworkRuleSet.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/NetworkRuleSet.cs @@ -37,16 +37,26 @@ public NetworkRuleSet() /// Resource Id /// Resource name /// Resource type + /// Value that indicates + /// whether Trusted Service Access is Enabled or not. /// Default Action for Network Rule Set. /// Possible values include: 'Allow', 'Deny' /// List VirtualNetwork Rules /// List of IpRules - public NetworkRuleSet(string id = default(string), string name = default(string), string type = default(string), string defaultAction = default(string), IList virtualNetworkRules = default(IList), IList ipRules = default(IList)) + /// This determines if traffic is + /// allowed over public network. By default it is enabled. Possible + /// values include: 'Enabled', 'Disabled' + /// The system meta data relating to this + /// resource. + public NetworkRuleSet(string id = default(string), string name = default(string), string type = default(string), bool? trustedServiceAccessEnabled = default(bool?), string defaultAction = default(string), IList virtualNetworkRules = default(IList), IList ipRules = default(IList), string publicNetworkAccess = default(string), SystemData systemData = default(SystemData)) : base(id, name, type) { + TrustedServiceAccessEnabled = trustedServiceAccessEnabled; DefaultAction = defaultAction; VirtualNetworkRules = virtualNetworkRules; IpRules = ipRules; + PublicNetworkAccess = publicNetworkAccess; + SystemData = systemData; CustomInit(); } @@ -55,6 +65,13 @@ public NetworkRuleSet() /// partial void CustomInit(); + /// + /// Gets or sets value that indicates whether Trusted Service Access is + /// Enabled or not. + /// + [JsonProperty(PropertyName = "properties.trustedServiceAccessEnabled")] + public bool? TrustedServiceAccessEnabled { get; set; } + /// /// Gets or sets default Action for Network Rule Set. Possible values /// include: 'Allow', 'Deny' @@ -74,5 +91,19 @@ public NetworkRuleSet() [JsonProperty(PropertyName = "properties.ipRules")] public IList IpRules { get; set; } + /// + /// Gets or sets this determines if traffic is allowed over public + /// network. By default it is enabled. Possible values include: + /// 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PremiumMessagingRegions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PremiumMessagingRegions.cs deleted file mode 100644 index 4a301153f588..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PremiumMessagingRegions.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// 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.ServiceBus.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Premium Messaging Region - /// - public partial class PremiumMessagingRegions : ResourceNamespacePatch - { - /// - /// Initializes a new instance of the PremiumMessagingRegions class. - /// - public PremiumMessagingRegions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PremiumMessagingRegions class. - /// - /// Resource Id - /// Resource name - /// Resource type - /// Resource location - /// Resource tags - public PremiumMessagingRegions(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PremiumMessagingRegionsProperties properties = default(PremiumMessagingRegionsProperties)) - : base(id, name, type, location, tags) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "properties")] - public PremiumMessagingRegionsProperties Properties { get; set; } - - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateEndpoint.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 000000000000..b65afca3ac38 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// PrivateEndpoint information. + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// The ARM identifier for Private Endpoint. + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ARM identifier for Private Endpoint. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..301d719cdbc7 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateEndpointConnection.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.ServiceBus.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of the PrivateEndpointConnection. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateEndpointConnection : Resource + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// The Private Endpoint resource for + /// this Connection. + /// Details about the + /// state of the connection. + /// Provisioning state of the Private + /// Endpoint Connection. Possible values include: 'Creating', + /// 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' + /// The system meta data relating to this + /// resource. + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), ConnectionState privateLinkServiceConnectionState = default(ConnectionState), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Private Endpoint resource for this Connection. + /// + [JsonProperty(PropertyName = "properties.privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// Gets or sets details about the state of the connection. + /// + [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")] + public ConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Gets or sets provisioning state of the Private Endpoint Connection. + /// Possible values include: 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Canceled', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkConnectionStatus.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkConnectionStatus.cs new file mode 100644 index 000000000000..f90627d7a43c --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkConnectionStatus.cs @@ -0,0 +1,24 @@ +// +// 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.ServiceBus.Models +{ + + /// + /// Defines values for PrivateLinkConnectionStatus. + /// + public static class PrivateLinkConnectionStatus + { + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + public const string Disconnected = "Disconnected"; + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkResource.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 000000000000..ca1c33cf9a04 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,95 @@ +// +// 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.ServiceBus.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information of the private link resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateLinkResource + { + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + public PrivateLinkResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResource class. + /// + /// Required Members + /// Required Zone Names + /// Fully qualified identifier of the + /// resource. + /// Name of the resource + /// Type of the resource + public PrivateLinkResource(string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList), string id = default(string), string name = default(string), string type = default(string)) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; set; } + + /// + /// Gets or sets required Members + /// + [JsonProperty(PropertyName = "properties.requiredMembers")] + public IList RequiredMembers { get; set; } + + /// + /// Gets or sets required Zone Names + /// + [JsonProperty(PropertyName = "properties.requiredZoneNames")] + public IList RequiredZoneNames { get; set; } + + /// + /// Gets or sets fully qualified identifier of the resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets type of the resource + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/AuthorizationRuleProperties.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkResourcesListResult.cs similarity index 50% rename from sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/AuthorizationRuleProperties.cs rename to sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkResourcesListResult.cs index 4d89d1c093da..8c7c20f477e1 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/AuthorizationRuleProperties.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PrivateLinkResourcesListResult.cs @@ -10,34 +10,36 @@ namespace Microsoft.Azure.Management.ServiceBus.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// AuthorizationRule properties. + /// Result of the List private link resources operation. /// - public partial class AuthorizationRuleProperties + public partial class PrivateLinkResourcesListResult { /// - /// Initializes a new instance of the AuthorizationRuleProperties + /// Initializes a new instance of the PrivateLinkResourcesListResult /// class. /// - public AuthorizationRuleProperties() + public PrivateLinkResourcesListResult() { CustomInit(); } /// - /// Initializes a new instance of the AuthorizationRuleProperties + /// Initializes a new instance of the PrivateLinkResourcesListResult /// class. /// - /// The rights associated with the rule. - public AuthorizationRuleProperties(IList rights) + /// A collection of private link resources + /// A link for the next page of private link + /// resources. + public PrivateLinkResourcesListResult(IList value = default(IList), string nextLink = default(string)) { - Rights = rights; + Value = value; + NextLink = nextLink; CustomInit(); } @@ -47,23 +49,16 @@ public AuthorizationRuleProperties(IList rights) partial void CustomInit(); /// - /// Gets or sets the rights associated with the rule. + /// Gets or sets a collection of private link resources /// - [JsonProperty(PropertyName = "rights")] - public IList Rights { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } /// - /// Validate the object. + /// Gets or sets a link for the next page of private link resources. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Rights == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Rights"); - } - } + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PublicNetworkAccessFlag.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PublicNetworkAccessFlag.cs new file mode 100644 index 000000000000..9e14ea4c6623 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/PublicNetworkAccessFlag.cs @@ -0,0 +1,22 @@ +// +// 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.ServiceBus.Models +{ + + /// + /// Defines values for PublicNetworkAccessFlag. + /// + public static class PublicNetworkAccessFlag + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs index bc710c0eae42..2ed282e6c214 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs @@ -44,13 +44,16 @@ public Rule() /// Properties of sqlFilter /// Properties of /// correlationFilter - public Rule(string id = default(string), string name = default(string), string type = default(string), Action action = default(Action), FilterType? filterType = default(FilterType?), SqlFilter sqlFilter = default(SqlFilter), CorrelationFilter correlationFilter = default(CorrelationFilter)) + /// The system meta data relating to this + /// resource. + public Rule(string id = default(string), string name = default(string), string type = default(string), Action action = default(Action), FilterType? filterType = default(FilterType?), SqlFilter sqlFilter = default(SqlFilter), CorrelationFilter correlationFilter = default(CorrelationFilter), SystemData systemData = default(SystemData)) : base(id, name, type) { Action = action; FilterType = filterType; SqlFilter = sqlFilter; CorrelationFilter = correlationFilter; + SystemData = systemData; CustomInit(); } @@ -87,5 +90,11 @@ public Rule() [JsonProperty(PropertyName = "properties.correlationFilter")] public CorrelationFilter CorrelationFilter { get; set; } + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBAuthorizationRule.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBAuthorizationRule.cs index ec883321df84..4e0775df029a 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBAuthorizationRule.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBAuthorizationRule.cs @@ -38,10 +38,13 @@ public SBAuthorizationRule() /// Resource Id /// Resource name /// Resource type - public SBAuthorizationRule(IList rights, string id = default(string), string name = default(string), string type = default(string)) + /// The system meta data relating to this + /// resource. + public SBAuthorizationRule(IList rights, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) : base(id, name, type) { Rights = rights; + SystemData = systemData; CustomInit(); } @@ -56,6 +59,12 @@ public SBAuthorizationRule() [JsonProperty(PropertyName = "properties.rights")] public IList Rights { get; set; } + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBClientAffineProperties.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBClientAffineProperties.cs new file mode 100644 index 000000000000..4ceed9429dd9 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBClientAffineProperties.cs @@ -0,0 +1,73 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties specific to client affine subscriptions. + /// + public partial class SBClientAffineProperties + { + /// + /// Initializes a new instance of the SBClientAffineProperties class. + /// + public SBClientAffineProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SBClientAffineProperties class. + /// + /// Indicates the Client ID of the application + /// that created the client-affine subscription. + /// For client-affine subscriptions, this value + /// indicates whether the subscription is durable or not. + /// For client-affine subscriptions, this value + /// indicates whether the subscription is shared or not. + public SBClientAffineProperties(string clientId = default(string), bool? isDurable = default(bool?), bool? isShared = default(bool?)) + { + ClientId = clientId; + IsDurable = isDurable; + IsShared = isShared; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates the Client ID of the application that + /// created the client-affine subscription. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; set; } + + /// + /// Gets or sets for client-affine subscriptions, this value indicates + /// whether the subscription is durable or not. + /// + [JsonProperty(PropertyName = "isDurable")] + public bool? IsDurable { get; set; } + + /// + /// Gets or sets for client-affine subscriptions, this value indicates + /// whether the subscription is shared or not. + /// + [JsonProperty(PropertyName = "isShared")] + public bool? IsShared { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespace.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespace.cs index 3e7ed947e235..e09451545381 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespace.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespace.cs @@ -40,24 +40,45 @@ public SBNamespace() /// Resource name /// Resource type /// Resource tags - /// Properties of Sku + /// Properties of SKU + /// Properties of BYOK Identity + /// description + /// The system meta data relating to this + /// resource. /// Provisioning state of the /// namespace. - /// The time the namespace was created. + /// Status of the namespace. + /// The time the namespace was created /// The time the namespace was updated. /// Endpoint you can use to perform /// Service Bus operations. /// Identifier for Azure Insights /// metrics - public SBNamespace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SBSku sku = default(SBSku), string provisioningState = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string serviceBusEndpoint = default(string), string metricId = default(string)) + /// Enabling this property creates a + /// Premium Service Bus Namespace in regions supported availability + /// zones. + /// Properties of BYOK Encryption + /// description + /// List of private endpoint + /// connections. + /// This property disables SAS + /// authentication for the Service Bus namespace. + public SBNamespace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SBSku sku = default(SBSku), Identity identity = default(Identity), SystemData systemData = default(SystemData), string provisioningState = default(string), string status = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string serviceBusEndpoint = default(string), string metricId = default(string), bool? zoneRedundant = default(bool?), Encryption encryption = default(Encryption), IList privateEndpointConnections = default(IList), bool? disableLocalAuth = default(bool?)) : base(location, id, name, type, tags) { Sku = sku; + Identity = identity; + SystemData = systemData; ProvisioningState = provisioningState; + Status = status; CreatedAt = createdAt; UpdatedAt = updatedAt; ServiceBusEndpoint = serviceBusEndpoint; MetricId = metricId; + ZoneRedundant = zoneRedundant; + Encryption = encryption; + PrivateEndpointConnections = privateEndpointConnections; + DisableLocalAuth = disableLocalAuth; CustomInit(); } @@ -67,11 +88,23 @@ public SBNamespace() partial void CustomInit(); /// - /// Gets or sets properties of Sku + /// Gets or sets properties of SKU /// [JsonProperty(PropertyName = "sku")] public SBSku Sku { get; set; } + /// + /// Gets or sets properties of BYOK Identity description + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Gets provisioning state of the namespace. /// @@ -79,7 +112,13 @@ public SBNamespace() public string ProvisioningState { get; private set; } /// - /// Gets the time the namespace was created. + /// Gets status of the namespace. + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the time the namespace was created /// [JsonProperty(PropertyName = "properties.createdAt")] public System.DateTime? CreatedAt { get; private set; } @@ -102,6 +141,32 @@ public SBNamespace() [JsonProperty(PropertyName = "properties.metricId")] public string MetricId { get; private set; } + /// + /// Gets or sets enabling this property creates a Premium Service Bus + /// Namespace in regions supported availability zones. + /// + [JsonProperty(PropertyName = "properties.zoneRedundant")] + public bool? ZoneRedundant { get; set; } + + /// + /// Gets or sets properties of BYOK Encryption description + /// + [JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption { get; set; } + + /// + /// Gets or sets list of private endpoint connections. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; set; } + + /// + /// Gets or sets this property disables SAS authentication for the + /// Service Bus namespace. + /// + [JsonProperty(PropertyName = "properties.disableLocalAuth")] + public bool? DisableLocalAuth { get; set; } + /// /// Validate the object. /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespaceMigrate.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespaceMigrate.cs deleted file mode 100644 index fccc31419c24..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespaceMigrate.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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.ServiceBus.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Namespace Migrate Object - /// - public partial class SBNamespaceMigrate - { - /// - /// Initializes a new instance of the SBNamespaceMigrate class. - /// - public SBNamespaceMigrate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SBNamespaceMigrate class. - /// - /// Type of namespaces. Possible - /// values include: 'Messaging', 'NotificationHub', 'Mixed', - /// 'EventHub', 'Relay' - public SBNamespaceMigrate(NameSpaceType targetNamespaceType) - { - TargetNamespaceType = targetNamespaceType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of namespaces. Possible values include: - /// 'Messaging', 'NotificationHub', 'Mixed', 'EventHub', 'Relay' - /// - [JsonProperty(PropertyName = "targetNamespaceType")] - public NameSpaceType TargetNamespaceType { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespaceUpdateParameters.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespaceUpdateParameters.cs index b127de4e01b6..b75235cacadd 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespaceUpdateParameters.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBNamespaceUpdateParameters.cs @@ -41,24 +41,42 @@ public SBNamespaceUpdateParameters() /// Resource type /// Resource location /// Resource tags - /// Properties of Sku + /// Properties of SKU /// Provisioning state of the /// namespace. - /// The time the namespace was created. + /// Status of the namespace. + /// The time the namespace was created /// The time the namespace was updated. /// Endpoint you can use to perform /// Service Bus operations. /// Identifier for Azure Insights /// metrics - public SBNamespaceUpdateParameters(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SBSku sku = default(SBSku), string provisioningState = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string serviceBusEndpoint = default(string), string metricId = default(string)) + /// Enabling this property creates a + /// Premium Service Bus Namespace in regions supported availability + /// zones. + /// Properties of BYOK Encryption + /// description + /// List of private endpoint + /// connections. + /// This property disables SAS + /// authentication for the Service Bus namespace. + /// Properties of BYOK Identity + /// description + public SBNamespaceUpdateParameters(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SBSku sku = default(SBSku), string provisioningState = default(string), string status = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string serviceBusEndpoint = default(string), string metricId = default(string), bool? zoneRedundant = default(bool?), Encryption encryption = default(Encryption), IList privateEndpointConnections = default(IList), bool? disableLocalAuth = default(bool?), Identity identity = default(Identity)) : base(id, name, type, location, tags) { Sku = sku; ProvisioningState = provisioningState; + Status = status; CreatedAt = createdAt; UpdatedAt = updatedAt; ServiceBusEndpoint = serviceBusEndpoint; MetricId = metricId; + ZoneRedundant = zoneRedundant; + Encryption = encryption; + PrivateEndpointConnections = privateEndpointConnections; + DisableLocalAuth = disableLocalAuth; + Identity = identity; CustomInit(); } @@ -68,7 +86,7 @@ public SBNamespaceUpdateParameters() partial void CustomInit(); /// - /// Gets or sets properties of Sku + /// Gets or sets properties of SKU /// [JsonProperty(PropertyName = "sku")] public SBSku Sku { get; set; } @@ -80,7 +98,13 @@ public SBNamespaceUpdateParameters() public string ProvisioningState { get; private set; } /// - /// Gets the time the namespace was created. + /// Gets status of the namespace. + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets the time the namespace was created /// [JsonProperty(PropertyName = "properties.createdAt")] public System.DateTime? CreatedAt { get; private set; } @@ -103,6 +127,38 @@ public SBNamespaceUpdateParameters() [JsonProperty(PropertyName = "properties.metricId")] public string MetricId { get; private set; } + /// + /// Gets or sets enabling this property creates a Premium Service Bus + /// Namespace in regions supported availability zones. + /// + [JsonProperty(PropertyName = "properties.zoneRedundant")] + public bool? ZoneRedundant { get; set; } + + /// + /// Gets or sets properties of BYOK Encryption description + /// + [JsonProperty(PropertyName = "properties.encryption")] + public Encryption Encryption { get; set; } + + /// + /// Gets or sets list of private endpoint connections. + /// + [JsonProperty(PropertyName = "properties.privateEndpointConnections")] + public IList PrivateEndpointConnections { get; set; } + + /// + /// Gets or sets this property disables SAS authentication for the + /// Service Bus namespace. + /// + [JsonProperty(PropertyName = "properties.disableLocalAuth")] + public bool? DisableLocalAuth { get; set; } + + /// + /// Gets or sets properties of BYOK Identity description + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + /// /// Validate the object. /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBQueue.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBQueue.cs index d6a2c58cf2f2..6b17ba504272 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBQueue.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBQueue.cs @@ -52,6 +52,9 @@ public SBQueue() /// The maximum size of the queue in /// megabytes, which is the size of memory allocated for the queue. /// Default is 1024. + /// Maximum size (in KB) of the + /// message payload that can be accepted by the queue. This property is + /// only used in Premium today and default is 1024. /// A value indicating if this /// queue requires duplicate detection. /// A value that indicates whether the @@ -88,7 +91,9 @@ public SBQueue() /// messages /// Queue/Topic name to /// forward the Dead Letter message - public SBQueue(string id = default(string), string name = default(string), string type = default(string), MessageCountDetails countDetails = default(MessageCountDetails), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), System.DateTime? accessedAt = default(System.DateTime?), long? sizeInBytes = default(long?), long? messageCount = default(long?), System.TimeSpan? lockDuration = default(System.TimeSpan?), int? maxSizeInMegabytes = default(int?), bool? requiresDuplicateDetection = default(bool?), bool? requiresSession = default(bool?), System.TimeSpan? defaultMessageTimeToLive = default(System.TimeSpan?), bool? deadLetteringOnMessageExpiration = default(bool?), System.TimeSpan? duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), int? maxDeliveryCount = default(int?), EntityStatus? status = default(EntityStatus?), bool? enableBatchedOperations = default(bool?), System.TimeSpan? autoDeleteOnIdle = default(System.TimeSpan?), bool? enablePartitioning = default(bool?), bool? enableExpress = default(bool?), string forwardTo = default(string), string forwardDeadLetteredMessagesTo = default(string)) + /// The system meta data relating to this + /// resource. + public SBQueue(string id = default(string), string name = default(string), string type = default(string), MessageCountDetails countDetails = default(MessageCountDetails), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), System.DateTime? accessedAt = default(System.DateTime?), long? sizeInBytes = default(long?), long? messageCount = default(long?), System.TimeSpan? lockDuration = default(System.TimeSpan?), int? maxSizeInMegabytes = default(int?), long? maxMessageSizeInKilobytes = default(long?), bool? requiresDuplicateDetection = default(bool?), bool? requiresSession = default(bool?), System.TimeSpan? defaultMessageTimeToLive = default(System.TimeSpan?), bool? deadLetteringOnMessageExpiration = default(bool?), System.TimeSpan? duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), int? maxDeliveryCount = default(int?), EntityStatus? status = default(EntityStatus?), bool? enableBatchedOperations = default(bool?), System.TimeSpan? autoDeleteOnIdle = default(System.TimeSpan?), bool? enablePartitioning = default(bool?), bool? enableExpress = default(bool?), string forwardTo = default(string), string forwardDeadLetteredMessagesTo = default(string), SystemData systemData = default(SystemData)) : base(id, name, type) { CountDetails = countDetails; @@ -99,6 +104,7 @@ public SBQueue() MessageCount = messageCount; LockDuration = lockDuration; MaxSizeInMegabytes = maxSizeInMegabytes; + MaxMessageSizeInKilobytes = maxMessageSizeInKilobytes; RequiresDuplicateDetection = requiresDuplicateDetection; RequiresSession = requiresSession; DefaultMessageTimeToLive = defaultMessageTimeToLive; @@ -112,6 +118,7 @@ public SBQueue() EnableExpress = enableExpress; ForwardTo = forwardTo; ForwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo; + SystemData = systemData; CustomInit(); } @@ -173,6 +180,14 @@ public SBQueue() [JsonProperty(PropertyName = "properties.maxSizeInMegabytes")] public int? MaxSizeInMegabytes { get; set; } + /// + /// Gets or sets maximum size (in KB) of the message payload that can + /// be accepted by the queue. This property is only used in Premium + /// today and default is 1024. + /// + [JsonProperty(PropertyName = "properties.maxMessageSizeInKilobytes")] + public long? MaxMessageSizeInKilobytes { get; set; } + /// /// Gets or sets a value indicating if this queue requires duplicate /// detection. @@ -268,5 +283,11 @@ public SBQueue() [JsonProperty(PropertyName = "properties.forwardDeadLetteredMessagesTo")] public string ForwardDeadLetteredMessagesTo { get; set; } + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBSubscription.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBSubscription.cs index 833426a97b7c..5731e66cb984 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBSubscription.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBSubscription.cs @@ -75,7 +75,13 @@ public SBSubscription() /// messages /// Queue/Topic name to /// forward the Dead Letter message - public SBSubscription(string id = default(string), string name = default(string), string type = default(string), long? messageCount = default(long?), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? accessedAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), MessageCountDetails countDetails = default(MessageCountDetails), System.TimeSpan? lockDuration = default(System.TimeSpan?), bool? requiresSession = default(bool?), System.TimeSpan? defaultMessageTimeToLive = default(System.TimeSpan?), bool? deadLetteringOnFilterEvaluationExceptions = default(bool?), bool? deadLetteringOnMessageExpiration = default(bool?), System.TimeSpan? duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), int? maxDeliveryCount = default(int?), EntityStatus? status = default(EntityStatus?), bool? enableBatchedOperations = default(bool?), System.TimeSpan? autoDeleteOnIdle = default(System.TimeSpan?), string forwardTo = default(string), string forwardDeadLetteredMessagesTo = default(string)) + /// Value that indicates whether the + /// subscription has an affinity to the client id. + /// Properties specific to client + /// affine subscriptions. + /// The system meta data relating to this + /// resource. + public SBSubscription(string id = default(string), string name = default(string), string type = default(string), long? messageCount = default(long?), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? accessedAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), MessageCountDetails countDetails = default(MessageCountDetails), System.TimeSpan? lockDuration = default(System.TimeSpan?), bool? requiresSession = default(bool?), System.TimeSpan? defaultMessageTimeToLive = default(System.TimeSpan?), bool? deadLetteringOnFilterEvaluationExceptions = default(bool?), bool? deadLetteringOnMessageExpiration = default(bool?), System.TimeSpan? duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), int? maxDeliveryCount = default(int?), EntityStatus? status = default(EntityStatus?), bool? enableBatchedOperations = default(bool?), System.TimeSpan? autoDeleteOnIdle = default(System.TimeSpan?), string forwardTo = default(string), string forwardDeadLetteredMessagesTo = default(string), bool? isClientAffine = default(bool?), SBClientAffineProperties clientAffineProperties = default(SBClientAffineProperties), SystemData systemData = default(SystemData)) : base(id, name, type) { MessageCount = messageCount; @@ -95,6 +101,9 @@ public SBSubscription() AutoDeleteOnIdle = autoDeleteOnIdle; ForwardTo = forwardTo; ForwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo; + IsClientAffine = isClientAffine; + ClientAffineProperties = clientAffineProperties; + SystemData = systemData; CustomInit(); } @@ -219,5 +228,24 @@ public SBSubscription() [JsonProperty(PropertyName = "properties.forwardDeadLetteredMessagesTo")] public string ForwardDeadLetteredMessagesTo { get; set; } + /// + /// Gets or sets value that indicates whether the subscription has an + /// affinity to the client id. + /// + [JsonProperty(PropertyName = "properties.isClientAffine")] + public bool? IsClientAffine { get; set; } + + /// + /// Gets or sets properties specific to client affine subscriptions. + /// + [JsonProperty(PropertyName = "properties.clientAffineProperties")] + public SBClientAffineProperties ClientAffineProperties { get; set; } + + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBTopic.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBTopic.cs index 09d91635479c..212f5f309bba 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBTopic.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SBTopic.cs @@ -51,6 +51,9 @@ public SBTopic() /// Maximum size of the topic in /// megabytes, which is the size of the memory allocated for the topic. /// Default is 1024. + /// Maximum size (in KB) of the + /// message payload that can be accepted by the topic. This property is + /// only used in Premium today and default is 1024. /// Value indicating if this /// topic requires duplicate detection. /// ISO8601 timespan @@ -73,7 +76,9 @@ public SBTopic() /// Value that indicates whether Express /// Entities are enabled. An express topic holds a message in memory /// temporarily before writing it to persistent storage. - public SBTopic(string id = default(string), string name = default(string), string type = default(string), long? sizeInBytes = default(long?), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), System.DateTime? accessedAt = default(System.DateTime?), int? subscriptionCount = default(int?), MessageCountDetails countDetails = default(MessageCountDetails), System.TimeSpan? defaultMessageTimeToLive = default(System.TimeSpan?), int? maxSizeInMegabytes = default(int?), bool? requiresDuplicateDetection = default(bool?), System.TimeSpan? duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), bool? enableBatchedOperations = default(bool?), EntityStatus? status = default(EntityStatus?), bool? supportOrdering = default(bool?), System.TimeSpan? autoDeleteOnIdle = default(System.TimeSpan?), bool? enablePartitioning = default(bool?), bool? enableExpress = default(bool?)) + /// The system meta data relating to this + /// resource. + public SBTopic(string id = default(string), string name = default(string), string type = default(string), long? sizeInBytes = default(long?), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), System.DateTime? accessedAt = default(System.DateTime?), int? subscriptionCount = default(int?), MessageCountDetails countDetails = default(MessageCountDetails), System.TimeSpan? defaultMessageTimeToLive = default(System.TimeSpan?), int? maxSizeInMegabytes = default(int?), long? maxMessageSizeInKilobytes = default(long?), bool? requiresDuplicateDetection = default(bool?), System.TimeSpan? duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), bool? enableBatchedOperations = default(bool?), EntityStatus? status = default(EntityStatus?), bool? supportOrdering = default(bool?), System.TimeSpan? autoDeleteOnIdle = default(System.TimeSpan?), bool? enablePartitioning = default(bool?), bool? enableExpress = default(bool?), SystemData systemData = default(SystemData)) : base(id, name, type) { SizeInBytes = sizeInBytes; @@ -84,6 +89,7 @@ public SBTopic() CountDetails = countDetails; DefaultMessageTimeToLive = defaultMessageTimeToLive; MaxSizeInMegabytes = maxSizeInMegabytes; + MaxMessageSizeInKilobytes = maxMessageSizeInKilobytes; RequiresDuplicateDetection = requiresDuplicateDetection; DuplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow; EnableBatchedOperations = enableBatchedOperations; @@ -92,6 +98,7 @@ public SBTopic() AutoDeleteOnIdle = autoDeleteOnIdle; EnablePartitioning = enablePartitioning; EnableExpress = enableExpress; + SystemData = systemData; CustomInit(); } @@ -153,6 +160,14 @@ public SBTopic() [JsonProperty(PropertyName = "properties.maxSizeInMegabytes")] public int? MaxSizeInMegabytes { get; set; } + /// + /// Gets or sets maximum size (in KB) of the message payload that can + /// be accepted by the topic. This property is only used in Premium + /// today and default is 1024. + /// + [JsonProperty(PropertyName = "properties.maxMessageSizeInKilobytes")] + public long? MaxMessageSizeInKilobytes { get; set; } + /// /// Gets or sets value indicating if this topic requires duplicate /// detection. @@ -213,5 +228,11 @@ public SBTopic() [JsonProperty(PropertyName = "properties.enableExpress")] public bool? EnableExpress { get; set; } + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs index eb1bbf03609a..dc95c5ce2f9a 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs @@ -57,11 +57,11 @@ public SqlFilter() public string SqlExpression { get; set; } /// - /// Gets this property is reserved for future use. An integer value - /// showing the compatibility level, currently hard-coded to 20. + /// Gets or sets this property is reserved for future use. An integer + /// value showing the compatibility level, currently hard-coded to 20. /// [JsonProperty(PropertyName = "compatibilityLevel")] - public int? CompatibilityLevel { get; private set; } + public int? CompatibilityLevel { get; set; } /// /// Gets or sets value that indicates whether the rule action requires diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SystemData.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..aed6aab6f27e --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The type of identity that last + /// modified the resource. + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/UserAssignedIdentity.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..682baed5a54d --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/UserAssignedIdentity.cs @@ -0,0 +1,60 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Recognized Dictionary value. + /// + public partial class UserAssignedIdentity + { + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + public UserAssignedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + /// Principal Id of user assigned + /// identity + /// Client Id of user assigned identity + public UserAssignedIdentity(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets principal Id of user assigned identity + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets client Id of user assigned identity + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/UserAssignedIdentityProperties.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/UserAssignedIdentityProperties.cs new file mode 100644 index 000000000000..ab167d16d78a --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/UserAssignedIdentityProperties.cs @@ -0,0 +1,51 @@ +// +// 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.ServiceBus.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class UserAssignedIdentityProperties + { + /// + /// Initializes a new instance of the UserAssignedIdentityProperties + /// class. + /// + public UserAssignedIdentityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAssignedIdentityProperties + /// class. + /// + /// ARM ID of user Identity selected + /// for encryption + public UserAssignedIdentityProperties(string userAssignedIdentity = default(string)) + { + UserAssignedIdentity = userAssignedIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ARM ID of user Identity selected for encryption + /// + [JsonProperty(PropertyName = "userAssignedIdentity")] + public string UserAssignedIdentity { get; set; } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs index 3b8e4f25b6f2..6881389f4720 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs @@ -50,197 +50,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// public ServiceBusManagementClient Client { get; private set; } - /// - /// Check the give namespace name availability. - /// - /// - /// Parameters to check availability of the given namespace name - /// - /// - /// 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> CheckNameAvailabilityMethodWithHttpMessagesAsync(CheckNameAvailability parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailabilityMethod", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability").ToString(); - _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 != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - /// /// Gets all the available namespaces within the subscription, irrespective of /// the resource groups. @@ -1122,8 +931,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Gets the authorization rules for a namespace. - /// + /// Create or update NetworkRuleSet for a Namespace. /// /// /// Name of the Resource group within the Azure subscription. @@ -1131,6 +939,9 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The namespace name /// + /// + /// The Namespace IpFilterRule. + /// /// /// Headers that will be added to request. /// @@ -1152,7 +963,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, NetworkRuleSet parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1192,6 +1003,10 @@ internal NamespacesOperations(ServiceBusManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1201,12 +1016,13 @@ internal NamespacesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateNetworkRuleSet", 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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -1222,7 +1038,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1253,6 +1069,12 @@ internal NamespacesOperations(ServiceBusManagementClient client) // 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) { @@ -1303,7 +1125,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1316,7 +1138,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1336,8 +1158,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Creates or updates an authorization rule for a namespace. - /// + /// Gets NetworkRuleSet for a Namespace. /// /// /// Name of the Resource group within the Azure subscription. @@ -1345,12 +1166,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// The authorization rule name. - /// - /// - /// The shared access authorization rule. - /// /// /// Headers that will be added to request. /// @@ -1372,7 +1187,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1404,29 +1219,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) - { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1444,17 +1236,14 @@ internal NamespacesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkRuleSet", 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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1468,7 +1257,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1499,12 +1288,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) // 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) { @@ -1555,7 +1338,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1568,7 +1351,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1588,8 +1371,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Deletes a namespace authorization rule. - /// + /// Gets list of NetworkRuleSet for a Namespace. /// /// /// Name of the Resource group within the Azure subscription. @@ -1597,9 +1379,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// The authorization rule name. - /// /// /// Headers that will be added to request. /// @@ -1609,6 +1388,9 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1618,7 +1400,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNetworkRuleSetsWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1650,21 +1432,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) - { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1682,16 +1449,14 @@ internal NamespacesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkRuleSets", 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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1705,7 +1470,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1756,7 +1521,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1786,13 +1551,31 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -1801,8 +1584,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Gets an authorization rule for a namespace by rule name. - /// + /// Gets the authorization rules for a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1810,9 +1593,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// The authorization rule name. - /// /// /// Headers that will be added to request. /// @@ -1834,7 +1614,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1866,21 +1646,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) - { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1898,16 +1663,14 @@ internal NamespacesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", 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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2002,7 +1765,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2015,7 +1778,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2035,8 +1798,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Gets the primary and secondary connection strings for the namespace. - /// + /// Creates or updates an authorization rule for a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -2047,6 +1810,9 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The authorization rule name. /// + /// + /// The shared access authorization rule. + /// /// /// Headers that will be added to request. /// @@ -2068,7 +1834,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2115,6 +1881,14 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -2133,12 +1907,13 @@ internal NamespacesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); @@ -2155,7 +1930,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2186,6 +1961,12 @@ internal NamespacesOperations(ServiceBusManagementClient client) // 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) { @@ -2236,7 +2017,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2249,7 +2030,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2269,8 +2050,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Regenerates the primary or secondary connection strings for the namespace. - /// + /// Deletes a namespace authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -2281,9 +2062,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The authorization rule name. /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// Headers that will be added to request. /// @@ -2293,9 +2071,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -2305,7 +2080,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2352,14 +2127,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -2378,13 +2145,12 @@ internal NamespacesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); @@ -2401,7 +2167,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2432,12 +2198,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) // 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) { @@ -2458,7 +2218,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2488,31 +2248,13 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -2521,7 +2263,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// This operation Migrate the given namespace to provided name type + /// Gets an authorization rule for a namespace by rule name. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -2529,8 +2272,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// Parameters supplied to migrate namespace type. + /// + /// The authorization rule name. /// /// /// Headers that will be added to request. @@ -2541,6 +2284,9 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -2550,7 +2296,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task MigrateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, SBNamespaceMigrate parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2582,21 +2328,28 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (Client.ApiVersion == null) + if (authorizationRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); } - if (Client.SubscriptionId == null) + if (authorizationRuleName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (parameters != null) + if (Client.SubscriptionId == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -2607,15 +2360,16 @@ internal NamespacesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/migrate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2629,7 +2383,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2660,12 +2414,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) // 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) { @@ -2716,13 +2464,31 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -2731,7 +2497,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Create or update NetworkRuleSet for a Namespace. + /// Gets the primary and secondary connection strings for the namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -2739,8 +2506,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// The Namespace IpFilterRule. + /// + /// The authorization rule name. /// /// /// Headers that will be added to request. @@ -2763,7 +2530,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, NetworkRuleSet parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2795,6 +2562,21 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -2803,10 +2585,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2816,15 +2594,16 @@ internal NamespacesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateNetworkRuleSet", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", 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.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2838,7 +2617,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2869,12 +2648,6 @@ internal NamespacesOperations(ServiceBusManagementClient client) // 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) { @@ -2925,7 +2698,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2938,7 +2711,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2958,7 +2731,8 @@ internal NamespacesOperations(ServiceBusManagementClient client) } /// - /// Gets NetworkRuleSet for a Namespace. + /// Regenerates the primary or secondary connection strings for the namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -2966,6 +2740,12 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// The namespace name /// + /// + /// The authorization rule name. + /// + /// + /// Parameters supplied to regenerate the authorization rule. + /// /// /// Headers that will be added to request. /// @@ -2987,7 +2767,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3019,6 +2799,29 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -3036,14 +2839,17 @@ internal NamespacesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetNetworkRuleSet", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", 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.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -3057,7 +2863,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -3088,6 +2894,12 @@ internal NamespacesOperations(ServiceBusManagementClient client) // 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) { @@ -3138,7 +2950,7 @@ internal NamespacesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3151,7 +2963,198 @@ internal NamespacesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _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; + } + + /// + /// Check the give namespace name availability. + /// + /// + /// Parameters to check availability of the given namespace name + /// + /// + /// 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> CheckNameAvailabilityMethodWithHttpMessagesAsync(CheckNameAvailability parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailabilityMethod", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability").ToString(); + _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 != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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) { @@ -3943,6 +3946,174 @@ internal NamespacesOperations(ServiceBusManagementClient client) return _result; } + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNetworkRuleSetsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkRuleSetsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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("GET"); + _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; + // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + /// /// Gets the authorization rules for a namespace. /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs index be74f0e08a73..ead7f4c7d082 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs @@ -21,40 +21,6 @@ namespace Microsoft.Azure.Management.ServiceBus /// public static partial class NamespacesOperationsExtensions { - /// - /// Check the give namespace name availability. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters to check availability of the given namespace name - /// - public static CheckNameAvailabilityResult CheckNameAvailabilityMethod(this INamespacesOperations operations, CheckNameAvailability parameters) - { - return operations.CheckNameAvailabilityMethodAsync(parameters).GetAwaiter().GetResult(); - } - - /// - /// Check the give namespace name availability. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters to check availability of the given namespace name - /// - /// - /// The cancellation token. - /// - public static async Task CheckNameAvailabilityMethodAsync(this INamespacesOperations operations, CheckNameAvailability parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckNameAvailabilityMethodWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all the available namespaces within the subscription, irrespective of /// the resource groups. @@ -304,6 +270,132 @@ public static SBNamespace Update(this INamespacesOperations operations, string r } } + /// + /// Create or update NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The Namespace IpFilterRule. + /// + public static NetworkRuleSet CreateOrUpdateNetworkRuleSet(this INamespacesOperations operations, string resourceGroupName, string namespaceName, NetworkRuleSet parameters) + { + return operations.CreateOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The Namespace IpFilterRule. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateNetworkRuleSetAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, NetworkRuleSet parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateNetworkRuleSetWithHttpMessagesAsync(resourceGroupName, namespaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + public static NetworkRuleSet GetNetworkRuleSet(this INamespacesOperations operations, string resourceGroupName, string namespaceName) + { + return operations.GetNetworkRuleSetAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The cancellation token. + /// + public static async Task GetNetworkRuleSetAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetNetworkRuleSetWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + public static IPage ListNetworkRuleSets(this INamespacesOperations operations, string resourceGroupName, string namespaceName) + { + return operations.ListNetworkRuleSetsAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The cancellation token. + /// + public static async Task> ListNetworkRuleSetsAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNetworkRuleSetsWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets the authorization rules for a namespace. /// @@ -596,129 +688,34 @@ public static AccessKeys RegenerateKeys(this INamespacesOperations operations, s } /// - /// This operation Migrate the given namespace to provided name type - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name - /// - /// - /// Parameters supplied to migrate namespace type. - /// - public static void Migrate(this INamespacesOperations operations, string resourceGroupName, string namespaceName, SBNamespaceMigrate parameters) - { - operations.MigrateAsync(resourceGroupName, namespaceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// This operation Migrate the given namespace to provided name type - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name - /// - /// - /// Parameters supplied to migrate namespace type. - /// - /// - /// The cancellation token. - /// - public static async Task MigrateAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, SBNamespaceMigrate parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, namespaceName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create or update NetworkRuleSet for a Namespace. + /// Check the give namespace name availability. /// /// /// The operations group for this extension method. /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name - /// /// - /// The Namespace IpFilterRule. + /// Parameters to check availability of the given namespace name /// - public static NetworkRuleSet CreateOrUpdateNetworkRuleSet(this INamespacesOperations operations, string resourceGroupName, string namespaceName, NetworkRuleSet parameters) + public static CheckNameAvailabilityResult CheckNameAvailabilityMethod(this INamespacesOperations operations, CheckNameAvailability parameters) { - return operations.CreateOrUpdateNetworkRuleSetAsync(resourceGroupName, namespaceName, parameters).GetAwaiter().GetResult(); + return operations.CheckNameAvailabilityMethodAsync(parameters).GetAwaiter().GetResult(); } /// - /// Create or update NetworkRuleSet for a Namespace. + /// Check the give namespace name availability. /// /// /// The operations group for this extension method. /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name - /// /// - /// The Namespace IpFilterRule. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateNetworkRuleSetAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, NetworkRuleSet parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateNetworkRuleSetWithHttpMessagesAsync(resourceGroupName, namespaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets NetworkRuleSet for a Namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name - /// - public static NetworkRuleSet GetNetworkRuleSet(this INamespacesOperations operations, string resourceGroupName, string namespaceName) - { - return operations.GetNetworkRuleSetAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets NetworkRuleSet for a Namespace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// The namespace name + /// Parameters to check availability of the given namespace name /// /// /// The cancellation token. /// - public static async Task GetNetworkRuleSetAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CheckNameAvailabilityMethodAsync(this INamespacesOperations operations, CheckNameAvailability parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetNetworkRuleSetWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckNameAvailabilityMethodWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -889,6 +886,40 @@ public static IPage ListByResourceGroupNext(this INamespacesOperati } } + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNetworkRuleSetsNext(this INamespacesOperations operations, string nextPageLink) + { + return operations.ListNetworkRuleSetsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNetworkRuleSetsNextAsync(this INamespacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNetworkRuleSetsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets the authorization rules for a namespace. /// diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PremiumMessagingRegionsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PremiumMessagingRegionsOperations.cs deleted file mode 100644 index 8ad2d7260031..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PremiumMessagingRegionsOperations.cs +++ /dev/null @@ -1,395 +0,0 @@ -// -// 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.ServiceBus -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// PremiumMessagingRegionsOperations operations. - /// - internal partial class PremiumMessagingRegionsOperations : IServiceOperations, IPremiumMessagingRegionsOperations - { - /// - /// Initializes a new instance of the PremiumMessagingRegionsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal PremiumMessagingRegionsOperations(ServiceBusManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ServiceBusManagementClient - /// - public ServiceBusManagementClient Client { get; private set; } - - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/premiumMessagingRegions").ToString(); - _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("GET"); - _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; - // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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("GET"); - _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; - // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PremiumMessagingRegionsOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PremiumMessagingRegionsOperationsExtensions.cs deleted file mode 100644 index 746b9b1953cb..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PremiumMessagingRegionsOperationsExtensions.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// 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.ServiceBus -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PremiumMessagingRegionsOperations. - /// - public static partial class PremiumMessagingRegionsOperationsExtensions - { - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IPremiumMessagingRegionsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPremiumMessagingRegionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPremiumMessagingRegionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the available premium messaging regions for servicebus - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPremiumMessagingRegionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 000000000000..0ccb7a215ea0 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,1144 @@ +// +// 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.ServiceBus +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + internal partial class PrivateEndpointConnectionsOperations : IServiceOperations, IPrivateEndpointConnectionsOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionsOperations(ServiceBusManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ServiceBusManagementClient + /// + public ServiceBusManagementClient Client { get; private set; } + + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (namespaceName != null) + { + if (namespaceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "namespaceName", 50); + } + if (namespaceName.Length < 6) + { + throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); + } + } + 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("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", 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.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _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("GET"); + _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; + // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Creates or updates PrivateEndpointConnections of service namespace. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// Parameters supplied to update Status of PrivateEndPoint Connection to + /// namespace 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (namespaceName != null) + { + if (namespaceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "namespaceName", 50); + } + if (namespaceName.Length < 6) + { + throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); + } + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // 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("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + 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("PUT"); + _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 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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); + } + } + // 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; + } + + /// + /// Deletes an existing Private Endpoint Connection. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a description for the specified Private Endpoint Connection. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (namespaceName != null) + { + if (namespaceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "namespaceName", 50); + } + if (namespaceName.Length < 6) + { + throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); + } + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + 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("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + _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("GET"); + _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; + // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 an existing Private Endpoint Connection. + /// + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (namespaceName != null) + { + if (namespaceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "namespaceName", 50); + } + if (namespaceName.Length < 6) + { + throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // 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("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + 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("DELETE"); + _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; + // 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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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("GET"); + _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; + // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..089b3065d89a --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,297 @@ +// +// 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.ServiceBus +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + public static IPage List(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName) + { + return operations.ListAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates PrivateEndpointConnections of service namespace. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// Parameters supplied to update Status of PrivateEndPoint Connection to + /// namespace resource. + /// + public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName, PrivateEndpointConnection parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates PrivateEndpointConnections of service namespace. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// Parameters supplied to update Status of PrivateEndPoint Connection to + /// namespace resource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an existing Private Endpoint Connection. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + public static void Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName) + { + operations.DeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Private Endpoint Connection. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a description for the specified Private Endpoint Connection. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a description for the specified Private Endpoint Connection. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an existing Private Endpoint Connection. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + public static void BeginDelete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName) + { + operations.BeginDeleteAsync(resourceGroupName, namespaceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Private Endpoint Connection. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The PrivateEndpointConnection name + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string namespaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPrivateEndpointConnectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the available PrivateEndpointConnections within a namespace. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IPrivateEndpointConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/EventHubsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateLinkResourcesOperations.cs similarity index 55% rename from sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/EventHubsOperations.cs rename to sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateLinkResourcesOperations.cs index bd8d46a5ffa7..4bc45e29add5 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/EventHubsOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateLinkResourcesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.ServiceBus using System.Threading.Tasks; /// - /// EventHubsOperations operations. + /// PrivateLinkResourcesOperations operations. /// - internal partial class EventHubsOperations : IServiceOperations, IEventHubsOperations + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations { /// - /// Initializes a new instance of the EventHubsOperations class. + /// Initializes a new instance of the PrivateLinkResourcesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class EventHubsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EventHubsOperations(ServiceBusManagementClient client) + internal PrivateLinkResourcesOperations(ServiceBusManagementClient client) { if (client == null) { @@ -51,7 +51,8 @@ internal EventHubsOperations(ServiceBusManagementClient client) public ServiceBusManagementClient Client { get; private set; } /// - /// Gets all the Event Hubs in a service bus Namespace. + /// Gets lists of resources that supports Privatelinks. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -80,7 +81,7 @@ internal EventHubsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -130,11 +131,11 @@ internal EventHubsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNamespace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.ServiceBus/namespaces/{namespaceName}/eventhubs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateLinkResources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -231,7 +232,7 @@ internal EventHubsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -244,175 +245,7 @@ internal EventHubsOperations(ServiceBusManagementClient client) _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; - } - - /// - /// Gets all the Event Hubs in a service bus Namespace. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNamespaceNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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("GET"); - _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; - // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 000000000000..d67835cfd4a8 --- /dev/null +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// 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.ServiceBus +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// Gets lists of resources that supports Privatelinks. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + public static PrivateLinkResourcesListResult Get(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string namespaceName) + { + return operations.GetAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets lists of resources that supports Privatelinks. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperations.cs index 6d07ba1fb283..f9f14ce9f66c 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperations.cs @@ -51,8 +51,8 @@ internal QueuesOperations(ServiceBusManagementClient client) public ServiceBusManagementClient Client { get; private set; } /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -60,15 +60,8 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial result. If a - /// previous response contains a nextLink element, the value of the nextLink - /// element will include a skip parameter that specifies a starting point to - /// use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The queue name. /// /// /// Headers that will be added to request. @@ -91,7 +84,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -123,29 +116,24 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (skip > 1000) + if (queueName == null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "skip", 1000); + throw new ValidationException(ValidationRules.CannotBeNull, "queueName"); } - if (skip < 0) + if (queueName != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0); + if (queueName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "queueName", 1); + } } - if (top > 1000) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 1000); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (top < 1) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -156,30 +144,22 @@ internal QueuesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("skip", skip); - tracingParameters.Add("top", top); + tracingParameters.Add("queueName", queueName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNamespace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", 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.ServiceBus/namespaces/{namespaceName}/queues").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); _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 (skip != null) - { - _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); - } - if (top != null) - { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -268,7 +248,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -281,7 +261,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -301,8 +281,7 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Creates or updates a Service Bus queue. This operation is idempotent. - /// + /// Creates an authorization rule for a queue. /// /// /// Name of the Resource group within the Azure subscription. @@ -313,8 +292,11 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create or update a queue resource. + /// The shared access authorization rule. /// /// /// Headers that will be added to request. @@ -337,7 +319,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, SBQueue parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -380,10 +362,29 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "queueName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -402,16 +403,18 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("queueName", queueName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -512,7 +515,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -525,7 +528,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -545,8 +548,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Deletes a queue from the specified namespace in a resource group. - /// + /// Deletes a queue authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -557,6 +560,9 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// Headers that will be added to request. /// @@ -575,7 +581,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -618,6 +624,21 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "queueName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -636,15 +657,17 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("queueName", queueName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -754,8 +777,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Returns a description for the specified queue. - /// + /// Gets an authorization rule for a queue by rule name. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -766,6 +789,9 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// Headers that will be added to request. /// @@ -787,7 +813,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -830,6 +856,21 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "queueName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -848,15 +889,17 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("queueName", queueName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -951,7 +994,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -964,7 +1007,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -984,8 +1027,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Gets all authorization rules for a queue. - /// + /// Primary and secondary connection strings to the queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -996,6 +1039,9 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// Headers that will be added to request. /// @@ -1017,7 +1063,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1060,6 +1106,21 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "queueName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1078,15 +1139,17 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("queueName", queueName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1100,7 +1163,7 @@ internal QueuesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1181,7 +1244,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1194,7 +1257,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1214,7 +1277,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Creates an authorization rule for a queue. + /// Regenerates the primary or secondary connection strings to the queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1229,7 +1293,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// /// /// Headers that will be added to request. @@ -1252,7 +1316,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1339,11 +1403,11 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); @@ -1361,7 +1425,7 @@ internal QueuesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1448,7 +1512,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1461,7 +1525,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1481,8 +1545,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Deletes a queue authorization rule. - /// + /// Gets the queues within a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1490,11 +1554,15 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// The queue name. + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// /// /// Headers that will be added to request. @@ -1505,6 +1573,9 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1514,7 +1585,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1546,39 +1617,29 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (queueName == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "queueName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (queueName != null) + if (Client.SubscriptionId == null) { - if (queueName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "queueName", 1); - } + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (authorizationRuleName == null) + if (skip > 1000) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "skip", 1000); } - if (authorizationRuleName != null) + if (skip < 0) { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0); } - if (Client.ApiVersion == null) + if (top > 1000) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 1000); } - if (Client.SubscriptionId == null) + if (top < 1) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1589,24 +1650,30 @@ internal QueuesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("queueName", queueName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); + tracingParameters.Add("skip", skip); + tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByNamespace", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _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 (skip != null) + { + _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1614,7 +1681,7 @@ internal QueuesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1665,7 +1732,7 @@ internal QueuesOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1695,13 +1762,31 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -1710,8 +1795,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Gets an authorization rule for a queue by rule name. - /// + /// Creates or updates a Service Bus queue. This operation is idempotent. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1722,8 +1807,8 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The queue name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create or update a queue resource. /// /// /// Headers that will be added to request. @@ -1746,7 +1831,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, SBQueue parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1789,20 +1874,9 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "queueName", 1); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) + if (parameters == null) { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (Client.ApiVersion == null) { @@ -1822,17 +1896,16 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("queueName", queueName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1846,7 +1919,7 @@ internal QueuesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1877,6 +1950,12 @@ internal QueuesOperations(ServiceBusManagementClient client) // 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) { @@ -1927,7 +2006,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1940,7 +2019,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1960,8 +2039,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Primary and secondary connection strings to the queue. - /// + /// Deletes a queue from the specified namespace in a resource group. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1972,9 +2051,6 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The queue name. /// - /// - /// The authorization rule name. - /// /// /// Headers that will be added to request. /// @@ -1984,9 +2060,6 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1996,7 +2069,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2039,21 +2112,6 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "queueName", 1); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) - { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -2072,17 +2130,15 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("queueName", queueName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2096,7 +2152,7 @@ internal QueuesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2147,7 +2203,7 @@ internal QueuesOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2177,31 +2233,13 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -2210,8 +2248,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Regenerates the primary or secondary connection strings to the queue. - /// + /// Returns a description for the specified queue. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -2222,12 +2260,6 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// The queue name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// Headers that will be added to request. /// @@ -2249,7 +2281,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string queueName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2292,29 +2324,6 @@ internal QueuesOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "queueName", 1); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) - { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -2333,18 +2342,15 @@ internal QueuesOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("queueName", queueName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{queueName}", System.Uri.EscapeDataString(queueName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2358,7 +2364,7 @@ internal QueuesOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2389,12 +2395,6 @@ internal QueuesOperations(ServiceBusManagementClient client) // 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) { @@ -2445,7 +2445,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2458,7 +2458,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2478,8 +2478,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -2505,7 +2505,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2520,7 +2520,7 @@ internal QueuesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNamespaceNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2614,7 +2614,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2627,7 +2627,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2647,8 +2647,8 @@ internal QueuesOperations(ServiceBusManagementClient client) } /// - /// Gets all authorization rules for a queue. - /// + /// Gets the queues within a namespace. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -2674,7 +2674,7 @@ internal QueuesOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2689,7 +2689,7 @@ internal QueuesOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByNamespaceNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2783,7 +2783,7 @@ internal QueuesOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2796,7 +2796,7 @@ internal QueuesOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperationsExtensions.cs index 3c7e0395cb81..ef68513e5020 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperationsExtensions.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/QueuesOperationsExtensions.cs @@ -22,8 +22,8 @@ namespace Microsoft.Azure.Management.ServiceBus public static partial class QueuesOperationsExtensions { /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// The operations group for this extension method. @@ -34,24 +34,17 @@ public static partial class QueuesOperationsExtensions /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial result. If a - /// previous response contains a nextLink element, the value of the nextLink - /// element will include a skip parameter that specifies a starting point to - /// use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The queue name. /// - public static IPage ListByNamespace(this IQueuesOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?)) + public static IPage ListAuthorizationRules(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName) { - return operations.ListByNamespaceAsync(resourceGroupName, namespaceName, skip, top).GetAwaiter().GetResult(); + return operations.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, queueName).GetAwaiter().GetResult(); } /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// The operations group for this extension method. @@ -62,30 +55,22 @@ public static partial class QueuesOperationsExtensions /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial result. If a - /// previous response contains a nextLink element, the value of the nextLink - /// element will include a skip parameter that specifies a starting point to - /// use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The queue name. /// /// /// The cancellation token. /// - public static async Task> ListByNamespaceAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAuthorizationRulesAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByNamespaceWithHttpMessagesAsync(resourceGroupName, namespaceName, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAuthorizationRulesWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates a Service Bus queue. This operation is idempotent. - /// + /// Creates an authorization rule for a queue. /// /// /// The operations group for this extension method. @@ -99,17 +84,19 @@ public static partial class QueuesOperationsExtensions /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create or update a queue resource. + /// The shared access authorization rule. /// - public static SBQueue CreateOrUpdate(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, SBQueue parameters) + public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters) { - return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, queueName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).GetAwaiter().GetResult(); } /// - /// Creates or updates a Service Bus queue. This operation is idempotent. - /// + /// Creates an authorization rule for a queue. /// /// /// The operations group for this extension method. @@ -123,23 +110,26 @@ public static SBQueue CreateOrUpdate(this IQueuesOperations operations, string r /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create or update a queue resource. + /// The shared access authorization rule. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, SBQueue parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAuthorizationRuleAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a queue from the specified namespace in a resource group. - /// + /// Deletes a queue authorization rule. + /// /// /// /// The operations group for this extension method. @@ -153,14 +143,17 @@ public static SBQueue CreateOrUpdate(this IQueuesOperations operations, string r /// /// The queue name. /// - public static void Delete(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName) + /// + /// The authorization rule name. + /// + public static void DeleteAuthorizationRule(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName) { - operations.DeleteAsync(resourceGroupName, namespaceName, queueName).GetAwaiter().GetResult(); + operations.DeleteAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).GetAwaiter().GetResult(); } /// - /// Deletes a queue from the specified namespace in a resource group. - /// + /// Deletes a queue authorization rule. + /// /// /// /// The operations group for this extension method. @@ -174,17 +167,20 @@ public static void Delete(this IQueuesOperations operations, string resourceGrou /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAuthorizationRuleAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Returns a description for the specified queue. - /// + /// Gets an authorization rule for a queue by rule name. + /// /// /// /// The operations group for this extension method. @@ -198,14 +194,17 @@ public static void Delete(this IQueuesOperations operations, string resourceGrou /// /// The queue name. /// - public static SBQueue Get(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName) + /// + /// The authorization rule name. + /// + public static SBAuthorizationRule GetAuthorizationRule(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName) { - return operations.GetAsync(resourceGroupName, namespaceName, queueName).GetAwaiter().GetResult(); + return operations.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).GetAwaiter().GetResult(); } /// - /// Returns a description for the specified queue. - /// + /// Gets an authorization rule for a queue by rule name. + /// /// /// /// The operations group for this extension method. @@ -219,20 +218,23 @@ public static SBQueue Get(this IQueuesOperations operations, string resourceGrou /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAuthorizationRuleAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all authorization rules for a queue. - /// + /// Primary and secondary connection strings to the queue. + /// /// /// /// The operations group for this extension method. @@ -246,14 +248,17 @@ public static SBQueue Get(this IQueuesOperations operations, string resourceGrou /// /// The queue name. /// - public static IPage ListAuthorizationRules(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName) + /// + /// The authorization rule name. + /// + public static AccessKeys ListKeys(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName) { - return operations.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, queueName).GetAwaiter().GetResult(); + return operations.ListKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).GetAwaiter().GetResult(); } /// - /// Gets all authorization rules for a queue. - /// + /// Primary and secondary connection strings to the queue. + /// /// /// /// The operations group for this extension method. @@ -267,19 +272,23 @@ public static IPage ListAuthorizationRules(this IQueuesOper /// /// The queue name. /// + /// + /// The authorization rule name. + /// /// /// The cancellation token. /// - public static async Task> ListAuthorizationRulesAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListKeysAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAuthorizationRulesWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates an authorization rule for a queue. + /// Regenerates the primary or secondary connection strings to the queue. + /// /// /// /// The operations group for this extension method. @@ -297,15 +306,16 @@ public static IPage ListAuthorizationRules(this IQueuesOper /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// - public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters) + public static AccessKeys RegenerateKeys(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).GetAwaiter().GetResult(); } /// - /// Creates an authorization rule for a queue. + /// Regenerates the primary or secondary connection strings to the queue. + /// /// /// /// The operations group for this extension method. @@ -323,22 +333,22 @@ public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this IQueuesOp /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAuthorizationRuleAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, SBAuthorizationRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateKeysAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a queue authorization rule. - /// + /// Gets the queues within a namespace. + /// /// /// /// The operations group for this extension method. @@ -349,20 +359,24 @@ public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this IQueuesOp /// /// The namespace name /// - /// - /// The queue name. + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// - public static void DeleteAuthorizationRule(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName) + public static IPage ListByNamespace(this IQueuesOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?)) { - operations.DeleteAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).GetAwaiter().GetResult(); + return operations.ListByNamespaceAsync(resourceGroupName, namespaceName, skip, top).GetAwaiter().GetResult(); } /// - /// Deletes a queue authorization rule. - /// + /// Gets the queues within a namespace. + /// /// /// /// The operations group for this extension method. @@ -373,23 +387,30 @@ public static void DeleteAuthorizationRule(this IQueuesOperations operations, st /// /// The namespace name /// - /// - /// The queue name. + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// /// /// The cancellation token. /// - public static async Task DeleteAuthorizationRuleAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByNamespaceAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.ListByNamespaceWithHttpMessagesAsync(resourceGroupName, namespaceName, skip, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets an authorization rule for a queue by rule name. - /// + /// Creates or updates a Service Bus queue. This operation is idempotent. + /// /// /// /// The operations group for this extension method. @@ -403,17 +424,17 @@ public static void DeleteAuthorizationRule(this IQueuesOperations operations, st /// /// The queue name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create or update a queue resource. /// - public static SBAuthorizationRule GetAuthorizationRule(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName) + public static SBQueue CreateOrUpdate(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, SBQueue parameters) { - return operations.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, queueName, parameters).GetAwaiter().GetResult(); } /// - /// Gets an authorization rule for a queue by rule name. - /// + /// Creates or updates a Service Bus queue. This operation is idempotent. + /// /// /// /// The operations group for this extension method. @@ -427,23 +448,23 @@ public static SBAuthorizationRule GetAuthorizationRule(this IQueuesOperations op /// /// The queue name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create or update a queue resource. /// /// /// The cancellation token. /// - public static async Task GetAuthorizationRuleAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, SBQueue parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Primary and secondary connection strings to the queue. - /// + /// Deletes a queue from the specified namespace in a resource group. + /// /// /// /// The operations group for this extension method. @@ -457,17 +478,14 @@ public static SBAuthorizationRule GetAuthorizationRule(this IQueuesOperations op /// /// The queue name. /// - /// - /// The authorization rule name. - /// - public static AccessKeys ListKeys(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName) + public static void Delete(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName) { - return operations.ListKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, namespaceName, queueName).GetAwaiter().GetResult(); } /// - /// Primary and secondary connection strings to the queue. - /// + /// Deletes a queue from the specified namespace in a resource group. + /// /// /// /// The operations group for this extension method. @@ -481,23 +499,17 @@ public static AccessKeys ListKeys(this IQueuesOperations operations, string reso /// /// The queue name. /// - /// - /// The authorization rule name. - /// /// /// The cancellation token. /// - public static async Task ListKeysAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Regenerates the primary or secondary connection strings to the queue. - /// + /// Returns a description for the specified queue. + /// /// /// /// The operations group for this extension method. @@ -511,20 +523,14 @@ public static AccessKeys ListKeys(this IQueuesOperations operations, string reso /// /// The queue name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// - public static AccessKeys RegenerateKeys(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters) + public static SBQueue Get(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName) { - return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, namespaceName, queueName).GetAwaiter().GetResult(); } /// - /// Regenerates the primary or secondary connection strings to the queue. - /// + /// Returns a description for the specified queue. + /// /// /// /// The operations group for this extension method. @@ -538,26 +544,20 @@ public static AccessKeys RegenerateKeys(this IQueuesOperations operations, strin /// /// The queue name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// The cancellation token. /// - public static async Task RegenerateKeysAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IQueuesOperations operations, string resourceGroupName, string namespaceName, string queueName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, namespaceName, queueName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// The operations group for this extension method. @@ -565,14 +565,14 @@ public static AccessKeys RegenerateKeys(this IQueuesOperations operations, strin /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByNamespaceNext(this IQueuesOperations operations, string nextPageLink) + public static IPage ListAuthorizationRulesNext(this IQueuesOperations operations, string nextPageLink) { - return operations.ListByNamespaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListAuthorizationRulesNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets the queues within a namespace. - /// + /// Gets all authorization rules for a queue. + /// /// /// /// The operations group for this extension method. @@ -583,17 +583,17 @@ public static IPage ListByNamespaceNext(this IQueuesOperations operatio /// /// The cancellation token. /// - public static async Task> ListByNamespaceNextAsync(this IQueuesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAuthorizationRulesNextAsync(this IQueuesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByNamespaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAuthorizationRulesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all authorization rules for a queue. - /// + /// Gets the queues within a namespace. + /// /// /// /// The operations group for this extension method. @@ -601,14 +601,14 @@ public static IPage ListByNamespaceNext(this IQueuesOperations operatio /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAuthorizationRulesNext(this IQueuesOperations operations, string nextPageLink) + public static IPage ListByNamespaceNext(this IQueuesOperations operations, string nextPageLink) { - return operations.ListAuthorizationRulesNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByNamespaceNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets all authorization rules for a queue. - /// + /// Gets the queues within a namespace. + /// /// /// /// The operations group for this extension method. @@ -619,9 +619,9 @@ public static IPage ListAuthorizationRulesNext(this IQueues /// /// The cancellation token. /// - public static async Task> ListAuthorizationRulesNextAsync(this IQueuesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByNamespaceNextAsync(this IQueuesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAuthorizationRulesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByNamespaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RegionsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RegionsOperations.cs deleted file mode 100644 index 73dcb97248ff..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RegionsOperations.cs +++ /dev/null @@ -1,415 +0,0 @@ -// -// 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.ServiceBus -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// RegionsOperations operations. - /// - internal partial class RegionsOperations : IServiceOperations, IRegionsOperations - { - /// - /// Initializes a new instance of the RegionsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal RegionsOperations(ServiceBusManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ServiceBusManagementClient - /// - public ServiceBusManagementClient Client { get; private set; } - - /// - /// Gets the available Regions for a given sku - /// - /// - /// The sku type. - /// - /// - /// 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>> ListBySkuWithHttpMessagesAsync(string sku, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (sku == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sku"); - } - if (sku != null) - { - if (sku.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "sku", 50); - } - if (sku.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "sku", 1); - } - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("sku", sku); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySku", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/sku/{sku}/regions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{sku}", System.Uri.EscapeDataString(sku)); - 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("GET"); - _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; - // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Gets the available Regions for a given sku - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListBySkuNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySkuNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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("GET"); - _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; - // 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RegionsOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RegionsOperationsExtensions.cs deleted file mode 100644 index a743454c079a..000000000000 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RegionsOperationsExtensions.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// 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.ServiceBus -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for RegionsOperations. - /// - public static partial class RegionsOperationsExtensions - { - /// - /// Gets the available Regions for a given sku - /// - /// - /// The operations group for this extension method. - /// - /// - /// The sku type. - /// - public static IPage ListBySku(this IRegionsOperations operations, string sku) - { - return operations.ListBySkuAsync(sku).GetAwaiter().GetResult(); - } - - /// - /// Gets the available Regions for a given sku - /// - /// - /// The operations group for this extension method. - /// - /// - /// The sku type. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySkuAsync(this IRegionsOperations operations, string sku, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySkuWithHttpMessagesAsync(sku, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the available Regions for a given sku - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySkuNext(this IRegionsOperations operations, string nextPageLink) - { - return operations.ListBySkuNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the available Regions for a given sku - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySkuNextAsync(this IRegionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySkuNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/SdkInfo_ServiceBusManagementClient.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/SdkInfo_ServiceBusManagementClient.cs index c4b79f7a1e4e..4d715dd01224 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/SdkInfo_ServiceBusManagementClient.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/SdkInfo_ServiceBusManagementClient.cs @@ -19,17 +19,16 @@ public static IEnumerable> ApiInfo_ServiceBusManag { return new Tuple[] { - new Tuple("ServiceBus", "DisasterRecoveryConfigs", "2017-04-01"), - new Tuple("ServiceBus", "EventHubs", "2017-04-01"), - new Tuple("ServiceBus", "MigrationConfigs", "2017-04-01"), - new Tuple("ServiceBus", "Namespaces", "2017-04-01"), - new Tuple("ServiceBus", "Operations", "2017-04-01"), - new Tuple("ServiceBus", "PremiumMessagingRegions", "2017-04-01"), - new Tuple("ServiceBus", "Queues", "2017-04-01"), - new Tuple("ServiceBus", "Regions", "2017-04-01"), - new Tuple("ServiceBus", "Rules", "2017-04-01"), - new Tuple("ServiceBus", "Subscriptions", "2017-04-01"), - new Tuple("ServiceBus", "Topics", "2017-04-01"), + new Tuple("ServiceBus", "DisasterRecoveryConfigs", "2021-06-01-preview"), + new Tuple("ServiceBus", "MigrationConfigs", "2021-06-01-preview"), + new Tuple("ServiceBus", "Namespaces", "2021-06-01-preview"), + new Tuple("ServiceBus", "Operations", "2021-06-01-preview"), + new Tuple("ServiceBus", "PrivateEndpointConnections", "2021-06-01-preview"), + new Tuple("ServiceBus", "PrivateLinkResources", "2021-06-01-preview"), + new Tuple("ServiceBus", "Queues", "2021-06-01-preview"), + new Tuple("ServiceBus", "Rules", "2021-06-01-preview"), + new Tuple("ServiceBus", "Subscriptions", "2021-06-01-preview"), + new Tuple("ServiceBus", "Topics", "2021-06-01-preview"), }.AsEnumerable(); } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ServiceBusManagementClient.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ServiceBusManagementClient.cs index 7a0987049023..12b4cf7e6a02 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ServiceBusManagementClient.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/ServiceBusManagementClient.cs @@ -21,9 +21,6 @@ namespace Microsoft.Azure.Management.ServiceBus using System.Net; using System.Net.Http; - /// - /// Azure Service Bus client - /// public partial class ServiceBusManagementClient : ServiceClient, IServiceBusManagementClient, IAzureClient { /// @@ -77,14 +74,24 @@ public partial class ServiceBusManagementClient : ServiceClient - /// Gets the IOperations. + /// Gets the INamespacesOperations. /// - public virtual IOperations Operations { get; private set; } + public virtual INamespacesOperations Namespaces { get; private set; } /// - /// Gets the INamespacesOperations. + /// Gets the IPrivateEndpointConnectionsOperations. /// - public virtual INamespacesOperations Namespaces { get; private set; } + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } /// /// Gets the IDisasterRecoveryConfigsOperations. @@ -106,30 +113,15 @@ public partial class ServiceBusManagementClient : ServiceClient public virtual ITopicsOperations Topics { get; private set; } - /// - /// Gets the ISubscriptionsOperations. - /// - public virtual ISubscriptionsOperations Subscriptions { get; private set; } - /// /// Gets the IRulesOperations. /// public virtual IRulesOperations Rules { get; private set; } /// - /// Gets the IRegionsOperations. - /// - public virtual IRegionsOperations Regions { get; private set; } - - /// - /// Gets the IPremiumMessagingRegionsOperations. - /// - public virtual IPremiumMessagingRegionsOperations PremiumMessagingRegions { get; private set; } - - /// - /// Gets the IEventHubsOperations. + /// Gets the ISubscriptionsOperations. /// - public virtual IEventHubsOperations EventHubs { get; private set; } + public virtual ISubscriptionsOperations Subscriptions { get; private set; } /// /// Initializes a new instance of the ServiceBusManagementClient class. @@ -372,19 +364,18 @@ public ServiceBusManagementClient(System.Uri baseUri, ServiceClientCredentials c /// private void Initialize() { - Operations = new Operations(this); Namespaces = new NamespacesOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + Operations = new Operations(this); DisasterRecoveryConfigs = new DisasterRecoveryConfigsOperations(this); MigrationConfigs = new MigrationConfigsOperations(this); Queues = new QueuesOperations(this); Topics = new TopicsOperations(this); - Subscriptions = new SubscriptionsOperations(this); Rules = new RulesOperations(this); - Regions = new RegionsOperations(this); - PremiumMessagingRegions = new PremiumMessagingRegionsOperations(this); - EventHubs = new EventHubsOperations(this); + Subscriptions = new SubscriptionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2017-04-01"; + ApiVersion = "2021-06-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperations.cs index dd4801028c2a..be7bfd727d4b 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperations.cs @@ -51,8 +51,8 @@ internal TopicsOperations(ServiceBusManagementClient client) public ServiceBusManagementClient Client { get; private set; } /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -60,15 +60,8 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial result. If a - /// previous response contains a nextLink element, the value of the nextLink - /// element will include a skip parameter that specifies a starting point to - /// use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The topic name. /// /// /// Headers that will be added to request. @@ -91,7 +84,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -123,29 +116,24 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (skip > 1000) + if (topicName == null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "skip", 1000); + throw new ValidationException(ValidationRules.CannotBeNull, "topicName"); } - if (skip < 0) + if (topicName != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0); + if (topicName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "topicName", 1); + } } - if (top > 1000) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 1000); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (top < 1) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -156,30 +144,22 @@ internal TopicsOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("skip", skip); - tracingParameters.Add("top", top); + tracingParameters.Add("topicName", topicName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNamespace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", 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.ServiceBus/namespaces/{namespaceName}/topics").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); _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 (skip != null) - { - _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); - } - if (top != null) - { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -268,7 +248,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -281,7 +261,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -301,8 +281,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Creates a topic in the specified namespace. - /// + /// Creates an authorization rule for the specified topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -313,8 +293,11 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create a topic resource. + /// The shared access authorization rule. /// /// /// Headers that will be added to request. @@ -337,7 +320,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, SBTopic parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -380,10 +363,29 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "topicName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -402,16 +404,18 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("topicName", topicName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -512,7 +516,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -525,7 +529,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -545,8 +549,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Deletes a topic from the specified namespace and resource group. - /// + /// Returns the specified authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -557,6 +561,9 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// Headers that will be added to request. /// @@ -566,6 +573,9 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -575,7 +585,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -618,6 +628,21 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "topicName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -636,15 +661,17 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("topicName", topicName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -658,7 +685,7 @@ internal TopicsOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -709,7 +736,7 @@ internal TopicsOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -739,13 +766,31 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -754,8 +799,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Returns a description for the specified topic. - /// + /// Deletes a topic authorization rule. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -766,6 +811,9 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// Headers that will be added to request. /// @@ -775,9 +823,6 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -787,7 +832,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -830,6 +875,21 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "topicName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -848,15 +908,17 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("topicName", topicName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -870,7 +932,7 @@ internal TopicsOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -921,7 +983,7 @@ internal TopicsOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -951,31 +1013,13 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -984,8 +1028,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Gets authorization rules for a topic. - /// + /// Gets the primary and secondary connection strings for the topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -996,6 +1040,9 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// Headers that will be added to request. /// @@ -1017,7 +1064,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAuthorizationRulesWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1060,6 +1107,21 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "topicName", 1); } } + if (authorizationRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + } + if (authorizationRuleName != null) + { + if (authorizationRuleName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); + } + if (authorizationRuleName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); + } + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1078,15 +1140,17 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("topicName", topicName); + tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListKeys", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); + _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1100,7 +1164,7 @@ internal TopicsOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1181,7 +1245,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1194,7 +1258,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1214,8 +1278,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Creates an authorization rule for the specified topic. - /// + /// Regenerates primary or secondary connection strings for the topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1230,7 +1294,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// /// /// Headers that will be added to request. @@ -1253,7 +1317,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1340,11 +1404,11 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); @@ -1362,7 +1426,7 @@ internal TopicsOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1449,7 +1513,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1462,7 +1526,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1482,8 +1546,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Returns the specified authorization rule. - /// + /// Gets all the topics in a namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1491,11 +1555,15 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The namespace name /// - /// - /// The topic name. + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// /// /// Headers that will be added to request. @@ -1518,7 +1586,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1550,39 +1618,29 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (topicName == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "topicName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (topicName != null) + if (Client.SubscriptionId == null) { - if (topicName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "topicName", 1); - } + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (authorizationRuleName == null) + if (skip > 1000) { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "skip", 1000); } - if (authorizationRuleName != null) + if (skip < 0) { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0); } - if (Client.ApiVersion == null) + if (top > 1000) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 1000); } - if (Client.SubscriptionId == null) + if (top < 1) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1593,24 +1651,30 @@ internal TopicsOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("topicName", topicName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); + tracingParameters.Add("skip", skip); + tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByNamespace", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); - _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _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 (skip != null) + { + _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1699,7 +1763,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1712,7 +1776,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1732,8 +1796,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Deletes a topic authorization rule. - /// + /// Creates a topic in the specified namespace. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1744,8 +1808,8 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The topic name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create a topic resource. /// /// /// Headers that will be added to request. @@ -1756,6 +1820,9 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1765,7 +1832,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, SBTopic parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1808,20 +1875,9 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "topicName", 1); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) + if (parameters == null) { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (Client.ApiVersion == null) { @@ -1841,17 +1897,16 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("topicName", topicName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1865,7 +1920,7 @@ internal TopicsOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1896,6 +1951,12 @@ internal TopicsOperations(ServiceBusManagementClient client) // 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) { @@ -1916,7 +1977,7 @@ internal TopicsOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1946,13 +2007,31 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -1961,8 +2040,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Gets the primary and secondary connection strings for the topic. - /// + /// Deletes a topic from the specified namespace and resource group. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -1973,9 +2052,6 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The topic name. /// - /// - /// The authorization rule name. - /// /// /// Headers that will be added to request. /// @@ -1985,9 +2061,6 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1997,7 +2070,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2040,21 +2113,6 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "topicName", 1); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) - { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -2073,17 +2131,15 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("topicName", topicName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2097,7 +2153,7 @@ internal TopicsOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2148,7 +2204,7 @@ internal TopicsOperations(ServiceBusManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2178,31 +2234,13 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + 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); @@ -2211,8 +2249,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Regenerates primary or secondary connection strings for the topic. - /// + /// Returns a description for the specified topic. + /// /// /// /// Name of the Resource group within the Azure subscription. @@ -2223,12 +2261,6 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// The topic name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// Headers that will be added to request. /// @@ -2250,7 +2282,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string topicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2293,29 +2325,6 @@ internal TopicsOperations(ServiceBusManagementClient client) throw new ValidationException(ValidationRules.MinLength, "topicName", 1); } } - if (authorizationRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationRuleName"); - } - if (authorizationRuleName != null) - { - if (authorizationRuleName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "authorizationRuleName", 50); - } - if (authorizationRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); - } - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -2334,18 +2343,15 @@ internal TopicsOperations(ServiceBusManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("topicName", topicName); - tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{topicName}", System.Uri.EscapeDataString(topicName)); - _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2359,7 +2365,7 @@ internal TopicsOperations(ServiceBusManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2390,12 +2396,6 @@ internal TopicsOperations(ServiceBusManagementClient client) // 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) { @@ -2446,7 +2446,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2459,7 +2459,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2479,8 +2479,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -2506,7 +2506,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2521,7 +2521,7 @@ internal TopicsOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNamespaceNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRulesNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2615,7 +2615,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2628,7 +2628,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2648,8 +2648,8 @@ internal TopicsOperations(ServiceBusManagementClient client) } /// - /// Gets authorization rules for a topic. - /// + /// Gets all the topics in a namespace. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -2675,7 +2675,7 @@ internal TopicsOperations(ServiceBusManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2690,7 +2690,7 @@ internal TopicsOperations(ServiceBusManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRulesNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByNamespaceNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2784,7 +2784,7 @@ internal TopicsOperations(ServiceBusManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2797,7 +2797,7 @@ internal TopicsOperations(ServiceBusManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperationsExtensions.cs index d03ec60ab673..14047a70ea81 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperationsExtensions.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/TopicsOperationsExtensions.cs @@ -22,8 +22,8 @@ namespace Microsoft.Azure.Management.ServiceBus public static partial class TopicsOperationsExtensions { /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// The operations group for this extension method. @@ -34,24 +34,17 @@ public static partial class TopicsOperationsExtensions /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial result. If a - /// previous response contains a nextLink element, the value of the nextLink - /// element will include a skip parameter that specifies a starting point to - /// use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The topic name. /// - public static IPage ListByNamespace(this ITopicsOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?)) + public static IPage ListAuthorizationRules(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName) { - return operations.ListByNamespaceAsync(resourceGroupName, namespaceName, skip, top).GetAwaiter().GetResult(); + return operations.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, topicName).GetAwaiter().GetResult(); } /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// The operations group for this extension method. @@ -62,30 +55,23 @@ public static partial class TopicsOperationsExtensions /// /// The namespace name /// - /// - /// Skip is only used if a previous operation returned a partial result. If a - /// previous response contains a nextLink element, the value of the nextLink - /// element will include a skip parameter that specifies a starting point to - /// use for subsequent calls. - /// - /// - /// May be used to limit the number of results to the most recent N - /// usageDetails. + /// + /// The topic name. /// /// /// The cancellation token. /// - public static async Task> ListByNamespaceAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAuthorizationRulesAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByNamespaceWithHttpMessagesAsync(resourceGroupName, namespaceName, skip, top, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAuthorizationRulesWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a topic in the specified namespace. - /// + /// Creates an authorization rule for the specified topic. + /// /// /// /// The operations group for this extension method. @@ -99,17 +85,20 @@ public static partial class TopicsOperationsExtensions /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create a topic resource. + /// The shared access authorization rule. /// - public static SBTopic CreateOrUpdate(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, SBTopic parameters) + public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters) { - return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, topicName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).GetAwaiter().GetResult(); } /// - /// Creates a topic in the specified namespace. - /// + /// Creates an authorization rule for the specified topic. + /// /// /// /// The operations group for this extension method. @@ -123,23 +112,26 @@ public static SBTopic CreateOrUpdate(this ITopicsOperations operations, string r /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// - /// Parameters supplied to create a topic resource. + /// The shared access authorization rule. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, SBTopic parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAuthorizationRuleAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a topic from the specified namespace and resource group. - /// + /// Returns the specified authorization rule. + /// /// /// /// The operations group for this extension method. @@ -153,14 +145,17 @@ public static SBTopic CreateOrUpdate(this ITopicsOperations operations, string r /// /// The topic name. /// - public static void Delete(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName) + /// + /// The authorization rule name. + /// + public static SBAuthorizationRule GetAuthorizationRule(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName) { - operations.DeleteAsync(resourceGroupName, namespaceName, topicName).GetAwaiter().GetResult(); + return operations.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).GetAwaiter().GetResult(); } /// - /// Deletes a topic from the specified namespace and resource group. - /// + /// Returns the specified authorization rule. + /// /// /// /// The operations group for this extension method. @@ -174,17 +169,23 @@ public static void Delete(this ITopicsOperations operations, string resourceGrou /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAuthorizationRuleAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Returns a description for the specified topic. - /// + /// Deletes a topic authorization rule. + /// /// /// /// The operations group for this extension method. @@ -198,14 +199,17 @@ public static void Delete(this ITopicsOperations operations, string resourceGrou /// /// The topic name. /// - public static SBTopic Get(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName) + /// + /// The authorization rule name. + /// + public static void DeleteAuthorizationRule(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName) { - return operations.GetAsync(resourceGroupName, namespaceName, topicName).GetAwaiter().GetResult(); + operations.DeleteAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).GetAwaiter().GetResult(); } /// - /// Returns a description for the specified topic. - /// + /// Deletes a topic authorization rule. + /// /// /// /// The operations group for this extension method. @@ -219,20 +223,20 @@ public static SBTopic Get(this ITopicsOperations operations, string resourceGrou /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAuthorizationRuleAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Gets authorization rules for a topic. - /// + /// Gets the primary and secondary connection strings for the topic. + /// /// /// /// The operations group for this extension method. @@ -246,14 +250,17 @@ public static SBTopic Get(this ITopicsOperations operations, string resourceGrou /// /// The topic name. /// - public static IPage ListAuthorizationRules(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName) + /// + /// The authorization rule name. + /// + public static AccessKeys ListKeys(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName) { - return operations.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, topicName).GetAwaiter().GetResult(); + return operations.ListKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).GetAwaiter().GetResult(); } /// - /// Gets authorization rules for a topic. - /// + /// Gets the primary and secondary connection strings for the topic. + /// /// /// /// The operations group for this extension method. @@ -267,20 +274,23 @@ public static IPage ListAuthorizationRules(this ITopicsOper /// /// The topic name. /// + /// + /// The authorization rule name. + /// /// /// The cancellation token. /// - public static async Task> ListAuthorizationRulesAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListKeysAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAuthorizationRulesWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates an authorization rule for the specified topic. - /// + /// Regenerates primary or secondary connection strings for the topic. + /// /// /// /// The operations group for this extension method. @@ -298,16 +308,16 @@ public static IPage ListAuthorizationRules(this ITopicsOper /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// - public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters) + public static AccessKeys RegenerateKeys(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters) { - return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).GetAwaiter().GetResult(); } /// - /// Creates an authorization rule for the specified topic. - /// + /// Regenerates primary or secondary connection strings for the topic. + /// /// /// /// The operations group for this extension method. @@ -325,22 +335,22 @@ public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this ITopicsOp /// The authorization rule name. /// /// - /// The shared access authorization rule. + /// Parameters supplied to regenerate the authorization rule. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAuthorizationRuleAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, SBAuthorizationRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateKeysAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Returns the specified authorization rule. - /// + /// Gets all the topics in a namespace. + /// /// /// /// The operations group for this extension method. @@ -351,20 +361,24 @@ public static SBAuthorizationRule CreateOrUpdateAuthorizationRule(this ITopicsOp /// /// The namespace name /// - /// - /// The topic name. + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// - public static SBAuthorizationRule GetAuthorizationRule(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName) + public static IPage ListByNamespace(this ITopicsOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?)) { - return operations.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).GetAwaiter().GetResult(); + return operations.ListByNamespaceAsync(resourceGroupName, namespaceName, skip, top).GetAwaiter().GetResult(); } /// - /// Returns the specified authorization rule. - /// + /// Gets all the topics in a namespace. + /// /// /// /// The operations group for this extension method. @@ -375,26 +389,30 @@ public static SBAuthorizationRule GetAuthorizationRule(this ITopicsOperations op /// /// The namespace name /// - /// - /// The topic name. + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. /// - /// - /// The authorization rule name. + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. /// /// /// The cancellation token. /// - public static async Task GetAuthorizationRuleAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByNamespaceAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByNamespaceWithHttpMessagesAsync(resourceGroupName, namespaceName, skip, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a topic authorization rule. - /// + /// Creates a topic in the specified namespace. + /// /// /// /// The operations group for this extension method. @@ -408,17 +426,17 @@ public static SBAuthorizationRule GetAuthorizationRule(this ITopicsOperations op /// /// The topic name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create a topic resource. /// - public static void DeleteAuthorizationRule(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName) + public static SBTopic CreateOrUpdate(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, SBTopic parameters) { - operations.DeleteAuthorizationRuleAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, topicName, parameters).GetAwaiter().GetResult(); } /// - /// Deletes a topic authorization rule. - /// + /// Creates a topic in the specified namespace. + /// /// /// /// The operations group for this extension method. @@ -432,20 +450,23 @@ public static void DeleteAuthorizationRule(this ITopicsOperations operations, st /// /// The topic name. /// - /// - /// The authorization rule name. + /// + /// Parameters supplied to create a topic resource. /// /// /// The cancellation token. /// - public static async Task DeleteAuthorizationRuleAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, SBTopic parameters, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Gets the primary and secondary connection strings for the topic. - /// + /// Deletes a topic from the specified namespace and resource group. + /// /// /// /// The operations group for this extension method. @@ -459,17 +480,14 @@ public static void DeleteAuthorizationRule(this ITopicsOperations operations, st /// /// The topic name. /// - /// - /// The authorization rule name. - /// - public static AccessKeys ListKeys(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName) + public static void Delete(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName) { - return operations.ListKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, namespaceName, topicName).GetAwaiter().GetResult(); } /// - /// Gets the primary and secondary connection strings for the topic. - /// + /// Deletes a topic from the specified namespace and resource group. + /// /// /// /// The operations group for this extension method. @@ -483,23 +501,17 @@ public static AccessKeys ListKeys(this ITopicsOperations operations, string reso /// /// The topic name. /// - /// - /// The authorization rule name. - /// /// /// The cancellation token. /// - public static async Task ListKeysAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Regenerates primary or secondary connection strings for the topic. - /// + /// Returns a description for the specified topic. + /// /// /// /// The operations group for this extension method. @@ -513,20 +525,14 @@ public static AccessKeys ListKeys(this ITopicsOperations operations, string reso /// /// The topic name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// - public static AccessKeys RegenerateKeys(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters) + public static SBTopic Get(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName) { - return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, namespaceName, topicName).GetAwaiter().GetResult(); } /// - /// Regenerates primary or secondary connection strings for the topic. - /// + /// Returns a description for the specified topic. + /// /// /// /// The operations group for this extension method. @@ -540,26 +546,20 @@ public static AccessKeys RegenerateKeys(this ITopicsOperations operations, strin /// /// The topic name. /// - /// - /// The authorization rule name. - /// - /// - /// Parameters supplied to regenerate the authorization rule. - /// /// /// The cancellation token. /// - public static async Task RegenerateKeysAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ITopicsOperations operations, string resourceGroupName, string namespaceName, string topicName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, namespaceName, topicName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// The operations group for this extension method. @@ -567,14 +567,14 @@ public static AccessKeys RegenerateKeys(this ITopicsOperations operations, strin /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByNamespaceNext(this ITopicsOperations operations, string nextPageLink) + public static IPage ListAuthorizationRulesNext(this ITopicsOperations operations, string nextPageLink) { - return operations.ListByNamespaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListAuthorizationRulesNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets all the topics in a namespace. - /// + /// Gets authorization rules for a topic. + /// /// /// /// The operations group for this extension method. @@ -585,17 +585,17 @@ public static IPage ListByNamespaceNext(this ITopicsOperations operatio /// /// The cancellation token. /// - public static async Task> ListByNamespaceNextAsync(this ITopicsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAuthorizationRulesNextAsync(this ITopicsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByNamespaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAuthorizationRulesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets authorization rules for a topic. - /// + /// Gets all the topics in a namespace. + /// /// /// /// The operations group for this extension method. @@ -603,14 +603,14 @@ public static IPage ListByNamespaceNext(this ITopicsOperations operatio /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListAuthorizationRulesNext(this ITopicsOperations operations, string nextPageLink) + public static IPage ListByNamespaceNext(this ITopicsOperations operations, string nextPageLink) { - return operations.ListAuthorizationRulesNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByNamespaceNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Gets authorization rules for a topic. - /// + /// Gets all the topics in a namespace. + /// /// /// /// The operations group for this extension method. @@ -621,9 +621,9 @@ public static IPage ListAuthorizationRulesNext(this ITopics /// /// The cancellation token. /// - public static async Task> ListAuthorizationRulesNextAsync(this ITopicsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByNamespaceNextAsync(this ITopicsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAuthorizationRulesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByNamespaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; }