diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ClustersOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ClustersOperations.cs index 30988d1dfe11..4f25ef29d03f 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ClustersOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ClustersOperations.cs @@ -81,7 +81,10 @@ internal ClustersOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -89,7 +92,6 @@ internal ClustersOperations(EventHubManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAvailableClusterRegion", tracingParameters); } @@ -98,9 +100,9 @@ internal ClustersOperations(EventHubManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -270,7 +272,10 @@ internal ClustersOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2018-01-01-preview"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -279,7 +284,6 @@ internal ClustersOperations(EventHubManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -289,9 +293,9 @@ internal ClustersOperations(EventHubManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -479,7 +483,10 @@ internal ClustersOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "clusterName", 6); } } - string apiVersion = "2018-01-01-preview"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -489,7 +496,6 @@ internal ClustersOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -500,9 +506,9 @@ internal ClustersOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -763,7 +769,10 @@ internal ClustersOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "clusterName", 6); } } - string apiVersion = "2018-01-01-preview"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -773,7 +782,6 @@ internal ClustersOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListNamespaces", tracingParameters); } @@ -784,9 +792,9 @@ internal ClustersOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -985,7 +993,10 @@ internal ClustersOperations(EventHubManagementClient client) { parameters.Validate(); } - string apiVersion = "2018-01-01-preview"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -996,7 +1007,6 @@ internal ClustersOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1007,9 +1017,9 @@ internal ClustersOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1225,11 +1235,14 @@ internal ClustersOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "clusterName", 6); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1239,7 +1252,6 @@ internal ClustersOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -1251,9 +1263,9 @@ internal ClustersOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1462,7 +1474,10 @@ internal ClustersOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "clusterName", 6); } } - string apiVersion = "2018-01-01-preview"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1472,7 +1487,6 @@ internal ClustersOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1483,9 +1497,9 @@ internal ClustersOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperations.cs index b8df6fec760a..b3faec2f3519 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperations.cs @@ -61,8 +61,9 @@ internal ConfigurationOperations(EventHubManagementClient client) /// /// The name of the Event Hubs Cluster. /// - /// - /// Parameters for creating an Event Hubs Cluster resource. + /// + /// All possible Cluster settings - a collection of key/value paired settings + /// which apply to quotas and configurations imposed on the cluster. /// /// /// Headers that will be added to request. @@ -85,7 +86,7 @@ internal ConfigurationOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterQuotaConfigurationProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PatchWithHttpMessagesAsync(string resourceGroupName, string clusterName, IDictionary settings = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -121,11 +122,15 @@ internal ConfigurationOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "clusterName", 6); } } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + ClusterQuotaConfigurationProperties parameters = new ClusterQuotaConfigurationProperties(); + if (settings != null) + { + parameters.Settings = settings; } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -135,7 +140,6 @@ internal ConfigurationOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters); @@ -147,9 +151,9 @@ internal ConfigurationOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -362,7 +366,10 @@ internal ConfigurationOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "clusterName", 6); } } - string apiVersion = "2018-01-01-preview"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -372,7 +379,6 @@ internal ConfigurationOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -383,9 +389,9 @@ internal ConfigurationOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperationsExtensions.cs index 4fd16e0120d8..b257776d51c0 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperationsExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConfigurationOperationsExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.EventHub using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -35,12 +37,13 @@ public static partial class ConfigurationOperationsExtensions /// /// The name of the Event Hubs Cluster. /// - /// - /// Parameters for creating an Event Hubs Cluster resource. + /// + /// All possible Cluster settings - a collection of key/value paired settings + /// which apply to quotas and configurations imposed on the cluster. /// - public static ClusterQuotaConfigurationProperties Patch(this IConfigurationOperations operations, string resourceGroupName, string clusterName, ClusterQuotaConfigurationProperties parameters) + public static ClusterQuotaConfigurationProperties Patch(this IConfigurationOperations operations, string resourceGroupName, string clusterName, IDictionary settings = default(IDictionary)) { - return operations.PatchAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + return operations.PatchAsync(resourceGroupName, clusterName, settings).GetAwaiter().GetResult(); } /// @@ -57,15 +60,16 @@ public static ClusterQuotaConfigurationProperties Patch(this IConfigurationOpera /// /// The name of the Event Hubs Cluster. /// - /// - /// Parameters for creating an Event Hubs Cluster resource. + /// + /// All possible Cluster settings - a collection of key/value paired settings + /// which apply to quotas and configurations imposed on the cluster. /// /// /// The cancellation token. /// - public static async Task PatchAsync(this IConfigurationOperations operations, string resourceGroupName, string clusterName, ClusterQuotaConfigurationProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task PatchAsync(this IConfigurationOperations operations, string resourceGroupName, string clusterName, IDictionary settings = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, clusterName, settings, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperations.cs index f6413b48833d..8d3fb3a67b5c 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperations.cs @@ -66,8 +66,11 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) /// /// The consumer group name /// - /// - /// Parameters supplied to create or update a consumer group resource. + /// + /// User Metadata is a placeholder to store user-defined string data with + /// maximum length 1024. e.g. it can be used to store descriptive data, such as + /// list of teams and their contact information also user-defined configuration + /// settings can be stored. /// /// /// Headers that will be added to request. @@ -90,7 +93,7 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, ConsumerGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, string userMetadata = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -152,15 +155,19 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "consumerGroupName", 1); } } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; + ConsumerGroup parameters = new ConsumerGroup(); + if (userMetadata != null) + { + parameters.UserMetadata = userMetadata; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -173,7 +180,6 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("consumerGroupName", consumerGroupName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -186,9 +192,9 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) _url = _url.Replace("{consumerGroupName}", System.Uri.EscapeDataString(consumerGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -411,11 +417,14 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "consumerGroupName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -427,7 +436,6 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("consumerGroupName", consumerGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -440,9 +448,9 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) _url = _url.Replace("{consumerGroupName}", System.Uri.EscapeDataString(consumerGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -644,11 +652,14 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "consumerGroupName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -660,7 +671,6 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("consumerGroupName", consumerGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -673,9 +683,9 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) _url = _url.Replace("{consumerGroupName}", System.Uri.EscapeDataString(consumerGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -888,6 +898,10 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "eventHubName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -908,7 +922,6 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,7 +932,6 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("skip", skip); tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); @@ -933,9 +945,9 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) _url = _url.Replace("{eventHubName}", System.Uri.EscapeDataString(eventHubName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skip != null) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperationsExtensions.cs index 2c733437230d..8a822b02d36b 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperationsExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ConsumerGroupsOperationsExtensions.cs @@ -40,12 +40,15 @@ public static partial class ConsumerGroupsOperationsExtensions /// /// The consumer group name /// - /// - /// Parameters supplied to create or update a consumer group resource. + /// + /// User Metadata is a placeholder to store user-defined string data with + /// maximum length 1024. e.g. it can be used to store descriptive data, such as + /// list of teams and their contact information also user-defined configuration + /// settings can be stored. /// - public static ConsumerGroup CreateOrUpdate(this IConsumerGroupsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, ConsumerGroup parameters) + public static ConsumerGroup CreateOrUpdate(this IConsumerGroupsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, string userMetadata = default(string)) { - return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata).GetAwaiter().GetResult(); } /// @@ -67,15 +70,18 @@ public static ConsumerGroup CreateOrUpdate(this IConsumerGroupsOperations operat /// /// The consumer group name /// - /// - /// Parameters supplied to create or update a consumer group resource. + /// + /// User Metadata is a placeholder to store user-defined string data with + /// maximum length 1024. e.g. it can be used to store descriptive data, such as + /// list of teams and their contact information also user-defined configuration + /// settings can be stored. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IConsumerGroupsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, ConsumerGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IConsumerGroupsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, string userMetadata = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, eventHubName, consumerGroupName, userMetadata, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs index f1bb9e5ba8d9..daaa1156ce93 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs @@ -130,11 +130,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "alias", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -145,7 +148,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", tracingParameters); } @@ -157,9 +159,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -375,11 +377,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -391,7 +396,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", tracingParameters); } @@ -404,9 +408,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -622,11 +626,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -638,7 +645,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); } @@ -651,9 +657,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -784,8 +790,8 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) /// /// The Namespace name /// - /// - /// Parameters to check availability of the given Alias name + /// + /// Name to check the namespace name availability /// /// /// Headers that will be added to request. @@ -808,8 +814,12 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string namespaceName, CheckNameAvailabilityParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string name, 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"); @@ -844,15 +854,15 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); } } - if (parameters == null) + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (parameters != null) + CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter(); + if (name != null) { - parameters.Validate(); + parameters.Name = name; } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -860,7 +870,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("parameters", parameters); @@ -874,9 +883,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1066,11 +1075,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient 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"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1080,7 +1092,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -1091,9 +1102,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1227,8 +1238,12 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) /// /// The Disaster Recovery configuration name /// - /// - /// Parameters required to create an Alias(Disaster Recovery configuration) + /// + /// ARM Id of the Primary/Secondary eventhub namespace name, which is part of + /// GEO DR pairing + /// + /// + /// Alternate name specified when alias and namespace names are same. /// /// /// Headers that will be added to request. @@ -1251,7 +1266,7 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, ArmDisasterRecovery parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, string partnerNamespace = default(string), string alternateName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1298,15 +1313,20 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "alias", 1); } } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; + ArmDisasterRecovery parameters = new ArmDisasterRecovery(); + if (partnerNamespace != null || alternateName != null) + { + parameters.PartnerNamespace = partnerNamespace; + parameters.AlternateName = alternateName; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1318,7 +1338,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -1330,9 +1349,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1537,11 +1556,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "alias", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1552,7 +1574,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -1564,9 +1585,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1751,11 +1772,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "alias", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1766,7 +1790,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -1778,9 +1801,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1980,11 +2003,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "alias", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1995,7 +2021,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BreakPairing", tracingParameters); } @@ -2007,9 +2032,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2191,11 +2216,14 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "alias", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2206,7 +2234,6 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "FailOver", tracingParameters); } @@ -2218,9 +2245,9 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) _url = _url.Replace("{alias}", System.Uri.EscapeDataString(alias)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs index ba97d5fd9f66..cb6fcafa97be 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperationsExtensions.cs @@ -183,12 +183,12 @@ public static AccessKeys ListKeys(this IDisasterRecoveryConfigsOperations operat /// /// The Namespace name /// - /// - /// Parameters to check availability of the given Alias name + /// + /// Name to check the namespace name availability /// - public static CheckNameAvailabilityResult CheckNameAvailability(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, CheckNameAvailabilityParameter parameters) + public static CheckNameAvailabilityResult CheckNameAvailability(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string name) { - return operations.CheckNameAvailabilityAsync(resourceGroupName, namespaceName, parameters).GetAwaiter().GetResult(); + return operations.CheckNameAvailabilityAsync(resourceGroupName, namespaceName, name).GetAwaiter().GetResult(); } /// @@ -203,15 +203,15 @@ public static CheckNameAvailabilityResult CheckNameAvailability(this IDisasterRe /// /// The Namespace name /// - /// - /// Parameters to check availability of the given Alias name + /// + /// Name to check the namespace name availability /// /// /// The cancellation token. /// - public static async Task CheckNameAvailabilityAsync(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, CheckNameAvailabilityParameter parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CheckNameAvailabilityAsync(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(resourceGroupName, namespaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(resourceGroupName, namespaceName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -272,12 +272,16 @@ public static IPage List(this IDisasterRecoveryConfigsOpera /// /// The Disaster Recovery configuration name /// - /// - /// Parameters required to create an Alias(Disaster Recovery configuration) + /// + /// ARM Id of the Primary/Secondary eventhub namespace name, which is part of + /// GEO DR pairing /// - public static ArmDisasterRecovery CreateOrUpdate(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias, ArmDisasterRecovery parameters) + /// + /// Alternate name specified when alias and namespace names are same. + /// + public static ArmDisasterRecovery CreateOrUpdate(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias, string partnerNamespace = default(string), string alternateName = default(string)) { - return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, alias, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, alias, partnerNamespace, alternateName).GetAwaiter().GetResult(); } /// @@ -295,15 +299,19 @@ public static ArmDisasterRecovery CreateOrUpdate(this IDisasterRecoveryConfigsOp /// /// The Disaster Recovery configuration name /// - /// - /// Parameters required to create an Alias(Disaster Recovery configuration) + /// + /// ARM Id of the Primary/Secondary eventhub namespace name, which is part of + /// GEO DR pairing + /// + /// + /// Alternate name specified when alias and namespace names are same. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias, ArmDisasterRecovery parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IDisasterRecoveryConfigsOperations operations, string resourceGroupName, string namespaceName, string alias, string partnerNamespace = default(string), string alternateName = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, alias, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, alias, partnerNamespace, alternateName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs index 6470528a5de5..d7f5c3bace34 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs @@ -43,6 +43,11 @@ public partial class EventHubManagementClient : ServiceClient public ServiceClientCredentials Credentials { get; private set; } + /// + /// Client API Version. + /// + public string ApiVersion { get; private set; } + /// /// Subscription credentials that uniquely identify a Microsoft Azure /// subscription. The subscription ID forms part of the URI for every service @@ -78,6 +83,16 @@ public partial class EventHubManagementClient : ServiceClient public virtual INamespacesOperations Namespaces { get; private set; } + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + /// /// Gets the IConfigurationOperations. /// @@ -351,6 +366,8 @@ private void Initialize() { Clusters = new ClustersOperations(this); Namespaces = new NamespacesOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); Configuration = new ConfigurationOperations(this); DisasterRecoveryConfigs = new DisasterRecoveryConfigsOperations(this); EventHubs = new EventHubsOperations(this); @@ -358,6 +375,7 @@ private void Initialize() Operations = new Operations(this); Regions = new RegionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2018-01-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs index 5998845ff177..b86a3c870087 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs @@ -130,11 +130,14 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "eventHubName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -145,7 +148,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", tracingParameters); } @@ -157,9 +159,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{eventHubName}", System.Uri.EscapeDataString(eventHubName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -298,8 +300,8 @@ internal EventHubsOperations(EventHubManagementClient client) /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// /// /// Headers that will be added to request. @@ -322,7 +324,7 @@ internal EventHubsOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, AuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, IList rights, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -380,19 +382,23 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (Client.ApiVersion == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; + if (rights == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "rights"); + } + AuthorizationRule parameters = new AuthorizationRule(); + if (rights != null) + { + parameters.Rights = rights; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -405,7 +411,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", tracingParameters); } @@ -418,9 +423,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -642,11 +647,14 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -658,7 +666,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", tracingParameters); } @@ -671,9 +678,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -886,11 +893,14 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -902,7 +912,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", tracingParameters); } @@ -915,9 +924,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1115,11 +1124,14 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1131,7 +1143,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); } @@ -1144,9 +1155,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1283,9 +1294,13 @@ internal EventHubsOperations(EventHubManagementClient client) /// /// The authorization rule name. /// - /// - /// Parameters supplied to regenerate the AuthorizationRule Keys - /// (PrimaryKey/SecondaryKey). + /// + /// The access key to regenerate. Possible values include: 'PrimaryKey', + /// 'SecondaryKey' + /// + /// + /// Optional, if the key value provided, is set for KeyType or autogenerated + /// Key value set for keyType /// /// /// Headers that will be added to request. @@ -1308,7 +1323,7 @@ internal EventHubsOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1366,19 +1381,20 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; + RegenerateAccessKeyParameters parameters = new RegenerateAccessKeyParameters(); + if (key != null) + { + parameters.KeyType = keyType; + parameters.Key = key; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1391,7 +1407,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); } @@ -1404,9 +1419,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1606,6 +1621,10 @@ internal EventHubsOperations(EventHubManagementClient 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"); @@ -1626,7 +1645,6 @@ internal EventHubsOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1636,7 +1654,6 @@ internal EventHubsOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("skip", skip); tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1649,9 +1666,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skip != null) { @@ -1872,11 +1889,14 @@ internal EventHubsOperations(EventHubManagementClient client) { parameters.Validate(); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1888,7 +1908,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -1900,9 +1919,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{eventHubName}", System.Uri.EscapeDataString(eventHubName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2107,11 +2126,14 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "eventHubName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2122,7 +2144,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -2134,9 +2155,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{eventHubName}", System.Uri.EscapeDataString(eventHubName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2320,11 +2341,14 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "eventHubName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2335,7 +2359,6 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -2347,9 +2370,9 @@ internal EventHubsOperations(EventHubManagementClient client) _url = _url.Replace("{eventHubName}", System.Uri.EscapeDataString(eventHubName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperationsExtensions.cs index f42b107ee1a0..1cec4de04fc6 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperationsExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperationsExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.EventHub using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -87,12 +89,12 @@ public static IPage ListAuthorizationRules(this IEventHubsOpe /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// - public static AuthorizationRule CreateOrUpdateAuthorizationRule(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, AuthorizationRule parameters) + public static AuthorizationRule CreateOrUpdateAuthorizationRule(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, IList rights) { - return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights).GetAwaiter().GetResult(); } /// @@ -115,15 +117,15 @@ public static AuthorizationRule CreateOrUpdateAuthorizationRule(this IEventHubsO /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAuthorizationRuleAsync(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, AuthorizationRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAuthorizationRuleAsync(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, IList rights, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, rights, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -300,13 +302,17 @@ public static AccessKeys ListKeys(this IEventHubsOperations operations, string r /// /// The authorization rule name. /// - /// - /// Parameters supplied to regenerate the AuthorizationRule Keys - /// (PrimaryKey/SecondaryKey). + /// + /// The access key to regenerate. Possible values include: 'PrimaryKey', + /// 'SecondaryKey' /// - public static AccessKeys RegenerateKeys(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, RegenerateAccessKeyParameters parameters) + /// + /// Optional, if the key value provided, is set for KeyType or autogenerated + /// Key value set for keyType + /// + public static AccessKeys RegenerateKeys(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, KeyType keyType, string key = default(string)) { - return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, keyType, key).GetAwaiter().GetResult(); } /// @@ -327,16 +333,20 @@ public static AccessKeys RegenerateKeys(this IEventHubsOperations operations, st /// /// The authorization rule name. /// - /// - /// Parameters supplied to regenerate the AuthorizationRule Keys - /// (PrimaryKey/SecondaryKey). + /// + /// The access key to regenerate. Possible values include: 'PrimaryKey', + /// 'SecondaryKey' + /// + /// + /// Optional, if the key value provided, is set for KeyType or autogenerated + /// Key value set for keyType /// /// /// The cancellation token. /// - public static async Task RegenerateKeysAsync(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateKeysAsync(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, KeyType keyType, string key = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, keyType, key, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConfigurationOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConfigurationOperations.cs index 089559f93e19..b142d93a151c 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConfigurationOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConfigurationOperations.cs @@ -34,8 +34,10 @@ public partial interface IConfigurationOperations /// /// The name of the Event Hubs Cluster. /// - /// - /// Parameters for creating an Event Hubs Cluster resource. + /// + /// All possible Cluster settings - a collection of key/value paired + /// settings which apply to quotas and configurations imposed on the + /// cluster. /// /// /// The headers that will be added to request. @@ -52,7 +54,7 @@ public partial interface IConfigurationOperations /// /// Thrown when a required parameter is null /// - Task> PatchWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterQuotaConfigurationProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PatchWithHttpMessagesAsync(string resourceGroupName, string clusterName, IDictionary settings = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all Event Hubs Cluster settings - a collection of key/value /// pairs which represent the quotas and settings imposed on the diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConsumerGroupsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConsumerGroupsOperations.cs index cc912506bb3c..5dfbd37668b0 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConsumerGroupsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IConsumerGroupsOperations.cs @@ -39,8 +39,11 @@ public partial interface IConsumerGroupsOperations /// /// The consumer group name /// - /// - /// Parameters supplied to create or update a consumer group resource. + /// + /// User Metadata is a placeholder to store user-defined string data + /// with maximum length 1024. e.g. it can be used to store descriptive + /// data, such as list of teams and their contact information also + /// user-defined configuration settings can be stored. /// /// /// The headers that will be added to request. @@ -57,7 +60,7 @@ public partial interface IConsumerGroupsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, ConsumerGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, string userMetadata = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a consumer group from the specified Event Hub and resource /// group. diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IDisasterRecoveryConfigsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IDisasterRecoveryConfigsOperations.cs index 599fad1d2fdb..d43921693ef0 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IDisasterRecoveryConfigsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IDisasterRecoveryConfigsOperations.cs @@ -123,8 +123,8 @@ public partial interface IDisasterRecoveryConfigsOperations /// /// The Namespace name /// - /// - /// Parameters to check availability of the given Alias name + /// + /// Name to check the namespace name availability /// /// /// The headers that will be added to request. @@ -141,7 +141,7 @@ public partial interface IDisasterRecoveryConfigsOperations /// /// Thrown when a required parameter is null /// - Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string namespaceName, CheckNameAvailabilityParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckNameAvailabilityWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all Alias(Disaster Recovery configurations) /// @@ -179,9 +179,12 @@ public partial interface IDisasterRecoveryConfigsOperations /// /// The Disaster Recovery configuration name /// - /// - /// Parameters required to create an Alias(Disaster Recovery - /// configuration) + /// + /// ARM Id of the Primary/Secondary eventhub namespace name, which is + /// part of GEO DR pairing + /// + /// + /// Alternate name specified when alias and namespace names are same. /// /// /// The headers that will be added to request. @@ -198,7 +201,7 @@ public partial interface IDisasterRecoveryConfigsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, ArmDisasterRecovery parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string alias, string partnerNamespace = default(string), string alternateName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an Alias(Disaster Recovery configuration) /// diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs index b15157a38092..2fee10c76783 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs @@ -39,6 +39,11 @@ public partial interface IEventHubManagementClient : System.IDisposable /// ServiceClientCredentials Credentials { get; } + /// + /// Client API Version. + /// + string ApiVersion { get; } + /// /// Subscription credentials that uniquely identify a Microsoft Azure /// subscription. The subscription ID forms part of the URI for every @@ -75,6 +80,16 @@ public partial interface IEventHubManagementClient : System.IDisposable /// INamespacesOperations Namespaces { get; } + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + /// /// Gets the IConfigurationOperations. /// diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubsOperations.cs index ab905652993d..8922d5577c94 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubsOperations.cs @@ -68,8 +68,8 @@ public partial interface IEventHubsOperations /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// /// /// The headers that will be added to request. @@ -86,7 +86,7 @@ public partial interface IEventHubsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, AuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, IList rights, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets an AuthorizationRule for an Event Hub by rule name. /// @@ -192,9 +192,13 @@ public partial interface IEventHubsOperations /// /// The authorization rule name. /// - /// - /// Parameters supplied to regenerate the AuthorizationRule Keys - /// (PrimaryKey/SecondaryKey). + /// + /// The access key to regenerate. Possible values include: + /// 'PrimaryKey', 'SecondaryKey' + /// + /// + /// Optional, if the key value provided, is set for KeyType or + /// autogenerated Key value set for keyType /// /// /// The headers that will be added to request. @@ -211,7 +215,7 @@ public partial interface IEventHubsOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all the Event Hubs in a Namespace. /// diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/INamespacesOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/INamespacesOperations.cs index 21da6f998776..14811cf9b4f1 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/INamespacesOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/INamespacesOperations.cs @@ -317,8 +317,8 @@ public partial interface INamespacesOperations /// /// The Virtual Network Rule name. /// - /// - /// The Namespace VirtualNetworkRule. + /// + /// ARM ID of Virtual Network Subnet /// /// /// The headers that will be added to request. @@ -335,7 +335,7 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateVirtualNetworkRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string virtualNetworkRuleName, VirtualNetworkRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateVirtualNetworkRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string virtualNetworkRuleName, string virtualNetworkSubnetId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an VirtualNetworkRule for a Namespace. /// @@ -479,8 +479,8 @@ public partial interface INamespacesOperations /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// /// /// The headers that will be added to request. @@ -497,7 +497,7 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, AuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, IList rights, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an AuthorizationRule for a Namespace. /// @@ -593,8 +593,13 @@ public partial interface INamespacesOperations /// /// The authorization rule name. /// - /// - /// Parameters required to regenerate the connection string. + /// + /// The access key to regenerate. Possible values include: + /// 'PrimaryKey', 'SecondaryKey' + /// + /// + /// Optional, if the key value provided, is set for KeyType or + /// autogenerated Key value set for keyType /// /// /// The headers that will be added to request. @@ -611,12 +616,12 @@ 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> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Check the give Namespace name availability. /// - /// - /// Parameters to check availability of the given Namespace name + /// + /// Name to check the namespace name availability /// /// /// The headers that will be added to request. @@ -633,7 +638,7 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckNameAvailabilityWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates a namespace. Once created, this namespace's /// resource manifest is immutable. This operation is idempotent. diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 000000000000..73cab480935f --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,193 @@ +// +// 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.EventHub +{ + 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 namespace. This operation also removes all + /// associated resources under the namespace. + /// + /// + /// + /// 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. + /// + /// + /// + /// 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 namespace. This operation also removes all + /// associated resources under the namespace. + /// + /// + /// + /// 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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 000000000000..ea883d487a7c --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IPrivateLinkResourcesOperations.cs @@ -0,0 +1,53 @@ +// +// 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.EventHub +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// Gets lists of resources that supports Privatelinks. + /// + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ClusterSku.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ClusterSku.cs index 73d937455d44..912fe387b549 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ClusterSku.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ClusterSku.cs @@ -71,10 +71,6 @@ static ClusterSku() /// public virtual void Validate() { - if (Capacity > 32) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Capacity", 32); - } if (Capacity < 1) { throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 1); diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ConnectionState.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ConnectionState.cs new file mode 100644 index 000000000000..598a0d70ab18 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/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.EventHub.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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs index f380abfc05dd..e65bcc8f0e75 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs @@ -44,6 +44,7 @@ public EHNamespace() /// description /// Provisioning state of the /// Namespace. + /// Status of the Namespace. /// The time the Namespace was created. /// The time the Namespace was updated. /// Endpoint you can use to perform @@ -63,12 +64,13 @@ public EHNamespace() /// zones. /// Properties of BYOK Encryption /// description - public EHNamespace(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Identity identity = default(Identity), string provisioningState = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string serviceBusEndpoint = default(string), string clusterArmId = default(string), string metricId = default(string), bool? isAutoInflateEnabled = default(bool?), int? maximumThroughputUnits = default(int?), bool? kafkaEnabled = default(bool?), bool? zoneRedundant = default(bool?), Encryption encryption = default(Encryption)) + public EHNamespace(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Identity identity = default(Identity), 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 clusterArmId = default(string), string metricId = default(string), bool? isAutoInflateEnabled = default(bool?), int? maximumThroughputUnits = default(int?), bool? kafkaEnabled = default(bool?), bool? zoneRedundant = default(bool?), Encryption encryption = default(Encryption)) : base(id, name, type, location, tags) { Sku = sku; Identity = identity; ProvisioningState = provisioningState; + Status = status; CreatedAt = createdAt; UpdatedAt = updatedAt; ServiceBusEndpoint = serviceBusEndpoint; @@ -105,6 +107,12 @@ public EHNamespace() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets status of the Namespace. + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + /// /// Gets the time the Namespace was created. /// diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EndPointProvisioningState.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EndPointProvisioningState.cs new file mode 100644 index 000000000000..95b8dd19c6a7 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/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.EventHub.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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateEndpoint.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 000000000000..b14b38edf5a8 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/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.EventHub.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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..d699cca1a440 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,80 @@ +// +// 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.EventHub.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' + 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)) + : base(id, name, type) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + ProvisioningState = provisioningState; + 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; } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkConnectionStatus.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkConnectionStatus.cs new file mode 100644 index 000000000000..4a43a1b83ee0 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/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.EventHub.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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkResource.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkResource.cs new file mode 100644 index 000000000000..0963116b6191 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkResource.cs @@ -0,0 +1,99 @@ +// +// 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.EventHub.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. + /// + /// The private link resource group id. + /// The private link resource required + /// member names. + /// The private link resource Private + /// link DNS zone name. + /// 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(); + + /// + /// Gets or sets the private link resource group id. + /// + [JsonProperty(PropertyName = "properties.groupId")] + public string GroupId { get; set; } + + /// + /// Gets or sets the private link resource required member names. + /// + [JsonProperty(PropertyName = "properties.requiredMembers")] + public IList RequiredMembers { get; set; } + + /// + /// Gets or sets the private link resource Private link DNS zone name. + /// + [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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkResourcesListResult.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkResourcesListResult.cs new file mode 100644 index 000000000000..285e9d576fce --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateLinkResourcesListResult.cs @@ -0,0 +1,64 @@ +// +// 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.EventHub.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the List private link resources operation. + /// + public partial class PrivateLinkResourcesListResult + { + /// + /// Initializes a new instance of the PrivateLinkResourcesListResult + /// class. + /// + public PrivateLinkResourcesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkResourcesListResult + /// class. + /// + /// 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)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a collection of private link resources + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets a link for the next page of private link resources. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Sku.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Sku.cs index 6376ef74e2eb..bafff1fef455 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Sku.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Sku.cs @@ -82,10 +82,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } - if (Capacity > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Capacity", 20); - } if (Capacity < 0) { throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 0); diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs index acf6a58fd85f..d781915b941c 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs @@ -112,11 +112,14 @@ internal NamespacesOperations(EventHubManagementClient 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"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -126,7 +129,6 @@ internal NamespacesOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListIPFilterRules", tracingParameters); } @@ -137,9 +139,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -344,11 +346,14 @@ internal NamespacesOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -360,7 +365,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("ipFilterRuleName", ipFilterRuleName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateIpFilterRule", tracingParameters); } @@ -372,9 +376,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{ipFilterRuleName}", System.Uri.EscapeDataString(ipFilterRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -575,11 +579,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "ipFilterRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -590,7 +597,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("ipFilterRuleName", ipFilterRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "DeleteIpFilterRule", tracingParameters); } @@ -602,9 +608,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{ipFilterRuleName}", System.Uri.EscapeDataString(ipFilterRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -784,11 +790,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "ipFilterRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -799,7 +808,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("ipFilterRuleName", ipFilterRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetIpFilterRule", tracingParameters); } @@ -811,9 +819,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{ipFilterRuleName}", System.Uri.EscapeDataString(ipFilterRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -962,11 +970,14 @@ internal NamespacesOperations(EventHubManagementClient client) /// 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"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -974,7 +985,6 @@ internal NamespacesOperations(EventHubManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -983,9 +993,9 @@ internal NamespacesOperations(EventHubManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1151,11 +1161,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1164,7 +1177,6 @@ internal NamespacesOperations(EventHubManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -1174,9 +1186,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1409,11 +1421,14 @@ internal NamespacesOperations(EventHubManagementClient 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"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1423,7 +1438,6 @@ internal NamespacesOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -1434,9 +1448,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1646,11 +1660,14 @@ internal NamespacesOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1661,7 +1678,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -1672,9 +1688,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1882,11 +1898,14 @@ internal NamespacesOperations(EventHubManagementClient 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"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1896,7 +1915,6 @@ internal NamespacesOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListVirtualNetworkRules", tracingParameters); } @@ -1907,9 +1925,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2043,8 +2061,8 @@ internal NamespacesOperations(EventHubManagementClient client) /// /// The Virtual Network Rule name. /// - /// - /// The Namespace VirtualNetworkRule. + /// + /// ARM ID of Virtual Network Subnet /// /// /// Headers that will be added to request. @@ -2067,7 +2085,7 @@ internal NamespacesOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateVirtualNetworkRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string virtualNetworkRuleName, VirtualNetworkRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateVirtualNetworkRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string virtualNetworkRuleName, string virtualNetworkSubnetId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2110,15 +2128,19 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "virtualNetworkRuleName", 1); } } + 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) + VirtualNetworkRule parameters = new VirtualNetworkRule(); + if (virtualNetworkSubnetId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + parameters.VirtualNetworkSubnetId = virtualNetworkSubnetId; } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2129,7 +2151,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("virtualNetworkRuleName", virtualNetworkRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateVirtualNetworkRule", tracingParameters); @@ -2142,9 +2163,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{virtualNetworkRuleName}", System.Uri.EscapeDataString(virtualNetworkRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2345,11 +2366,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "virtualNetworkRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2360,7 +2384,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("virtualNetworkRuleName", virtualNetworkRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "DeleteVirtualNetworkRule", tracingParameters); } @@ -2372,9 +2395,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{virtualNetworkRuleName}", System.Uri.EscapeDataString(virtualNetworkRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2554,11 +2577,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "virtualNetworkRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2569,7 +2595,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("virtualNetworkRuleName", virtualNetworkRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetVirtualNetworkRule", tracingParameters); } @@ -2581,9 +2606,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{virtualNetworkRuleName}", System.Uri.EscapeDataString(virtualNetworkRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2770,6 +2795,10 @@ internal NamespacesOperations(EventHubManagementClient 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"); @@ -2778,7 +2807,6 @@ internal NamespacesOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2788,7 +2816,6 @@ internal NamespacesOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateNetworkRuleSet", tracingParameters); @@ -2800,9 +2827,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2992,11 +3019,14 @@ internal NamespacesOperations(EventHubManagementClient 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"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3006,7 +3036,6 @@ internal NamespacesOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetNetworkRuleSet", tracingParameters); } @@ -3017,9 +3046,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3203,11 +3232,14 @@ internal NamespacesOperations(EventHubManagementClient 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"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3217,7 +3249,6 @@ internal NamespacesOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAuthorizationRules", tracingParameters); } @@ -3228,9 +3259,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3364,8 +3395,8 @@ internal NamespacesOperations(EventHubManagementClient client) /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// /// /// Headers that will be added to request. @@ -3388,7 +3419,7 @@ internal NamespacesOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, AuthorizationRule parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, IList rights, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -3431,19 +3462,23 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; + if (rights == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "rights"); + } + AuthorizationRule parameters = new AuthorizationRule(); + if (rights != null) + { + parameters.Rights = rights; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3455,7 +3490,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", tracingParameters); } @@ -3467,9 +3501,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3670,11 +3704,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3685,7 +3722,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "DeleteAuthorizationRule", tracingParameters); } @@ -3697,9 +3733,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3879,11 +3915,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3894,7 +3933,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetAuthorizationRule", tracingParameters); } @@ -3906,9 +3944,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4106,11 +4144,14 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4121,7 +4162,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); } @@ -4133,9 +4173,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4270,8 +4310,13 @@ internal NamespacesOperations(EventHubManagementClient client) /// /// The authorization rule name. /// - /// - /// Parameters required to regenerate the connection string. + /// + /// The access key to regenerate. Possible values include: 'PrimaryKey', + /// 'SecondaryKey' + /// + /// + /// Optional, if the key value provided, is set for KeyType or autogenerated + /// Key value set for keyType /// /// /// Headers that will be added to request. @@ -4294,7 +4339,7 @@ internal NamespacesOperations(EventHubManagementClient 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> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -4337,19 +4382,20 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-04-01"; + RegenerateAccessKeyParameters parameters = new RegenerateAccessKeyParameters(); + if (key != null) + { + parameters.KeyType = keyType; + parameters.Key = key; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4361,7 +4407,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); } @@ -4373,9 +4418,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{authorizationRuleName}", System.Uri.EscapeDataString(authorizationRuleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4506,8 +4551,8 @@ internal NamespacesOperations(EventHubManagementClient client) /// /// Check the give Namespace name availability. /// - /// - /// Parameters to check availability of the given Namespace name + /// + /// Name to check the namespace name availability /// /// /// Headers that will be added to request. @@ -4530,21 +4575,25 @@ internal NamespacesOperations(EventHubManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CheckNameAvailabilityWithHttpMessagesAsync(CheckNameAvailabilityParameter parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CheckNameAvailabilityWithHttpMessagesAsync(string name, 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) + if (name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "name"); } - if (parameters != null) + CheckNameAvailabilityParameter parameters = new CheckNameAvailabilityParameter(); + if (name != null) { - parameters.Validate(); + parameters.Name = name; } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4552,7 +4601,6 @@ internal NamespacesOperations(EventHubManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); @@ -4562,9 +4610,9 @@ internal NamespacesOperations(EventHubManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4766,11 +4814,14 @@ internal NamespacesOperations(EventHubManagementClient client) { parameters.Validate(); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4781,7 +4832,6 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -4792,9 +4842,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5000,11 +5050,14 @@ internal NamespacesOperations(EventHubManagementClient 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"); } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5014,7 +5067,6 @@ internal NamespacesOperations(EventHubManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -5025,9 +5077,9 @@ internal NamespacesOperations(EventHubManagementClient client) _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperationsExtensions.cs index a118d4f9c1fc..5d07361e0871 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperationsExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperationsExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.EventHub using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -496,12 +498,12 @@ public static IPage ListVirtualNetworkRules(this INamespaces /// /// The Virtual Network Rule name. /// - /// - /// The Namespace VirtualNetworkRule. + /// + /// ARM ID of Virtual Network Subnet /// - public static VirtualNetworkRule CreateOrUpdateVirtualNetworkRule(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string virtualNetworkRuleName, VirtualNetworkRule parameters) + public static VirtualNetworkRule CreateOrUpdateVirtualNetworkRule(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string virtualNetworkRuleName, string virtualNetworkSubnetId = default(string)) { - return operations.CreateOrUpdateVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateVirtualNetworkRuleAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId).GetAwaiter().GetResult(); } /// @@ -519,15 +521,15 @@ public static VirtualNetworkRule CreateOrUpdateVirtualNetworkRule(this INamespac /// /// The Virtual Network Rule name. /// - /// - /// The Namespace VirtualNetworkRule. + /// + /// ARM ID of Virtual Network Subnet /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateVirtualNetworkRuleAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string virtualNetworkRuleName, VirtualNetworkRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateVirtualNetworkRuleAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string virtualNetworkRuleName, string virtualNetworkSubnetId = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateVirtualNetworkRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateVirtualNetworkRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, virtualNetworkRuleName, virtualNetworkSubnetId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -763,12 +765,12 @@ public static IPage ListAuthorizationRules(this INamespacesOp /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// - public static AuthorizationRule CreateOrUpdateAuthorizationRule(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, AuthorizationRule parameters) + public static AuthorizationRule CreateOrUpdateAuthorizationRule(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, IList rights) { - return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, rights).GetAwaiter().GetResult(); } /// @@ -786,15 +788,15 @@ public static AuthorizationRule CreateOrUpdateAuthorizationRule(this INamespaces /// /// The authorization rule name. /// - /// - /// The shared access AuthorizationRule. + /// + /// The rights associated with the rule. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAuthorizationRuleAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, AuthorizationRule parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAuthorizationRuleAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, IList rights, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateAuthorizationRuleWithHttpMessagesAsync(resourceGroupName, namespaceName, authorizationRuleName, rights, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -951,12 +953,17 @@ public static AccessKeys ListKeys(this INamespacesOperations operations, string /// /// The authorization rule name. /// - /// - /// Parameters required to regenerate the connection string. + /// + /// The access key to regenerate. Possible values include: 'PrimaryKey', + /// 'SecondaryKey' /// - public static AccessKeys RegenerateKeys(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, RegenerateAccessKeyParameters parameters) + /// + /// Optional, if the key value provided, is set for KeyType or autogenerated + /// Key value set for keyType + /// + public static AccessKeys RegenerateKeys(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, KeyType keyType, string key = default(string)) { - return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters).GetAwaiter().GetResult(); + return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, keyType, key).GetAwaiter().GetResult(); } /// @@ -975,15 +982,20 @@ public static AccessKeys RegenerateKeys(this INamespacesOperations operations, s /// /// The authorization rule name. /// - /// - /// Parameters required to regenerate the connection string. + /// + /// The access key to regenerate. Possible values include: 'PrimaryKey', + /// 'SecondaryKey' + /// + /// + /// Optional, if the key value provided, is set for KeyType or autogenerated + /// Key value set for keyType /// /// /// The cancellation token. /// - public static async Task RegenerateKeysAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, RegenerateAccessKeyParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateKeysAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, KeyType keyType, string key = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, authorizationRuleName, keyType, key, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -995,12 +1007,12 @@ public static AccessKeys RegenerateKeys(this INamespacesOperations operations, s /// /// The operations group for this extension method. /// - /// - /// Parameters to check availability of the given Namespace name + /// + /// Name to check the namespace name availability /// - public static CheckNameAvailabilityResult CheckNameAvailability(this INamespacesOperations operations, CheckNameAvailabilityParameter parameters) + public static CheckNameAvailabilityResult CheckNameAvailability(this INamespacesOperations operations, string name) { - return operations.CheckNameAvailabilityAsync(parameters).GetAwaiter().GetResult(); + return operations.CheckNameAvailabilityAsync(name).GetAwaiter().GetResult(); } /// @@ -1009,15 +1021,15 @@ public static CheckNameAvailabilityResult CheckNameAvailability(this INamespaces /// /// The operations group for this extension method. /// - /// - /// Parameters to check availability of the given Namespace name + /// + /// Name to check the namespace name availability /// /// /// The cancellation token. /// - public static async Task CheckNameAvailabilityAsync(this INamespacesOperations operations, CheckNameAvailabilityParameter parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CheckNameAvailabilityAsync(this INamespacesOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Operations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Operations.cs index 2850113b89ee..af8af791fa0d 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Operations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Operations.cs @@ -65,12 +65,21 @@ internal Operations(EventHubManagementClient client) /// /// 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)) { - string apiVersion = "2017-04-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -78,7 +87,6 @@ internal Operations(EventHubManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -86,9 +94,9 @@ internal Operations(EventHubManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.EventHub/operations").ToString(); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 000000000000..011d9fe5983f --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,1146 @@ +// +// 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.EventHub +{ + 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(EventHubManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the EventHubManagementClient + /// + public EventHubManagementClient 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.EventHub/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.EventHub/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 namespace. This operation also removes all associated + /// resources under the namespace. + /// + /// + /// + /// 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. + /// + /// + /// + /// 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.EventHub/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 namespace. This operation also removes all associated + /// resources under the namespace. + /// + /// + /// + /// 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.EventHub/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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..254c79028c33 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,301 @@ +// +// 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.EventHub +{ + 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 namespace. This operation also removes all associated + /// resources under the namespace. + /// + /// + /// + /// 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 namespace. This operation also removes all associated + /// resources under the namespace. + /// + /// + /// + /// 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 name. + /// + /// + /// + /// 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 name. + /// + /// + /// + /// 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 namespace. This operation also removes all associated + /// resources under the namespace. + /// + /// + /// + /// 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 namespace. This operation also removes all associated + /// resources under the namespace. + /// + /// + /// + /// 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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 000000000000..29084299179f --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,268 @@ +// +// 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.EventHub +{ + 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; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(EventHubManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the EventHubManagementClient + /// + public EventHubManagementClient Client { get; private set; } + + /// + /// Gets lists of resources that supports Privatelinks. + /// + /// + /// + /// 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> GetWithHttpMessagesAsync(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, "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.EventHub/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)); + 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; + } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 000000000000..623a2480964e --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/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.EventHub +{ + 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/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/RegionsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/RegionsOperations.cs index 2113c82dc61c..779366e125c9 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/RegionsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/RegionsOperations.cs @@ -79,6 +79,10 @@ internal RegionsOperations(EventHubManagementClient client) /// 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"); @@ -98,7 +102,6 @@ internal RegionsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "sku", 1); } } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -106,7 +109,6 @@ internal RegionsOperations(EventHubManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("sku", sku); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListBySku", tracingParameters); @@ -117,9 +119,9 @@ internal RegionsOperations(EventHubManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{sku}", System.Uri.EscapeDataString(sku)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SdkInfo_EventHubManagementClient.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SdkInfo_EventHubManagementClient.cs index fd1f094ca1b8..c9f13cb97b5b 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SdkInfo_EventHubManagementClient.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SdkInfo_EventHubManagementClient.cs @@ -21,26 +21,16 @@ public static IEnumerable> ApiInfo_EventHubManagem { new Tuple("EventHub", "Clusters", "2018-01-01-preview"), new Tuple("EventHub", "Configuration", "2018-01-01-preview"), - new Tuple("EventHub", "ConsumerGroups", "2017-04-01"), - new Tuple("EventHub", "DisasterRecoveryConfigs", "2017-04-01"), - new Tuple("EventHub", "EventHubs", "2017-04-01"), - new Tuple("EventHub", "Namespaces", "2017-04-01"), + new Tuple("EventHub", "ConsumerGroups", "2018-01-01-preview"), + new Tuple("EventHub", "DisasterRecoveryConfigs", "2018-01-01-preview"), + new Tuple("EventHub", "EventHubs", "2018-01-01-preview"), new Tuple("EventHub", "Namespaces", "2018-01-01-preview"), - new Tuple("EventHub", "Operations", "2017-04-01"), - new Tuple("EventHub", "Regions", "2017-04-01"), + new Tuple("EventHub", "Operations", "2018-01-01-preview"), + new Tuple("EventHub", "PrivateEndpointConnections", "2018-01-01-preview"), + new Tuple("EventHub", "PrivateLinkResources", "2018-01-01-preview"), + new Tuple("EventHub", "Regions", "2018-01-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@1.9.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventhub/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\AutoRestSDK\\EH\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "bd4cdd7e0508f2c482574e90580d34c48bf21b1f"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -