From 1608eaaa11f09cf5a9fdcaed5ef5deb654a92761 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 15 Oct 2021 06:31:28 +0000 Subject: [PATCH] CodeGen from PR 16363 in Azure/azure-rest-api-specs Merge 0ffd038165efdb9371285e81a452eb6aa046195a into 27ed581a173d9231412110e327ffce9fb1dfa1cf --- .../DisasterRecoveryConfigsOperations.cs | 2 +- .../src/Generated/EventHubManagementClient.cs | 8 +- .../src/Generated/EventHubsOperations.cs | 8 +- .../EventHubsOperationsExtensions.cs | 4 +- .../Generated/IEventHubManagementClient.cs | 5 + .../src/Generated/IEventHubsOperations.cs | 2 +- .../src/Generated/INamespacesOperations.cs | 27 +- .../Generated/ISchemaRegistryOperations.cs | 159 +++ .../Generated/Models/ArmDisasterRecovery.cs | 17 +- .../src/Generated/Models/AuthorizationRule.cs | 17 +- .../src/Generated/Models/Cluster.cs | 9 +- .../src/Generated/Models/ConsumerGroup.cs | 17 +- .../src/Generated/Models/Destination.cs | 29 +- .../src/Generated/Models/EHNamespace.cs | 21 +- .../Generated/Models/ErrorAdditionalInfo.cs | 59 + .../src/Generated/Models/ErrorDetail.cs | 85 ++ .../src/Generated/Models/ErrorResponse.cs | 21 +- .../src/Generated/Models/Eventhub.cs | 17 +- .../src/Generated/Models/KeyType.cs | 44 +- .../src/Generated/Models/NetworkRuleSet.cs | 17 +- .../Models/NetworkRuleSetListResult.cs | 64 + .../src/Generated/Models/Operation.cs | 32 +- .../src/Generated/Models/OperationDisplay.cs | 28 +- .../Models/PrivateEndpointConnection.cs | 17 +- .../src/Generated/Models/ProxyResource.cs | 87 ++ .../Models/RegenerateAccessKeyParameters.cs | 11 +- .../src/Generated/Models/Resource.cs | 24 +- .../Generated/Models/SchemaCompatibility.cs | 23 + .../src/Generated/Models/SchemaGroup.cs | 119 ++ .../src/Generated/Models/SchemaType.cs | 22 + .../src/Generated/Models/TrackedResource.cs | 9 +- .../src/Generated/NamespacesOperations.cs | 221 +++- .../NamespacesOperationsExtensions.cs | 44 +- .../src/Generated/SchemaRegistryOperations.cs | 1154 +++++++++++++++++ .../SchemaRegistryOperationsExtensions.cs | 242 ++++ .../SdkInfo_EventHubManagementClient.cs | 30 +- 36 files changed, 2536 insertions(+), 159 deletions(-) create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ISchemaRegistryOperations.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorAdditionalInfo.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorDetail.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSetListResult.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ProxyResource.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaCompatibility.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaGroup.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaType.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SchemaRegistryOperations.cs create mode 100644 sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SchemaRegistryOperationsExtensions.cs 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 f71252e19982a..05205bdb03c36 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/DisasterRecoveryConfigsOperations.cs @@ -916,7 +916,7 @@ internal DisasterRecoveryConfigsOperations(EventHubManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try 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 5506aee05c6fc..7511c04b787e6 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubManagementClient.cs @@ -118,6 +118,11 @@ public partial class EventHubManagementClient : ServiceClient public virtual IConsumerGroupsOperations ConsumerGroups { get; private set; } + /// + /// Gets the ISchemaRegistryOperations. + /// + public virtual ISchemaRegistryOperations SchemaRegistry { get; private set; } + /// /// Initializes a new instance of the EventHubManagementClient class. /// @@ -368,8 +373,9 @@ private void Initialize() EventHubs = new EventHubsOperations(this); DisasterRecoveryConfigs = new DisasterRecoveryConfigsOperations(this); ConsumerGroups = new ConsumerGroupsOperations(this); + SchemaRegistry = new SchemaRegistryOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-06-01-preview"; + ApiVersion = "2021-11-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs index 28ef5f2178faf..86f07dd1a1298 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperations.cs @@ -2268,7 +2268,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, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, string keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2334,8 +2334,12 @@ internal EventHubsOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (keyType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } RegenerateAccessKeyParameters parameters = new RegenerateAccessKeyParameters(); - if (key != null) + if (keyType != null || key != null) { parameters.KeyType = keyType; parameters.Key = key; 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 a86a2b63f0bb4..8a52200420118 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperationsExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/EventHubsOperationsExtensions.cs @@ -511,7 +511,7 @@ public static AccessKeys ListKeys(this IEventHubsOperations operations, string r /// 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)) + public static AccessKeys RegenerateKeys(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, string keyType, string key = default(string)) { return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, keyType, key).GetAwaiter().GetResult(); } @@ -545,7 +545,7 @@ public static AccessKeys ListKeys(this IEventHubsOperations operations, string r /// /// The cancellation token. /// - 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)) + public static async Task RegenerateKeysAsync(this IEventHubsOperations operations, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, string keyType, string key = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, keyType, key, null, cancellationToken).ConfigureAwait(false)) { 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 5591666cdbbb2..737b5a0a5f36c 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubManagementClient.cs @@ -115,5 +115,10 @@ public partial interface IEventHubManagementClient : System.IDisposable /// IConsumerGroupsOperations ConsumerGroups { get; } + /// + /// Gets the ISchemaRegistryOperations. + /// + ISchemaRegistryOperations SchemaRegistry { get; } + } } 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 27cb6f3ba3b0c..4c809aff75208 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubsOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/IEventHubsOperations.cs @@ -336,7 +336,7 @@ public partial interface IEventHubsOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, string 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 07c10387cb019..e5cd2d2d445a8 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/INamespacesOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/INamespacesOperations.cs @@ -225,6 +225,31 @@ public partial interface INamespacesOperations /// Task> GetNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets NetworkRuleSet for 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> ListNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of authorization rules for a Namespace. /// /// @@ -398,7 +423,7 @@ public partial interface INamespacesOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, string keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Check the give Namespace name availability. /// diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ISchemaRegistryOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ISchemaRegistryOperations.cs new file mode 100644 index 0000000000000..2c0b4884bfd3e --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/ISchemaRegistryOperations.cs @@ -0,0 +1,159 @@ +// +// 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; + + /// + /// SchemaRegistryOperations operations. + /// + public partial interface ISchemaRegistryOperations + { + /// + /// Gets all the Schema Groups in a Namespace. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// Skip is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skip parameter that + /// specifies a starting point to use for subsequent calls. + /// + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. + /// + /// + /// The 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>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + /// + /// Parameters supplied to create an Event Hub 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 schemaGroupName, SchemaGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group 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 schemaGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group 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 schemaGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the Schema Groups in 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>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ArmDisasterRecovery.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ArmDisasterRecovery.cs index d5ebd3bf64e66..69435f47a373b 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ArmDisasterRecovery.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ArmDisasterRecovery.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.Management.EventHub.Models /// operation /// [Rest.Serialization.JsonTransformation] - public partial class ArmDisasterRecovery : Resource + public partial class ArmDisasterRecovery : ProxyResource { /// /// Initializes a new instance of the ArmDisasterRecovery class. @@ -33,9 +33,14 @@ public ArmDisasterRecovery() /// /// Initializes a new instance of the ArmDisasterRecovery class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives /// Provisioning state of the /// Alias(Disaster Recovery configuration) - possible values 'Accepted' /// or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', @@ -52,8 +57,8 @@ public ArmDisasterRecovery() /// pending to be replicated. /// The system meta data relating to this /// resource. - public ArmDisasterRecovery(string id = default(string), string name = default(string), string type = default(string), ProvisioningStateDR? provisioningState = default(ProvisioningStateDR?), string partnerNamespace = default(string), string alternateName = default(string), RoleDisasterRecovery? role = default(RoleDisasterRecovery?), long? pendingReplicationOperationsCount = default(long?), SystemData systemData = default(SystemData)) - : base(id, name, type) + public ArmDisasterRecovery(string id = default(string), string name = default(string), string type = default(string), string location = default(string), ProvisioningStateDR? provisioningState = default(ProvisioningStateDR?), string partnerNamespace = default(string), string alternateName = default(string), RoleDisasterRecovery? role = default(RoleDisasterRecovery?), long? pendingReplicationOperationsCount = default(long?), SystemData systemData = default(SystemData)) + : base(id, name, type, location) { ProvisioningState = provisioningState; PartnerNamespace = partnerNamespace; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/AuthorizationRule.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/AuthorizationRule.cs index 9ad82a3c1f7c1..77de2cf4bbce4 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/AuthorizationRule.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/AuthorizationRule.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.EventHub.Models /// Single item in a List or Get AuthorizationRule operation /// [Rest.Serialization.JsonTransformation] - public partial class AuthorizationRule : Resource + public partial class AuthorizationRule : ProxyResource { /// /// Initializes a new instance of the AuthorizationRule class. @@ -35,13 +35,18 @@ public AuthorizationRule() /// Initializes a new instance of the AuthorizationRule class. /// /// The rights associated with the rule. - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives /// The system meta data relating to this /// resource. - public AuthorizationRule(IList rights, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type) + public AuthorizationRule(IList rights, string id = default(string), string name = default(string), string type = default(string), string location = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location) { Rights = rights; SystemData = systemData; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Cluster.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Cluster.cs index 4550addcdac06..c5fab4ea0efd5 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Cluster.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Cluster.cs @@ -34,9 +34,12 @@ public Cluster() /// /// Initializes a new instance of the Cluster class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource location. /// Resource tags. /// Properties of the cluster SKU. diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ConsumerGroup.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ConsumerGroup.cs index 27682f5a7276d..aa79bc8fb0604 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ConsumerGroup.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ConsumerGroup.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.EventHub.Models /// Single item in List or Get Consumer group operation /// [Rest.Serialization.JsonTransformation] - public partial class ConsumerGroup : Resource + public partial class ConsumerGroup : ProxyResource { /// /// Initializes a new instance of the ConsumerGroup class. @@ -32,9 +32,14 @@ public ConsumerGroup() /// /// Initializes a new instance of the ConsumerGroup class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives /// Exact time the message was created. /// The exact time the message was /// updated. @@ -45,8 +50,8 @@ public ConsumerGroup() /// stored. /// The system meta data relating to this /// resource. - public ConsumerGroup(string id = default(string), string name = default(string), string type = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string userMetadata = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type) + public ConsumerGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string userMetadata = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location) { CreatedAt = createdAt; UpdatedAt = updatedAt; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Destination.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Destination.cs index 2a9909de284ee..526e63f7c8b76 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Destination.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Destination.cs @@ -41,12 +41,21 @@ public Destination() /// {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. /// Here all the parameters (Namespace,EventHub .. etc) are mandatory /// irrespective of order - public Destination(string name = default(string), string storageAccountResourceId = default(string), string blobContainer = default(string), string archiveNameFormat = default(string)) + /// Subscription Id of Azure Data + /// Lake Store + /// The Azure Data Lake Store name + /// for the captured events + /// The destination folder path for + /// the captured events + public Destination(string name = default(string), string storageAccountResourceId = default(string), string blobContainer = default(string), string archiveNameFormat = default(string), System.Guid? dataLakeSubscriptionId = default(System.Guid?), string dataLakeAccountName = default(string), string dataLakeFolderPath = default(string)) { Name = name; StorageAccountResourceId = storageAccountResourceId; BlobContainer = blobContainer; ArchiveNameFormat = archiveNameFormat; + DataLakeSubscriptionId = dataLakeSubscriptionId; + DataLakeAccountName = dataLakeAccountName; + DataLakeFolderPath = dataLakeFolderPath; CustomInit(); } @@ -83,5 +92,23 @@ public Destination() [JsonProperty(PropertyName = "properties.archiveNameFormat")] public string ArchiveNameFormat { get; set; } + /// + /// Gets or sets subscription Id of Azure Data Lake Store + /// + [JsonProperty(PropertyName = "properties.dataLakeSubscriptionId")] + public System.Guid? DataLakeSubscriptionId { get; set; } + + /// + /// Gets or sets the Azure Data Lake Store name for the captured events + /// + [JsonProperty(PropertyName = "properties.dataLakeAccountName")] + public string DataLakeAccountName { get; set; } + + /// + /// Gets or sets the destination folder path for the captured events + /// + [JsonProperty(PropertyName = "properties.dataLakeFolderPath")] + public string DataLakeFolderPath { get; set; } + } } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs index 353f4c1a1ba62..6bb6b3f0887ae 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/EHNamespace.cs @@ -34,9 +34,12 @@ public EHNamespace() /// /// Initializes a new instance of the EHNamespace class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource location. /// Resource tags. /// Properties of sku resource @@ -70,7 +73,9 @@ public EHNamespace() /// connections. /// This property disables SAS /// authentication for the Event Hubs namespace. - public EHNamespace(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Identity identity = default(Identity), SystemData systemData = default(SystemData), string provisioningState = default(string), string status = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string serviceBusEndpoint = default(string), string clusterArmId = default(string), string metricId = default(string), bool? isAutoInflateEnabled = default(bool?), int? maximumThroughputUnits = default(int?), bool? kafkaEnabled = default(bool?), bool? zoneRedundant = default(bool?), Encryption encryption = default(Encryption), IList privateEndpointConnections = default(IList), bool? disableLocalAuth = default(bool?)) + /// Alternate name specified when alias and + /// namespace names are same. + public EHNamespace(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Identity identity = default(Identity), SystemData systemData = default(SystemData), string provisioningState = default(string), string status = default(string), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), string serviceBusEndpoint = default(string), string clusterArmId = default(string), string metricId = default(string), bool? isAutoInflateEnabled = default(bool?), int? maximumThroughputUnits = default(int?), bool? kafkaEnabled = default(bool?), bool? zoneRedundant = default(bool?), Encryption encryption = default(Encryption), IList privateEndpointConnections = default(IList), bool? disableLocalAuth = default(bool?), string alternateName = default(string)) : base(id, name, type, location, tags) { Sku = sku; @@ -90,6 +95,7 @@ public EHNamespace() Encryption = encryption; PrivateEndpointConnections = privateEndpointConnections; DisableLocalAuth = disableLocalAuth; + AlternateName = alternateName; CustomInit(); } @@ -206,6 +212,13 @@ public EHNamespace() [JsonProperty(PropertyName = "properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } + /// + /// Gets or sets alternate name specified when alias and namespace + /// names are same. + /// + [JsonProperty(PropertyName = "properties.alternateName")] + public string AlternateName { get; set; } + /// /// Validate the object. /// diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 0000000000000..fe8145fccaed8 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EventHub.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorDetail.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..2cc3a3f406e8e --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EventHub.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorResponse.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorResponse.cs index fd260a990820d..ee914a7638a86 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorResponse.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ErrorResponse.cs @@ -30,13 +30,10 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// Error code. - /// Error message indicating why the operation - /// failed. - public ErrorResponse(string code = default(string), string message = default(string)) + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { - Code = code; - Message = message; + Error = error; CustomInit(); } @@ -46,16 +43,10 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets or sets error code. + /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets error message indicating why the operation failed. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } } } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Eventhub.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Eventhub.cs index c96c5ab1c1f88..a1ee2e7397a33 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Eventhub.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Eventhub.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.EventHub.Models /// Single item in List or Get Event Hub operation /// [Rest.Serialization.JsonTransformation] - public partial class Eventhub : Resource + public partial class Eventhub : ProxyResource { /// /// Initializes a new instance of the Eventhub class. @@ -34,9 +34,14 @@ public Eventhub() /// /// Initializes a new instance of the Eventhub class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives /// Current number of shards on the Event /// Hub. /// Exact time the Event Hub was @@ -55,8 +60,8 @@ public Eventhub() /// description /// The system meta data relating to this /// resource. - public Eventhub(string id = default(string), string name = default(string), string type = default(string), IList partitionIds = default(IList), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), long? messageRetentionInDays = default(long?), long? partitionCount = default(long?), EntityStatus? status = default(EntityStatus?), CaptureDescription captureDescription = default(CaptureDescription), SystemData systemData = default(SystemData)) - : base(id, name, type) + public Eventhub(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IList partitionIds = default(IList), System.DateTime? createdAt = default(System.DateTime?), System.DateTime? updatedAt = default(System.DateTime?), long? messageRetentionInDays = default(long?), long? partitionCount = default(long?), EntityStatus? status = default(EntityStatus?), CaptureDescription captureDescription = default(CaptureDescription), SystemData systemData = default(SystemData)) + : base(id, name, type, location) { PartitionIds = partitionIds; CreatedAt = createdAt; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/KeyType.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/KeyType.cs index c066dab5c1f1b..c9875bcf84c42 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/KeyType.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/KeyType.cs @@ -10,51 +10,13 @@ namespace Microsoft.Azure.Management.EventHub.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for KeyType. /// - [JsonConverter(typeof(StringEnumConverter))] - public enum KeyType + public static class KeyType { - [EnumMember(Value = "PrimaryKey")] - PrimaryKey, - [EnumMember(Value = "SecondaryKey")] - SecondaryKey - } - internal static class KeyTypeEnumExtension - { - internal static string ToSerializedValue(this KeyType? value) - { - return value == null ? null : ((KeyType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this KeyType value) - { - switch( value ) - { - case KeyType.PrimaryKey: - return "PrimaryKey"; - case KeyType.SecondaryKey: - return "SecondaryKey"; - } - return null; - } - - internal static KeyType? ParseKeyType(this string value) - { - switch( value ) - { - case "PrimaryKey": - return KeyType.PrimaryKey; - case "SecondaryKey": - return KeyType.SecondaryKey; - } - return null; - } + public const string PrimaryKey = "PrimaryKey"; + public const string SecondaryKey = "SecondaryKey"; } } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSet.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSet.cs index 7b56228b10864..46f9ef3262fc2 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSet.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSet.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.EventHub.Models /// Description of topic resource. /// [Rest.Serialization.JsonTransformation] - public partial class NetworkRuleSet : Resource + public partial class NetworkRuleSet : ProxyResource { /// /// Initializes a new instance of the NetworkRuleSet class. @@ -34,9 +34,14 @@ public NetworkRuleSet() /// /// Initializes a new instance of the NetworkRuleSet class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives /// Value that indicates /// whether Trusted Service Access is Enabled or not. /// Default Action for Network Rule Set. @@ -48,8 +53,8 @@ public NetworkRuleSet() /// values include: 'Enabled', 'Disabled' /// The system meta data relating to this /// resource. - public NetworkRuleSet(string id = default(string), string name = default(string), string type = default(string), bool? trustedServiceAccessEnabled = default(bool?), string defaultAction = default(string), IList virtualNetworkRules = default(IList), IList ipRules = default(IList), string publicNetworkAccess = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type) + public NetworkRuleSet(string id = default(string), string name = default(string), string type = default(string), string location = default(string), bool? trustedServiceAccessEnabled = default(bool?), string defaultAction = default(string), IList virtualNetworkRules = default(IList), IList ipRules = default(IList), string publicNetworkAccess = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location) { TrustedServiceAccessEnabled = trustedServiceAccessEnabled; DefaultAction = defaultAction; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSetListResult.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSetListResult.cs new file mode 100644 index 0000000000000..d49a0f49dd687 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/NetworkRuleSetListResult.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; + + /// + /// The response of the List NetworkRuleSet operation + /// + public partial class NetworkRuleSetListResult + { + /// + /// Initializes a new instance of the NetworkRuleSetListResult class. + /// + public NetworkRuleSetListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkRuleSetListResult class. + /// + /// Result of the List NetworkRuleSet + /// operation + /// Link to the next set of results. Not empty + /// if Value contains incomplete list of NetworkRuleSet. + public NetworkRuleSetListResult(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 result of the List NetworkRuleSet operation + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets link to the next set of results. Not empty if Value + /// contains incomplete list of NetworkRuleSet. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Operation.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Operation.cs index 929b601d5f95f..d9a76175bc6fe 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Operation.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Operation.cs @@ -31,12 +31,18 @@ public Operation() /// /// Operation name: /// {provider}/{resource}/{operation} - /// The object that represents the - /// operation. - public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + /// Indicates whether the operation is a + /// data action + /// Display of the operation + /// Origin of the operation + /// Properties of the operation + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay), string origin = default(string), object properties = default(object)) { Name = name; + IsDataAction = isDataAction; Display = display; + Origin = origin; + Properties = properties; CustomInit(); } @@ -52,10 +58,28 @@ public Operation() public string Name { get; private set; } /// - /// Gets or sets the object that represents the operation. + /// Gets or sets indicates whether the operation is a data action + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; set; } + + /// + /// Gets or sets display of the operation /// [JsonProperty(PropertyName = "display")] public OperationDisplay Display { get; set; } + /// + /// Gets or sets origin of the operation + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + /// + /// Gets or sets properties of the operation + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + } } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/OperationDisplay.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/OperationDisplay.cs index a5e7718820e15..6c8f98d191f98 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/OperationDisplay.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/OperationDisplay.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.EventHub.Models using System.Linq; /// - /// The object that represents the operation. + /// Operation display payload /// public partial class OperationDisplay { @@ -29,16 +29,18 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Service provider: Microsoft.EventHub - /// Resource on which the operation is - /// performed: Invoice, etc. - /// Operation type: Read, write, delete, - /// etc. - public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) + /// Resource provider of the operation + /// Resource of the operation + /// Localized friendly name for the + /// operation + /// Localized friendly description for the + /// operation + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) { Provider = provider; Resource = resource; Operation = operation; + Description = description; CustomInit(); } @@ -48,22 +50,28 @@ public OperationDisplay() partial void CustomInit(); /// - /// Gets service provider: Microsoft.EventHub + /// Gets resource provider of the operation /// [JsonProperty(PropertyName = "provider")] public string Provider { get; private set; } /// - /// Gets resource on which the operation is performed: Invoice, etc. + /// Gets resource of the operation /// [JsonProperty(PropertyName = "resource")] public string Resource { get; private set; } /// - /// Gets operation type: Read, write, delete, etc. + /// Gets localized friendly name for the operation /// [JsonProperty(PropertyName = "operation")] public string Operation { get; private set; } + /// + /// Gets localized friendly description for the operation + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private 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 index 17cd64ee42102..046421f1ad93e 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/PrivateEndpointConnection.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.EventHub.Models /// Properties of the PrivateEndpointConnection. /// [Rest.Serialization.JsonTransformation] - public partial class PrivateEndpointConnection : Resource + public partial class PrivateEndpointConnection : ProxyResource { /// /// Initializes a new instance of the PrivateEndpointConnection class. @@ -32,9 +32,14 @@ public PrivateEndpointConnection() /// /// Initializes a new instance of the PrivateEndpointConnection class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives /// The Private Endpoint resource for /// this Connection. /// Details about the @@ -44,8 +49,8 @@ public PrivateEndpointConnection() /// 'Updating', 'Deleting', 'Succeeded', 'Canceled', 'Failed' /// The system meta data relating to this /// resource. - public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), ConnectionState privateLinkServiceConnectionState = default(ConnectionState), string provisioningState = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type) + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), ConnectionState privateLinkServiceConnectionState = default(ConnectionState), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location) { PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ProxyResource.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ProxyResource.cs new file mode 100644 index 0000000000000..c540b05921f68 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/ProxyResource.cs @@ -0,0 +1,87 @@ +// +// 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.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// + public partial class ProxyResource : IResource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string)) + { + Id = id; + Name = name; + Type = type; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. E.g. "Microsoft.EventHub/Namespaces" + /// or "Microsoft.EventHub/Namespaces/EventHubs" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/RegenerateAccessKeyParameters.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/RegenerateAccessKeyParameters.cs index df57c44ca3d7f..4064289f11a3a 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/RegenerateAccessKeyParameters.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/RegenerateAccessKeyParameters.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.EventHub.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -36,7 +37,7 @@ public RegenerateAccessKeyParameters() /// include: 'PrimaryKey', 'SecondaryKey' /// Optional, if the key value provided, is set for /// KeyType or autogenerated Key value set for keyType - public RegenerateAccessKeyParameters(KeyType keyType, string key = default(string)) + public RegenerateAccessKeyParameters(string keyType, string key = default(string)) { KeyType = keyType; Key = key; @@ -53,7 +54,7 @@ public RegenerateAccessKeyParameters() /// 'PrimaryKey', 'SecondaryKey' /// [JsonProperty(PropertyName = "keyType")] - public KeyType KeyType { get; set; } + public string KeyType { get; set; } /// /// Gets or sets optional, if the key value provided, is set for @@ -65,11 +66,15 @@ public RegenerateAccessKeyParameters() /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + if (KeyType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyType"); + } } } } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Resource.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Resource.cs index 59cc585e0f35a..9abe376af7778 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Resource.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/Resource.cs @@ -16,8 +16,12 @@ namespace Microsoft.Azure.Management.EventHub.Models using System.Linq; /// - /// The resource definition. + /// Resource /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : IResource { /// @@ -31,9 +35,12 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; @@ -48,19 +55,22 @@ public Resource() partial void CustomInit(); /// - /// Gets resource ID. + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets resource name. + /// Gets the name of the resource /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets resource type. + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaCompatibility.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaCompatibility.cs new file mode 100644 index 0000000000000..62f51dfe15cdd --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaCompatibility.cs @@ -0,0 +1,23 @@ +// +// 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 SchemaCompatibility. + /// + public static class SchemaCompatibility + { + public const string None = "None"; + public const string Backward = "Backward"; + public const string Forward = "Forward"; + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaGroup.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaGroup.cs new file mode 100644 index 0000000000000..caaf91f6c1746 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaGroup.cs @@ -0,0 +1,119 @@ +// +// 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; + + /// + /// Single item in List or Get Schema Group operation + /// + [Rest.Serialization.JsonTransformation] + public partial class SchemaGroup : ProxyResource + { + /// + /// Initializes a new instance of the SchemaGroup class. + /// + public SchemaGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SchemaGroup class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.EventHub/Namespaces" or + /// "Microsoft.EventHub/Namespaces/EventHubs" + /// The geo-location where the resource + /// lives + /// Exact time the Schema Group was + /// updated + /// Exact time the Schema Group was + /// created. + /// The ETag value. + /// dictionary object for SchemaGroup + /// group properties + /// Possible values include: 'None', + /// 'Backward', 'Forward' + /// Possible values include: 'Unknown', + /// 'Avro' + /// The system meta data relating to this + /// resource. + public SchemaGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.DateTime? updatedAtUtc = default(System.DateTime?), System.DateTime? createdAtUtc = default(System.DateTime?), System.Guid? eTag = default(System.Guid?), IDictionary groupProperties = default(IDictionary), string schemaCompatibility = default(string), string schemaType = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location) + { + UpdatedAtUtc = updatedAtUtc; + CreatedAtUtc = createdAtUtc; + ETag = eTag; + GroupProperties = groupProperties; + SchemaCompatibility = schemaCompatibility; + SchemaType = schemaType; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets exact time the Schema Group was updated + /// + [JsonProperty(PropertyName = "properties.updatedAtUtc")] + public System.DateTime? UpdatedAtUtc { get; private set; } + + /// + /// Gets exact time the Schema Group was created. + /// + [JsonProperty(PropertyName = "properties.createdAtUtc")] + public System.DateTime? CreatedAtUtc { get; private set; } + + /// + /// Gets the ETag value. + /// + [JsonProperty(PropertyName = "properties.eTag")] + public System.Guid? ETag { get; private set; } + + /// + /// Gets or sets dictionary object for SchemaGroup group properties + /// + [JsonProperty(PropertyName = "properties.groupProperties")] + public IDictionary GroupProperties { get; set; } + + /// + /// Gets or sets possible values include: 'None', 'Backward', 'Forward' + /// + [JsonProperty(PropertyName = "properties.schemaCompatibility")] + public string SchemaCompatibility { get; set; } + + /// + /// Gets or sets possible values include: 'Unknown', 'Avro' + /// + [JsonProperty(PropertyName = "properties.schemaType")] + public string SchemaType { get; set; } + + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaType.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaType.cs new file mode 100644 index 0000000000000..b43b4da4830c9 --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/SchemaType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EventHub.Models +{ + + /// + /// Defines values for SchemaType. + /// + public static class SchemaType + { + public const string Unknown = "Unknown"; + public const string Avro = "Avro"; + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/TrackedResource.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/TrackedResource.cs index 0f2de89f8c942..e8365d2b4fe34 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/TrackedResource.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/Models/TrackedResource.cs @@ -31,9 +31,12 @@ public TrackedResource() /// /// Initializes a new instance of the TrackedResource class. /// - /// Resource ID. - /// Resource name. - /// Resource type. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource location. /// Resource tags. public TrackedResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) 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 c32698137968c..35e536e182820 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperations.cs @@ -1365,6 +1365,219 @@ internal NamespacesOperations(EventHubManagementClient client) return _result; } + /// + /// Gets NetworkRuleSet for 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> ListNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (namespaceName != null) + { + if (namespaceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "namespaceName", 50); + } + if (namespaceName.Length < 6) + { + throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkRuleSet", 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}/networkRuleSets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Gets a list of authorization rules for a Namespace. /// @@ -2534,7 +2747,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, KeyType keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string authorizationRuleName, string keyType, string key = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2585,8 +2798,12 @@ internal NamespacesOperations(EventHubManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (keyType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + } RegenerateAccessKeyParameters parameters = new RegenerateAccessKeyParameters(); - if (key != null) + if (keyType != null || key != null) { parameters.KeyType = keyType; parameters.Key = key; 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 b7f848c62125c..1fcf95bccb553 100644 --- a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperationsExtensions.cs +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/NamespacesOperationsExtensions.cs @@ -348,6 +348,46 @@ public static NetworkRuleSet GetNetworkRuleSet(this INamespacesOperations operat } } + /// + /// Gets NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + public static NetworkRuleSetListResult ListNetworkRuleSet(this INamespacesOperations operations, string resourceGroupName, string namespaceName) + { + return operations.ListNetworkRuleSetAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The cancellation token. + /// + public static async Task ListNetworkRuleSetAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNetworkRuleSetWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a list of authorization rules for a Namespace. /// @@ -599,7 +639,7 @@ public static AccessKeys ListKeys(this INamespacesOperations operations, string /// 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)) + public static AccessKeys RegenerateKeys(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, string keyType, string key = default(string)) { return operations.RegenerateKeysAsync(resourceGroupName, namespaceName, authorizationRuleName, keyType, key).GetAwaiter().GetResult(); } @@ -631,7 +671,7 @@ public static AccessKeys ListKeys(this INamespacesOperations operations, string /// /// The cancellation token. /// - public static async Task RegenerateKeysAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, KeyType keyType, string key = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateKeysAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName, string keyType, string key = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, namespaceName, authorizationRuleName, keyType, key, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SchemaRegistryOperations.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SchemaRegistryOperations.cs new file mode 100644 index 0000000000000..bcbaec1acf2dc --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SchemaRegistryOperations.cs @@ -0,0 +1,1154 @@ +// +// 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; + + /// + /// SchemaRegistryOperations operations. + /// + internal partial class SchemaRegistryOperations : IServiceOperations, ISchemaRegistryOperations + { + /// + /// Initializes a new instance of the SchemaRegistryOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SchemaRegistryOperations(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 all the Schema Groups in a Namespace. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. + /// + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. + /// + /// + /// 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>> ListByNamespaceWithHttpMessagesAsync(string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (namespaceName != null) + { + if (namespaceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "namespaceName", 50); + } + if (namespaceName.Length < 6) + { + throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (skip > 1000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "skip", 1000); + } + if (skip < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0); + } + if (top > 1000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 1000); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + // 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("skip", skip); + tracingParameters.Add("top", top); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByNamespace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (skip != null) + { + _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // 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; + } + + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + /// + /// Parameters supplied to create an Event Hub 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 schemaGroupName, SchemaGroup parameters, 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 (schemaGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaGroupName"); + } + if (schemaGroupName != null) + { + if (schemaGroupName.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "schemaGroupName", 256); + } + if (schemaGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "schemaGroupName", 1); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // 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("schemaGroupName", schemaGroupName); + 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}/schemagroups/{schemaGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{schemaGroupName}", System.Uri.EscapeDataString(schemaGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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) + { + 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; + } + + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string namespaceName, string schemaGroupName, 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 (schemaGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaGroupName"); + } + if (schemaGroupName != null) + { + if (schemaGroupName.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "schemaGroupName", 256); + } + if (schemaGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "schemaGroupName", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // 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("schemaGroupName", schemaGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{schemaGroupName}", System.Uri.EscapeDataString(schemaGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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 != 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; + } + + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group 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 schemaGroupName, 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 (schemaGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "schemaGroupName"); + } + if (schemaGroupName != null) + { + if (schemaGroupName.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "schemaGroupName", 256); + } + if (schemaGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "schemaGroupName", 1); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // 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("schemaGroupName", schemaGroupName); + 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}/schemagroups/{schemaGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _url = _url.Replace("{schemaGroupName}", System.Uri.EscapeDataString(schemaGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the Schema Groups in 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>> ListByNamespaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByNamespaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + 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/SchemaRegistryOperationsExtensions.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SchemaRegistryOperationsExtensions.cs new file mode 100644 index 0000000000000..c49fc609f212a --- /dev/null +++ b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SchemaRegistryOperationsExtensions.cs @@ -0,0 +1,242 @@ +// +// 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 SchemaRegistryOperations. + /// + public static partial class SchemaRegistryOperationsExtensions + { + /// + /// Gets all the Schema Groups in a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. + /// + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. + /// + public static IPage ListByNamespace(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?)) + { + return operations.ListByNamespaceAsync(resourceGroupName, namespaceName, skip, top).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Schema Groups in a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// Skip is only used if a previous operation returned a partial result. If a + /// previous response contains a nextLink element, the value of the nextLink + /// element will include a skip parameter that specifies a starting point to + /// use for subsequent calls. + /// + /// + /// May be used to limit the number of results to the most recent N + /// usageDetails. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByNamespaceAsync(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, int? skip = default(int?), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByNamespaceWithHttpMessagesAsync(resourceGroupName, namespaceName, skip, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + /// + /// Parameters supplied to create an Event Hub resource. + /// + public static SchemaGroup CreateOrUpdate(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, string schemaGroupName, SchemaGroup parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, namespaceName, schemaGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + /// + /// Parameters supplied to create an Event Hub resource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, string schemaGroupName, SchemaGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, namespaceName, schemaGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + public static void Delete(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, string schemaGroupName) + { + operations.DeleteAsync(resourceGroupName, namespaceName, schemaGroupName).GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, string schemaGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, namespaceName, schemaGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + public static SchemaGroup Get(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, string schemaGroupName) + { + return operations.GetAsync(resourceGroupName, namespaceName, schemaGroupName).GetAwaiter().GetResult(); + } + + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group within the azure subscription. + /// + /// + /// The Namespace name + /// + /// + /// The Schema Group name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISchemaRegistryOperations operations, string resourceGroupName, string namespaceName, string schemaGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, namespaceName, schemaGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the Schema Groups in a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByNamespaceNext(this ISchemaRegistryOperations operations, string nextPageLink) + { + return operations.ListByNamespaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Schema Groups in 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> ListByNamespaceNextAsync(this ISchemaRegistryOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByNamespaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SdkInfo_EventHubManagementClient.cs b/sdk/eventhub/Microsoft.Azure.Management.EventHub/src/Generated/SdkInfo_EventHubManagementClient.cs index 986a40307deb5..9300c986fbae8 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 @@ -19,28 +19,18 @@ public static IEnumerable> ApiInfo_EventHubManagem { return new Tuple[] { - new Tuple("EventHub", "Clusters", "2021-06-01-preview"), - new Tuple("EventHub", "Configuration", "2021-06-01-preview"), - new Tuple("EventHub", "ConsumerGroups", "2021-06-01-preview"), - new Tuple("EventHub", "DisasterRecoveryConfigs", "2021-06-01-preview"), - new Tuple("EventHub", "EventHubs", "2021-06-01-preview"), - new Tuple("EventHub", "Namespaces", "2021-06-01-preview"), - new Tuple("EventHub", "Operations", "2021-06-01-preview"), - new Tuple("EventHub", "PrivateEndpointConnections", "2021-06-01-preview"), - new Tuple("EventHub", "PrivateLinkResources", "2021-06-01-preview"), + new Tuple("EventHub", "Clusters", "2021-11-01"), + new Tuple("EventHub", "Configuration", "2021-11-01"), + new Tuple("EventHub", "ConsumerGroups", "2021-11-01"), + new Tuple("EventHub", "DisasterRecoveryConfigs", "2021-11-01"), + new Tuple("EventHub", "EventHubs", "2021-11-01"), + new Tuple("EventHub", "Namespaces", "2021-11-01"), + new Tuple("EventHub", "Operations", "2021-11-01"), + new Tuple("EventHub", "PrivateEndpointConnections", "2021-11-01"), + new Tuple("EventHub", "PrivateLinkResources", "2021-11-01"), + new Tuple("EventHub", "SchemaRegistry", "2021-11-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/main/specification/eventhub/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\autorest2021\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "699c3a00cf4fbfcd0a91beb99c93c77195eff804"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -