diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperations.cs index 05f3d63080b3..92c238c93d9e 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperations.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperations.cs @@ -497,7 +497,7 @@ internal CertificatesOperations(IotHubClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string certificateName, CertificateDescription certificateDescription, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperationsExtensions.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperationsExtensions.cs index 1d1557a38636..1d9c8466460b 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperationsExtensions.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/CertificatesOperationsExtensions.cs @@ -144,7 +144,7 @@ public static CertificateDescription Get(this ICertificatesOperations operations /// ETag of the Certificate. Do not specify for creating a brand new /// certificate. Required to update an existing certificate. /// - public static CertificateDescription CreateOrUpdate(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string)) + public static CertificateDescription CreateOrUpdate(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, CertificateDescription certificateDescription, string ifMatch = default(string)) { return operations.CreateOrUpdateAsync(resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch).GetAwaiter().GetResult(); } @@ -177,7 +177,7 @@ public static CertificateDescription Get(this ICertificatesOperations operations /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ICertificatesOperations operations, string resourceGroupName, string resourceName, string certificateName, CertificateDescription certificateDescription, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/ICertificatesOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/ICertificatesOperations.cs index aa2b3e2e6b23..c7a65431fb3c 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/ICertificatesOperations.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/ICertificatesOperations.cs @@ -119,7 +119,7 @@ public partial interface ICertificatesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string certificateName, CertificateDescription certificateDescription, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete an X509 certificate. /// diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubResourceOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubResourceOperations.cs index 1d0809f02b6a..e85dbbe9251b 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubResourceOperations.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubResourceOperations.cs @@ -341,6 +341,9 @@ public partial interface IIotHubResourceOperations /// /// The name of the consumer group to add. /// + /// + /// The consumer group to add. + /// /// /// The headers that will be added to request. /// @@ -356,7 +359,7 @@ public partial interface IIotHubResourceOperations /// /// Thrown when a required parameter is null /// - Task> CreateEventHubConsumerGroupWithHttpMessagesAsync(string resourceGroupName, string resourceName, string eventHubEndpointName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateEventHubConsumerGroupWithHttpMessagesAsync(string resourceGroupName, string resourceName, string eventHubEndpointName, string name, EventHubConsumerGroupBodyDescription consumerGroupBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete a consumer group from an Event Hub-compatible endpoint in an /// IoT hub diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubClient.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubClient.cs index 628c9ae6d57e..065909049fda 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubClient.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubClient.cs @@ -358,7 +358,7 @@ private void Initialize() PrivateLinkResources = new PrivateLinkResourcesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-04-01"; + ApiVersion = "2020-06-15"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperations.cs index de5d6616e2e4..6c4f5be5c98d 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperations.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperations.cs @@ -1519,6 +1519,9 @@ internal IotHubResourceOperations(IotHubClient client) /// /// The name of the consumer group to add. /// + /// + /// The consumer group to add. + /// /// /// Headers that will be added to request. /// @@ -1540,7 +1543,7 @@ internal IotHubResourceOperations(IotHubClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateEventHubConsumerGroupWithHttpMessagesAsync(string resourceGroupName, string resourceName, string eventHubEndpointName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateEventHubConsumerGroupWithHttpMessagesAsync(string resourceGroupName, string resourceName, string eventHubEndpointName, string name, EventHubConsumerGroupBodyDescription consumerGroupBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1566,6 +1569,10 @@ internal IotHubResourceOperations(IotHubClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } + if (consumerGroupBody == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "consumerGroupBody"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1577,6 +1584,7 @@ internal IotHubResourceOperations(IotHubClient client) tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("eventHubEndpointName", eventHubEndpointName); tracingParameters.Add("name", name); + tracingParameters.Add("consumerGroupBody", consumerGroupBody); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateEventHubConsumerGroup", tracingParameters); } @@ -1631,6 +1639,12 @@ internal IotHubResourceOperations(IotHubClient client) // Serialize Request string _requestContent = null; + if(consumerGroupBody != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(consumerGroupBody, 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) { diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperationsExtensions.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperationsExtensions.cs index 6c423b599e80..1fdc30e40939 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperationsExtensions.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubResourceOperationsExtensions.cs @@ -538,9 +538,12 @@ public static EventHubConsumerGroupInfo GetEventHubConsumerGroup(this IIotHubRes /// /// The name of the consumer group to add. /// - public static EventHubConsumerGroupInfo CreateEventHubConsumerGroup(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string eventHubEndpointName, string name) + /// + /// The consumer group to add. + /// + public static EventHubConsumerGroupInfo CreateEventHubConsumerGroup(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string eventHubEndpointName, string name, EventHubConsumerGroupBodyDescription consumerGroupBody) { - return operations.CreateEventHubConsumerGroupAsync(resourceGroupName, resourceName, eventHubEndpointName, name).GetAwaiter().GetResult(); + return operations.CreateEventHubConsumerGroupAsync(resourceGroupName, resourceName, eventHubEndpointName, name, consumerGroupBody).GetAwaiter().GetResult(); } /// @@ -564,12 +567,15 @@ public static EventHubConsumerGroupInfo CreateEventHubConsumerGroup(this IIotHub /// /// The name of the consumer group to add. /// + /// + /// The consumer group to add. + /// /// /// The cancellation token. /// - public static async Task CreateEventHubConsumerGroupAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string eventHubEndpointName, string name, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateEventHubConsumerGroupAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string eventHubEndpointName, string name, EventHubConsumerGroupBodyDescription consumerGroupBody, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateEventHubConsumerGroupWithHttpMessagesAsync(resourceGroupName, resourceName, eventHubEndpointName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateEventHubConsumerGroupWithHttpMessagesAsync(resourceGroupName, resourceName, eventHubEndpointName, name, consumerGroupBody, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EventHubConsumerGroupBodyDescription.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EventHubConsumerGroupBodyDescription.cs new file mode 100644 index 000000000000..ddf50f27990f --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EventHubConsumerGroupBodyDescription.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.IotHub.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The EventHub consumer group. + /// + public partial class EventHubConsumerGroupBodyDescription + { + /// + /// Initializes a new instance of the + /// EventHubConsumerGroupBodyDescription class. + /// + public EventHubConsumerGroupBodyDescription() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// EventHubConsumerGroupBodyDescription class. + /// + public EventHubConsumerGroupBodyDescription(EventHubConsumerGroupName properties = default(EventHubConsumerGroupName)) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public EventHubConsumerGroupName Properties { get; set; } + + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EventHubConsumerGroupName.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EventHubConsumerGroupName.cs new file mode 100644 index 000000000000..c090911174d5 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EventHubConsumerGroupName.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.IotHub.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The EventHub consumer group name. + /// + public partial class EventHubConsumerGroupName + { + /// + /// Initializes a new instance of the EventHubConsumerGroupName class. + /// + public EventHubConsumerGroupName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EventHubConsumerGroupName class. + /// + /// EventHub consumer group name + public EventHubConsumerGroupName(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets eventHub consumer group name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs index 75b244e99f95..42e61a79e815 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs @@ -19,13 +19,13 @@ public static IEnumerable> ApiInfo_iotHubClient { return new Tuple[] { - new Tuple("Devices", "Certificates", "2020-04-01"), - new Tuple("Devices", "IotHub", "2020-04-01"), - new Tuple("Devices", "IotHubResource", "2020-04-01"), - new Tuple("Devices", "Operations", "2020-04-01"), - new Tuple("Devices", "PrivateEndpointConnections", "2020-04-01"), - new Tuple("Devices", "PrivateLinkResources", "2020-04-01"), - new Tuple("Devices", "ResourceProviderCommon", "2020-04-01"), + new Tuple("Devices", "Certificates", "2020-06-15"), + new Tuple("Devices", "IotHub", "2020-06-15"), + new Tuple("Devices", "IotHubResource", "2020-06-15"), + new Tuple("Devices", "Operations", "2020-06-15"), + new Tuple("Devices", "PrivateEndpointConnections", "2020-06-15"), + new Tuple("Devices", "PrivateLinkResources", "2020-06-15"), + new Tuple("Devices", "ResourceProviderCommon", "2020-06-15"), }.AsEnumerable(); } }