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..673fa03f24a4 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,12 @@ internal ConfigurationOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "clusterName", 6); } } - if (parameters == null) + string apiVersion = "2018-01-01-preview"; + ClusterQuotaConfigurationProperties parameters = new ClusterQuotaConfigurationProperties(); + if (settings != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + parameters.Settings = settings; } - string apiVersion = "2018-01-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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..8639417f4de1 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,16 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "consumerGroupName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } 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; @@ -172,8 +176,8 @@ internal ConsumerGroupsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("consumerGroupName", consumerGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } 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..674db07a17c1 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs @@ -784,8 +784,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,7 +808,7 @@ 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.SubscriptionId == null) { @@ -844,15 +844,16 @@ 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) + string apiVersion = "2017-04-01"; + 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; @@ -1227,8 +1228,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 +1256,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 +1303,17 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "alias", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } 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; @@ -1317,8 +1324,8 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("alias", alias); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } 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..f3169d4bde02 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs @@ -78,6 +78,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 +361,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); 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..be2985202764 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs @@ -298,8 +298,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 +322,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 +380,20 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (parameters != null) + if (rights == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "rights"); } - if (Client.SubscriptionId == null) + string apiVersion = "2017-04-01"; + AuthorizationRule parameters = new AuthorizationRule(); + if (rights != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Rights = rights; } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -404,8 +405,8 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", tracingParameters); } @@ -1283,9 +1284,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 +1313,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 +1371,17 @@ internal EventHubsOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } 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; @@ -1390,8 +1393,8 @@ internal EventHubsOperations(EventHubManagementClient client) tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("eventHubName", eventHubName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); } 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..d5d3dab0edbd 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs @@ -75,6 +75,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/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/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/NamespacesOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs index acf6a58fd85f..8f360a76dc62 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs @@ -2043,8 +2043,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 +2067,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) { @@ -2114,11 +2114,12 @@ internal NamespacesOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (parameters == null) + string apiVersion = "2018-01-01-preview"; + 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; @@ -3364,8 +3365,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 +3389,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 +3432,20 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (parameters != null) + if (rights == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "rights"); } - if (Client.SubscriptionId == null) + string apiVersion = "2017-04-01"; + AuthorizationRule parameters = new AuthorizationRule(); + if (rights != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Rights = rights; } - string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3454,8 +3456,8 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateAuthorizationRule", tracingParameters); } @@ -4270,8 +4272,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 +4301,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 +4344,17 @@ internal NamespacesOperations(EventHubManagementClient client) throw new ValidationException(ValidationRules.MinLength, "authorizationRuleName", 1); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } 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; @@ -4360,8 +4365,8 @@ internal NamespacesOperations(EventHubManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("namespaceName", namespaceName); tracingParameters.Add("authorizationRuleName", authorizationRuleName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); } @@ -4506,8 +4511,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 +4535,22 @@ 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.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) + string apiVersion = "2017-04-01"; + 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; 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/PrivateEndpointConnectionsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 000000000000..907cc468af7b --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,1138 @@ +// +// 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.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-01-01-preview"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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.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"); + } + string apiVersion = "2018-01-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-01-01-preview"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + string apiVersion = "2018-01-01-preview"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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..47b0d4268bff --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,266 @@ +// +// 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.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-01-01-preview"; + // 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("apiVersion", apiVersion); + 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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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/SdkInfo_EventHubManagementClient.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SdkInfo_EventHubManagementClient.cs index fd1f094ca1b8..1d4d63bf7549 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 @@ -27,20 +27,11 @@ public static IEnumerable> ApiInfo_EventHubManagem new Tuple("EventHub", "Namespaces", "2017-04-01"), new Tuple("EventHub", "Namespaces", "2018-01-01-preview"), new Tuple("EventHub", "Operations", "2017-04-01"), + new Tuple("EventHub", "PrivateEndpointConnections", "2018-01-01-preview"), + new Tuple("EventHub", "PrivateLinkResources", "2018-01-01-preview"), new Tuple("EventHub", "Regions", "2017-04-01"), }.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 } } -