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 05f3d63080b3b..92c238c93d9e9 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 1d1557a386364..1d9c8466460b8 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 aa2b3e2e6b23f..c7a65431fb3c0 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/IIotHubClient.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubClient.cs index a17e240376a52..18fa146b2ea3d 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubClient.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubClient.cs @@ -94,5 +94,15 @@ public partial interface IIotHubClient : System.IDisposable /// IIotHubOperations IotHub { get; } + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + IPrivateLinkResourcesOperations PrivateLinkResources { get; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + } } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubOperations.cs index 6c2670299f9b5..daad14f39f988 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubOperations.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IIotHubOperations.cs @@ -24,19 +24,23 @@ namespace Microsoft.Azure.Management.IotHub public partial interface IIotHubOperations { /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary + /// region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary + /// region. To learn more, see https://aka.ms/manualfailover /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the + /// value from the secondary location in the locations property. To + /// learn more, see https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// /// /// The headers that will be added to request. @@ -52,19 +56,23 @@ public partial interface IIotHubOperations /// Task ManualFailoverWithHttpMessagesAsync(string iotHubName, FailoverInput failoverInput, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary + /// region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary + /// region. To learn more, see https://aka.ms/manualfailover /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the + /// value from the secondary location in the locations property. To + /// learn more, see https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// /// /// The headers that will be added to request. 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 1d0809f02b6a8..e85dbbe9251b6 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/IPrivateEndpointConnectionsOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IPrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..7113652a9ad3b --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -0,0 +1,218 @@ +// +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + public partial interface IPrivateEndpointConnectionsOperations + { + /// + /// List private endpoint connections + /// + /// + /// List private endpoint connection properties + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get private endpoint connection + /// + /// + /// Get private endpoint connection properties + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// 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 resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the + /// specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// 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> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the + /// specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// 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> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IPrivateLinkResourcesOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IPrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..e1536b6eda20f --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IPrivateLinkResourcesOperations.cs @@ -0,0 +1,86 @@ +// +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + public partial interface IPrivateLinkResourcesOperations + { + /// + /// List private link resources + /// + /// + /// List private link resources for the given IotHub + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the specified private link resource + /// + /// + /// Get the specified private link resource for the given IotHub + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private link 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} 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 a24aed577c984..33a1d5c80234e 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubClient.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubClient.cs @@ -99,6 +99,16 @@ public partial class IotHubClient : ServiceClient, IIotHubClient, /// public virtual IIotHubOperations IotHub { get; private set; } + /// + /// Gets the IPrivateLinkResourcesOperations. + /// + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + + /// + /// Gets the IPrivateEndpointConnectionsOperations. + /// + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + /// /// Initializes a new instance of the IotHubClient class. /// @@ -345,8 +355,10 @@ private void Initialize() ResourceProviderCommon = new ResourceProviderCommonOperations(this); Certificates = new CertificatesOperations(this); IotHub = new IotHubOperations(this); + PrivateLinkResources = new PrivateLinkResourcesOperations(this); + PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-07-01-preview"; + ApiVersion = "2020-08-31"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperations.cs index 7134be018cc59..e560aa78eeb0f 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperations.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperations.cs @@ -51,19 +51,22 @@ internal IotHubOperations(IotHubClient client) public IotHubClient Client { get; private set; } /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary region. To + /// learn more, see https://aka.ms/manualfailover /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the value from + /// the secondary location in the locations property. To learn more, see + /// https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// /// /// The headers that will be added to request. @@ -79,19 +82,22 @@ internal IotHubOperations(IotHubClient client) } /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary region. To + /// learn more, see https://aka.ms/manualfailover /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the value from + /// the secondary location in the locations property. To learn more, see + /// https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// /// /// Headers that will be added to request. diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperationsExtensions.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperationsExtensions.cs index 6dbd00354cf62..179cbc75c7552 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperationsExtensions.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/IotHubOperationsExtensions.cs @@ -22,22 +22,25 @@ namespace Microsoft.Azure.Management.IotHub public static partial class IotHubOperationsExtensions { /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary region. To + /// learn more, see https://aka.ms/manualfailover /// /// /// The operations group for this extension method. /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the value from + /// the secondary location in the locations property. To learn more, see + /// https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// public static void ManualFailover(this IIotHubOperations operations, string iotHubName, FailoverInput failoverInput, string resourceGroupName) { @@ -45,22 +48,25 @@ public static void ManualFailover(this IIotHubOperations operations, string iotH } /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary region. To + /// learn more, see https://aka.ms/manualfailover /// /// /// The operations group for this extension method. /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the value from + /// the secondary location in the locations property. To learn more, see + /// https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// /// /// The cancellation token. @@ -71,22 +77,25 @@ public static void ManualFailover(this IIotHubOperations operations, string iotH } /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary region. To + /// learn more, see https://aka.ms/manualfailover /// /// /// The operations group for this extension method. /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the value from + /// the secondary location in the locations property. To learn more, see + /// https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// public static void BeginManualFailover(this IIotHubOperations operations, string iotHubName, FailoverInput failoverInput, string resourceGroupName) { @@ -94,22 +103,25 @@ public static void BeginManualFailover(this IIotHubOperations operations, string } /// - /// Manual Failover Fail over + /// Manually initiate a failover for the IoT Hub to its secondary region /// /// - /// Perform manual fail over of given hub + /// Manually initiate a failover for the IoT Hub to its secondary region. To + /// learn more, see https://aka.ms/manualfailover /// /// /// The operations group for this extension method. /// /// - /// IotHub to fail over + /// Name of the IoT hub to failover /// /// - /// Region to failover to. Must be a azure DR pair + /// Region to failover to. Must be the Azure paired region. Get the value from + /// the secondary location in the locations property. To learn more, see + /// https://aka.ms/manualfailover/region /// /// - /// resource group which Iot Hub belongs to + /// Name of the resource group containing the IoT hub resource /// /// /// The cancellation token. 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 de5d6616e2e4e..6c4f5be5c98d0 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 6c423b599e808..1fdc30e409394 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/AuthenticationType.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/AuthenticationType.cs new file mode 100644 index 0000000000000..927b2548df33a --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/AuthenticationType.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.IotHub.Models +{ + + /// + /// Defines values for AuthenticationType. + /// + public static class AuthenticationType + { + public const string KeyBased = "keyBased"; + public const string IdentityBased = "identityBased"; + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/DefaultAction.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/DefaultAction.cs new file mode 100644 index 0000000000000..3266ced524ae6 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/DefaultAction.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.IotHub.Models +{ + + /// + /// Defines values for DefaultAction. + /// + public static class DefaultAction + { + public const string Deny = "Deny"; + public const string Allow = "Allow"; + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthData.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthData.cs index 7e81c9abf2e42..495dc1ed57ca8 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthData.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthData.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Management.IotHub.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; @@ -43,11 +45,23 @@ public EndpointHealthData() /// shows that the IoT Hub has not established a connection with the /// endpoint. No messages have been delivered to or rejected from this /// endpoint. Possible values include: 'unknown', 'healthy', - /// 'unhealthy', 'dead' - public EndpointHealthData(string endpointId = default(string), string healthStatus = default(string)) + /// 'degraded', 'unhealthy', 'dead' + /// Last error obtained when a message + /// failed to be delivered to iot hub + /// Time at which the last known error + /// occurred + /// Last time iot hub + /// successfully sent a message to the endpoint + /// Last time iot hub tried to send a + /// message to the endpoint + public EndpointHealthData(string endpointId = default(string), string healthStatus = default(string), string lastKnownError = default(string), System.DateTime? lastKnownErrorTime = default(System.DateTime?), System.DateTime? lastSuccessfulSendAttemptTime = default(System.DateTime?), System.DateTime? lastSendAttemptTime = default(System.DateTime?)) { EndpointId = endpointId; HealthStatus = healthStatus; + LastKnownError = lastKnownError; + LastKnownErrorTime = lastKnownErrorTime; + LastSuccessfulSendAttemptTime = lastSuccessfulSendAttemptTime; + LastSendAttemptTime = lastSendAttemptTime; CustomInit(); } @@ -75,10 +89,41 @@ public EndpointHealthData() /// issues with endpoints. The 'unknown' status shows that the IoT Hub /// has not established a connection with the endpoint. No messages /// have been delivered to or rejected from this endpoint. Possible - /// values include: 'unknown', 'healthy', 'unhealthy', 'dead' + /// values include: 'unknown', 'healthy', 'degraded', 'unhealthy', + /// 'dead' /// [JsonProperty(PropertyName = "healthStatus")] public string HealthStatus { get; set; } + /// + /// Gets or sets last error obtained when a message failed to be + /// delivered to iot hub + /// + [JsonProperty(PropertyName = "lastKnownError")] + public string LastKnownError { get; set; } + + /// + /// Gets or sets time at which the last known error occurred + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "lastKnownErrorTime")] + public System.DateTime? LastKnownErrorTime { get; set; } + + /// + /// Gets or sets last time iot hub successfully sent a message to the + /// endpoint + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "lastSuccessfulSendAttemptTime")] + public System.DateTime? LastSuccessfulSendAttemptTime { get; set; } + + /// + /// Gets or sets last time iot hub tried to send a message to the + /// endpoint + /// + [JsonConverter(typeof(DateTimeRfc1123JsonConverter))] + [JsonProperty(PropertyName = "lastSendAttemptTime")] + public System.DateTime? LastSendAttemptTime { get; set; } + } } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthStatus.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthStatus.cs index 82fd7f09e03a0..b5de1f7c9d01d 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthStatus.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/EndpointHealthStatus.cs @@ -18,6 +18,7 @@ public static class EndpointHealthStatus { public const string Unknown = "unknown"; public const string Healthy = "healthy"; + public const string Degraded = "degraded"; public const string Unhealthy = "unhealthy"; public const string Dead = "dead"; } 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 0000000000000..ddf50f27990f1 --- /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 0000000000000..c090911174d5a --- /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/Models/ExportDevicesRequest.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/ExportDevicesRequest.cs index 3e002e7271eb1..21fb528b09978 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/ExportDevicesRequest.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/ExportDevicesRequest.cs @@ -35,10 +35,26 @@ public ExportDevicesRequest() /// URI. /// The value indicating whether keys should /// be excluded during export. - public ExportDevicesRequest(string exportBlobContainerUri, bool excludeKeys) + /// The name of the blob that will be + /// created in the provided output blob container. This blob will + /// contain the exported device registry information for the IoT + /// Hub. + /// Specifies authentication type + /// being used for connecting to the storage account. Possible values + /// include: 'keyBased', 'identityBased' + /// The value indicating whether + /// configurations should be exported. + /// The name of the blob that will + /// be created in the provided output blob container. This blob will + /// contain the exported configurations for the Iot Hub. + public ExportDevicesRequest(string exportBlobContainerUri, bool excludeKeys, string exportBlobName = default(string), string authenticationType = default(string), bool? includeConfigurations = default(bool?), string configurationsBlobName = default(string)) { ExportBlobContainerUri = exportBlobContainerUri; ExcludeKeys = excludeKeys; + ExportBlobName = exportBlobName; + AuthenticationType = authenticationType; + IncludeConfigurations = includeConfigurations; + ConfigurationsBlobName = configurationsBlobName; CustomInit(); } @@ -60,6 +76,37 @@ public ExportDevicesRequest(string exportBlobContainerUri, bool excludeKeys) [JsonProperty(PropertyName = "excludeKeys")] public bool ExcludeKeys { get; set; } + /// + /// Gets or sets the name of the blob that will be created in the + /// provided output blob container. This blob will contain the exported + /// device registry information for the IoT Hub. + /// + [JsonProperty(PropertyName = "exportBlobName")] + public string ExportBlobName { get; set; } + + /// + /// Gets or sets specifies authentication type being used for + /// connecting to the storage account. Possible values include: + /// 'keyBased', 'identityBased' + /// + [JsonProperty(PropertyName = "authenticationType")] + public string AuthenticationType { get; set; } + + /// + /// Gets or sets the value indicating whether configurations should be + /// exported. + /// + [JsonProperty(PropertyName = "includeConfigurations")] + public bool? IncludeConfigurations { get; set; } + + /// + /// Gets or sets the name of the blob that will be created in the + /// provided output blob container. This blob will contain the exported + /// configurations for the Iot Hub. + /// + [JsonProperty(PropertyName = "configurationsBlobName")] + public string ConfigurationsBlobName { get; set; } + /// /// Validate the object. /// diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/GroupIdInformation.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/GroupIdInformation.cs new file mode 100644 index 0000000000000..a646ed0f9a277 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/GroupIdInformation.cs @@ -0,0 +1,94 @@ +// +// 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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The group information for creating a private endpoint on an IotHub + /// + public partial class GroupIdInformation + { + /// + /// Initializes a new instance of the GroupIdInformation class. + /// + public GroupIdInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GroupIdInformation class. + /// + /// The resource identifier. + /// The resource name. + /// The resource type. + public GroupIdInformation(GroupIdInformationProperties properties, string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public GroupIdInformationProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + } + if (Name != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Name, "^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "Name", "^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$"); + } + } + } + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/GroupIdInformationProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/GroupIdInformationProperties.cs new file mode 100644 index 0000000000000..847cf84527782 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/GroupIdInformationProperties.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.IotHub.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties for a group information object + /// + public partial class GroupIdInformationProperties + { + /// + /// Initializes a new instance of the GroupIdInformationProperties + /// class. + /// + public GroupIdInformationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GroupIdInformationProperties + /// class. + /// + /// The group id + /// The required members for a specific + /// group id + /// The required DNS zones for a + /// specific group id + public GroupIdInformationProperties(string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the group id + /// + [JsonProperty(PropertyName = "groupId")] + public string GroupId { get; set; } + + /// + /// Gets or sets the required members for a specific group id + /// + [JsonProperty(PropertyName = "requiredMembers")] + public IList RequiredMembers { get; set; } + + /// + /// Gets or sets the required DNS zones for a specific group id + /// + [JsonProperty(PropertyName = "requiredZoneNames")] + public IList RequiredZoneNames { get; set; } + + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/ImportDevicesRequest.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/ImportDevicesRequest.cs index 7863c58693d55..8fb9ed0843915 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/ImportDevicesRequest.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/ImportDevicesRequest.cs @@ -35,10 +35,27 @@ public ImportDevicesRequest() /// URI. /// The output blob container /// URI. - public ImportDevicesRequest(string inputBlobContainerUri, string outputBlobContainerUri) + /// The blob name to be used when importing + /// from the provided input blob container. + /// The blob name to use for storing the + /// status of the import job. + /// Specifies authentication type + /// being used for connecting to the storage account. Possible values + /// include: 'keyBased', 'identityBased' + /// The value indicating whether + /// configurations should be imported. + /// The blob name to be used when + /// importing configurations from the provided input blob + /// container. + public ImportDevicesRequest(string inputBlobContainerUri, string outputBlobContainerUri, string inputBlobName = default(string), string outputBlobName = default(string), string authenticationType = default(string), bool? includeConfigurations = default(bool?), string configurationsBlobName = default(string)) { InputBlobContainerUri = inputBlobContainerUri; OutputBlobContainerUri = outputBlobContainerUri; + InputBlobName = inputBlobName; + OutputBlobName = outputBlobName; + AuthenticationType = authenticationType; + IncludeConfigurations = includeConfigurations; + ConfigurationsBlobName = configurationsBlobName; CustomInit(); } @@ -59,6 +76,42 @@ public ImportDevicesRequest(string inputBlobContainerUri, string outputBlobConta [JsonProperty(PropertyName = "outputBlobContainerUri")] public string OutputBlobContainerUri { get; set; } + /// + /// Gets or sets the blob name to be used when importing from the + /// provided input blob container. + /// + [JsonProperty(PropertyName = "inputBlobName")] + public string InputBlobName { get; set; } + + /// + /// Gets or sets the blob name to use for storing the status of the + /// import job. + /// + [JsonProperty(PropertyName = "outputBlobName")] + public string OutputBlobName { get; set; } + + /// + /// Gets or sets specifies authentication type being used for + /// connecting to the storage account. Possible values include: + /// 'keyBased', 'identityBased' + /// + [JsonProperty(PropertyName = "authenticationType")] + public string AuthenticationType { get; set; } + + /// + /// Gets or sets the value indicating whether configurations should be + /// imported. + /// + [JsonProperty(PropertyName = "includeConfigurations")] + public bool? IncludeConfigurations { get; set; } + + /// + /// Gets or sets the blob name to be used when importing configurations + /// from the provided input blob container. + /// + [JsonProperty(PropertyName = "configurationsBlobName")] + public string ConfigurationsBlobName { get; set; } + /// /// Validate the object. /// diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubLocationDescription.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubLocationDescription.cs index 81b9b6254fe03..0adf8e3c46fe7 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubLocationDescription.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubLocationDescription.cs @@ -30,9 +30,13 @@ public IotHubLocationDescription() /// /// Initializes a new instance of the IotHubLocationDescription class. /// - /// Azure Geo Regions - /// Specific Role assigned to this location. - /// Possible values include: 'primary', 'secondary' + /// The name of the Azure region + /// The role of the region, can be either primary or + /// secondary. The primary region is where the IoT hub is currently + /// provisioned. The secondary region is the Azure disaster recovery + /// (DR) paired region and also the region where the IoT hub can + /// failover to. Possible values include: 'primary', + /// 'secondary' public IotHubLocationDescription(string location = default(string), string role = default(string)) { Location = location; @@ -46,14 +50,17 @@ public IotHubLocationDescription() partial void CustomInit(); /// - /// Gets or sets azure Geo Regions + /// Gets or sets the name of the Azure region /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Gets or sets specific Role assigned to this location. Possible - /// values include: 'primary', 'secondary' + /// Gets or sets the role of the region, can be either primary or + /// secondary. The primary region is where the IoT hub is currently + /// provisioned. The secondary region is the Azure disaster recovery + /// (DR) paired region and also the region where the IoT hub can + /// failover to. Possible values include: 'primary', 'secondary' /// [JsonProperty(PropertyName = "role")] public string Role { get; set; } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubProperties.cs index 77b4a13002f32..2b73c00c41e4a 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubProperties.cs @@ -33,7 +33,15 @@ public IotHubProperties() /// /// The shared access policies you /// can use to secure a connection to the IoT hub. + /// Whether requests from Public + /// Network are allowed. Possible values include: 'Enabled', + /// 'Disabled' /// The IP filter rules. + /// Specifies the minimum TLS version to + /// support for this hub. Can be set to "1.2" to have clients that use + /// a TLS version below 1.2 to be rejected. + /// Private endpoint + /// connections created on this IotHub /// The provisioning state. /// The hub state. /// The name of the host. @@ -53,17 +61,19 @@ public IotHubProperties() /// If True, file upload /// notifications are enabled. /// IoT hub comments. - /// The device streams properties of - /// iothub. /// The capabilities and features enabled for /// the IoT hub. Possible values include: 'None', /// 'DeviceManagement' /// Primary and secondary location for iot /// hub - public IotHubProperties(IList authorizationPolicies = default(IList), IList ipFilterRules = default(IList), string provisioningState = default(string), string state = default(string), string hostName = default(string), IDictionary eventHubEndpoints = default(IDictionary), RoutingProperties routing = default(RoutingProperties), IDictionary storageEndpoints = default(IDictionary), IDictionary messagingEndpoints = default(IDictionary), bool? enableFileUploadNotifications = default(bool?), CloudToDeviceProperties cloudToDevice = default(CloudToDeviceProperties), string comments = default(string), IotHubPropertiesDeviceStreams deviceStreams = default(IotHubPropertiesDeviceStreams), string features = default(string), IList locations = default(IList)) + public IotHubProperties(IList authorizationPolicies = default(IList), string publicNetworkAccess = default(string), IList ipFilterRules = default(IList), NetworkRuleSetProperties networkRuleSets = default(NetworkRuleSetProperties), string minTlsVersion = default(string), IList privateEndpointConnections = default(IList), string provisioningState = default(string), string state = default(string), string hostName = default(string), IDictionary eventHubEndpoints = default(IDictionary), RoutingProperties routing = default(RoutingProperties), IDictionary storageEndpoints = default(IDictionary), IDictionary messagingEndpoints = default(IDictionary), bool? enableFileUploadNotifications = default(bool?), CloudToDeviceProperties cloudToDevice = default(CloudToDeviceProperties), string comments = default(string), string features = default(string), IList locations = default(IList)) { AuthorizationPolicies = authorizationPolicies; + PublicNetworkAccess = publicNetworkAccess; IpFilterRules = ipFilterRules; + NetworkRuleSets = networkRuleSets; + MinTlsVersion = minTlsVersion; + PrivateEndpointConnections = privateEndpointConnections; ProvisioningState = provisioningState; State = state; HostName = hostName; @@ -74,7 +84,6 @@ public IotHubProperties() EnableFileUploadNotifications = enableFileUploadNotifications; CloudToDevice = cloudToDevice; Comments = comments; - DeviceStreams = deviceStreams; Features = features; Locations = locations; CustomInit(); @@ -92,12 +101,38 @@ public IotHubProperties() [JsonProperty(PropertyName = "authorizationPolicies")] public IList AuthorizationPolicies { get; set; } + /// + /// Gets or sets whether requests from Public Network are allowed. + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "publicNetworkAccess")] + public string PublicNetworkAccess { get; set; } + /// /// Gets or sets the IP filter rules. /// [JsonProperty(PropertyName = "ipFilterRules")] public IList IpFilterRules { get; set; } + /// + /// + [JsonProperty(PropertyName = "networkRuleSets")] + public NetworkRuleSetProperties NetworkRuleSets { get; set; } + + /// + /// Gets or sets specifies the minimum TLS version to support for this + /// hub. Can be set to "1.2" to have clients that use a TLS version + /// below 1.2 to be rejected. + /// + [JsonProperty(PropertyName = "minTlsVersion")] + public string MinTlsVersion { get; set; } + + /// + /// Gets or sets private endpoint connections created on this IotHub + /// + [JsonProperty(PropertyName = "privateEndpointConnections")] + public IList PrivateEndpointConnections { get; set; } + /// /// Gets the provisioning state. /// @@ -166,12 +201,6 @@ public IotHubProperties() [JsonProperty(PropertyName = "comments")] public string Comments { get; set; } - /// - /// Gets or sets the device streams properties of iothub. - /// - [JsonProperty(PropertyName = "deviceStreams")] - public IotHubPropertiesDeviceStreams DeviceStreams { get; set; } - /// /// Gets or sets the capabilities and features enabled for the IoT hub. /// Possible values include: 'None', 'DeviceManagement' @@ -213,6 +242,20 @@ public virtual void Validate() } } } + if (NetworkRuleSets != null) + { + NetworkRuleSets.Validate(); + } + if (PrivateEndpointConnections != null) + { + foreach (var element2 in PrivateEndpointConnections) + { + if (element2 != null) + { + element2.Validate(); + } + } + } if (Routing != null) { Routing.Validate(); diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleIPAction.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleIPAction.cs new file mode 100644 index 0000000000000..2edfdf6a270a9 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleIPAction.cs @@ -0,0 +1,21 @@ +// +// 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 +{ + + /// + /// Defines values for NetworkRuleIPAction. + /// + public static class NetworkRuleIPAction + { + public const string Allow = "Allow"; + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleSetIpRule.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleSetIpRule.cs new file mode 100644 index 0000000000000..2050551fe9816 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleSetIpRule.cs @@ -0,0 +1,88 @@ +// +// 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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// IP Rule to be applied as part of Network Rule Set + /// + public partial class NetworkRuleSetIpRule + { + /// + /// Initializes a new instance of the NetworkRuleSetIpRule class. + /// + public NetworkRuleSetIpRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkRuleSetIpRule class. + /// + /// Name of the IP filter rule. + /// A string that contains the IP address range in + /// CIDR notation for the rule. + /// IP Filter Action. Possible values include: + /// 'Allow' + public NetworkRuleSetIpRule(string filterName, string ipMask, string action = default(string)) + { + FilterName = filterName; + Action = action; + IpMask = ipMask; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the IP filter rule. + /// + [JsonProperty(PropertyName = "filterName")] + public string FilterName { get; set; } + + /// + /// Gets or sets IP Filter Action. Possible values include: 'Allow' + /// + [JsonProperty(PropertyName = "action")] + public string Action { get; set; } + + /// + /// Gets or sets a string that contains the IP address range in CIDR + /// notation for the rule. + /// + [JsonProperty(PropertyName = "ipMask")] + public string IpMask { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (FilterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "FilterName"); + } + if (IpMask == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IpMask"); + } + } + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleSetProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleSetProperties.cs new file mode 100644 index 0000000000000..1d473711e4dfa --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/NetworkRuleSetProperties.cs @@ -0,0 +1,98 @@ +// +// 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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Rule Set Properties of IotHub + /// + public partial class NetworkRuleSetProperties + { + /// + /// Initializes a new instance of the NetworkRuleSetProperties class. + /// + public NetworkRuleSetProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkRuleSetProperties class. + /// + /// If True, then Network + /// Rule Set is also applied to BuiltIn EventHub EndPoint of + /// IotHub + /// List of IP Rules + /// Default Action for Network Rule Set. + /// Possible values include: 'Deny', 'Allow' + public NetworkRuleSetProperties(bool applyToBuiltInEventHubEndpoint, IList ipRules, string defaultAction = default(string)) + { + DefaultAction = defaultAction; + ApplyToBuiltInEventHubEndpoint = applyToBuiltInEventHubEndpoint; + IpRules = ipRules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets default Action for Network Rule Set. Possible values + /// include: 'Deny', 'Allow' + /// + [JsonProperty(PropertyName = "defaultAction")] + public string DefaultAction { get; set; } + + /// + /// Gets or sets if True, then Network Rule Set is also applied to + /// BuiltIn EventHub EndPoint of IotHub + /// + [JsonProperty(PropertyName = "applyToBuiltInEventHubEndpoint")] + public bool ApplyToBuiltInEventHubEndpoint { get; set; } + + /// + /// Gets or sets list of IP Rules + /// + [JsonProperty(PropertyName = "ipRules")] + public IList IpRules { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IpRules == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IpRules"); + } + if (IpRules != null) + { + foreach (var element in IpRules) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpoint.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 0000000000000..31925eecab112 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.IotHub.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The private endpoint property of a private endpoint connection + /// + public partial class PrivateEndpoint + { + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + public PrivateEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpoint class. + /// + /// The resource identifier. + public PrivateEndpoint(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpointConnection.cs new file mode 100644 index 0000000000000..be46ac71b2f93 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpointConnection.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.IotHub.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The private endpoint connection of an IotHub + /// + public partial class PrivateEndpointConnection : IResource + { + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + public PrivateEndpointConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnection class. + /// + /// The resource identifier. + /// The resource name. + /// The resource type. + public PrivateEndpointConnection(PrivateEndpointConnectionProperties properties, string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public PrivateEndpointConnectionProperties Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + } + if (Name != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Name, "^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "Name", "^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$"); + } + } + if (Properties != null) + { + Properties.Validate(); + } + } + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpointConnectionProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpointConnectionProperties.cs new file mode 100644 index 0000000000000..35544f7366917 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,75 @@ +// +// 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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties of a private endpoint connection + /// + public partial class PrivateEndpointConnectionProperties + { + /// + /// Initializes a new instance of the + /// PrivateEndpointConnectionProperties class. + /// + public PrivateEndpointConnectionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PrivateEndpointConnectionProperties class. + /// + public PrivateEndpointConnectionProperties(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, PrivateEndpoint privateEndpoint = default(PrivateEndpoint)) + { + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "privateEndpoint")] + public PrivateEndpoint PrivateEndpoint { get; set; } + + /// + /// + [JsonProperty(PropertyName = "privateLinkServiceConnectionState")] + public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateLinkServiceConnectionState == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState"); + } + if (PrivateLinkServiceConnectionState != null) + { + PrivateLinkServiceConnectionState.Validate(); + } + } + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkResources.cs similarity index 55% rename from sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.cs rename to sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkResources.cs index 19f258e077c38..91ba3e59537d7 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/IotHubPropertiesDeviceStreams.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkResources.cs @@ -16,28 +16,26 @@ namespace Microsoft.Azure.Management.IotHub.Models using System.Linq; /// - /// The device streams properties of iothub. + /// The available private link resources for an IotHub /// - public partial class IotHubPropertiesDeviceStreams + public partial class PrivateLinkResources { /// - /// Initializes a new instance of the IotHubPropertiesDeviceStreams - /// class. + /// Initializes a new instance of the PrivateLinkResources class. /// - public IotHubPropertiesDeviceStreams() + public PrivateLinkResources() { CustomInit(); } /// - /// Initializes a new instance of the IotHubPropertiesDeviceStreams - /// class. + /// Initializes a new instance of the PrivateLinkResources class. /// - /// List of Device Streams - /// Endpoints. - public IotHubPropertiesDeviceStreams(IList streamingEndpoints = default(IList)) + /// The list of available private link resources + /// for an IotHub + public PrivateLinkResources(IList value = default(IList)) { - StreamingEndpoints = streamingEndpoints; + Value = value; CustomInit(); } @@ -47,10 +45,11 @@ public IotHubPropertiesDeviceStreams() partial void CustomInit(); /// - /// Gets or sets list of Device Streams Endpoints. + /// Gets or sets the list of available private link resources for an + /// IotHub /// - [JsonProperty(PropertyName = "streamingEndpoints")] - public IList StreamingEndpoints { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } } } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkServiceConnectionState.cs new file mode 100644 index 0000000000000..aa79980459699 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,93 @@ +// +// 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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The current state of a private endpoint connection + /// + public partial class PrivateLinkServiceConnectionState + { + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + public PrivateLinkServiceConnectionState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkServiceConnectionState + /// class. + /// + /// The status of a private endpoint connection. + /// Possible values include: 'Pending', 'Approved', 'Rejected', + /// 'Disconnected' + /// The description for the current state of + /// a private endpoint connection + /// Actions required for a private + /// endpoint connection + public PrivateLinkServiceConnectionState(string status, string description, string actionsRequired = default(string)) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the status of a private endpoint connection. Possible + /// values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the description for the current state of a private + /// endpoint connection + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets actions required for a private endpoint connection + /// + [JsonProperty(PropertyName = "actionsRequired")] + public string ActionsRequired { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + if (Description == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Description"); + } + } + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkServiceConnectionStatus.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkServiceConnectionStatus.cs new file mode 100644 index 0000000000000..e5a5b857a5e6f --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PrivateLinkServiceConnectionStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.IotHub.Models +{ + + /// + /// Defines values for PrivateLinkServiceConnectionStatus. + /// + public static class PrivateLinkServiceConnectionStatus + { + public const string Pending = "Pending"; + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + public const string Disconnected = "Disconnected"; + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PublicNetworkAccess.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 0000000000000..944b50bb89f8b --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/PublicNetworkAccess.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.IotHub.Models +{ + + /// + /// Defines values for PublicNetworkAccess. + /// + public static class PublicNetworkAccess + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RouteProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RouteProperties.cs index 5744aeca3274e..0bca2ab9baf46 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RouteProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RouteProperties.cs @@ -39,8 +39,7 @@ public RouteProperties() /// The source that the routing rule is to be /// applied to, such as DeviceMessages. Possible values include: /// 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - /// 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', - /// 'DigitalTwinChangeEvents' + /// 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents' /// The list of endpoints to which messages /// that satisfy the condition are routed. Currently only one endpoint /// is allowed. @@ -77,7 +76,7 @@ public RouteProperties() /// Gets or sets the source that the routing rule is to be applied to, /// such as DeviceMessages. Possible values include: 'Invalid', /// 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', - /// 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents' + /// 'DeviceJobLifecycleEvents' /// [JsonProperty(PropertyName = "source")] public string Source { get; set; } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingEventHubProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingEventHubProperties.cs index f6cd5537a17d6..f5c4b14f197a0 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingEventHubProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingEventHubProperties.cs @@ -30,20 +30,32 @@ public RoutingEventHubProperties() /// /// Initializes a new instance of the RoutingEventHubProperties class. /// - /// The connection string of the event - /// hub endpoint. /// The name that identifies this endpoint. The name /// can only include alphanumeric characters, periods, underscores, /// hyphens and has a maximum length of 64 characters. The following /// names are reserved: events, fileNotifications, $default. Endpoint /// names must be unique across endpoint types. + /// Id of the event hub endpoint + /// The connection string of the event + /// hub endpoint. + /// The url of the event hub endpoint. It + /// must include the protocol sb:// + /// Event hub name on the event hub + /// namespace + /// Method used to authenticate + /// against the event hub endpoint. Possible values include: + /// 'keyBased', 'identityBased' /// The subscription identifier of the /// event hub endpoint. /// The name of the resource group of the /// event hub endpoint. - public RoutingEventHubProperties(string connectionString, string name, string subscriptionId = default(string), string resourceGroup = default(string)) + public RoutingEventHubProperties(string name, string id = default(string), string connectionString = default(string), string endpointUri = default(string), string entityPath = default(string), string authenticationType = default(string), string subscriptionId = default(string), string resourceGroup = default(string)) { + Id = id; ConnectionString = connectionString; + EndpointUri = endpointUri; + EntityPath = entityPath; + AuthenticationType = authenticationType; Name = name; SubscriptionId = subscriptionId; ResourceGroup = resourceGroup; @@ -55,12 +67,38 @@ public RoutingEventHubProperties() /// partial void CustomInit(); + /// + /// Gets or sets id of the event hub endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + /// /// Gets or sets the connection string of the event hub endpoint. /// [JsonProperty(PropertyName = "connectionString")] public string ConnectionString { get; set; } + /// + /// Gets or sets the url of the event hub endpoint. It must include the + /// protocol sb:// + /// + [JsonProperty(PropertyName = "endpointUri")] + public string EndpointUri { get; set; } + + /// + /// Gets or sets event hub name on the event hub namespace + /// + [JsonProperty(PropertyName = "entityPath")] + public string EntityPath { get; set; } + + /// + /// Gets or sets method used to authenticate against the event hub + /// endpoint. Possible values include: 'keyBased', 'identityBased' + /// + [JsonProperty(PropertyName = "authenticationType")] + public string AuthenticationType { get; set; } + /// /// Gets or sets the name that identifies this endpoint. The name can /// only include alphanumeric characters, periods, underscores, hyphens @@ -92,10 +130,6 @@ public RoutingEventHubProperties() /// public virtual void Validate() { - if (ConnectionString == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionString"); - } if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingProperties.cs index 43333e1f90204..be3a8272ff3f7 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingProperties.cs @@ -44,7 +44,8 @@ public RoutingProperties() /// built-in eventhub endpoint. /// The list of user-provided enrichments /// that the IoT hub applies to messages to be delivered to built-in - /// and custom endpoints. See: https://aka.ms/iotmsgenrich + /// and custom endpoints. See: + /// https://aka.ms/telemetryoneventgrid public RoutingProperties(RoutingEndpoints endpoints = default(RoutingEndpoints), IList routes = default(IList), FallbackRouteProperties fallbackRoute = default(FallbackRouteProperties), IList enrichments = default(IList)) { Endpoints = endpoints; @@ -87,7 +88,7 @@ public RoutingProperties() /// /// Gets or sets the list of user-provided enrichments that the IoT hub /// applies to messages to be delivered to built-in and custom - /// endpoints. See: https://aka.ms/iotmsgenrich + /// endpoints. See: https://aka.ms/telemetryoneventgrid /// [JsonProperty(PropertyName = "enrichments")] public IList Enrichments { get; set; } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusQueueEndpointProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusQueueEndpointProperties.cs index 69a7c9b3527e3..66202dd4a90dc 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusQueueEndpointProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusQueueEndpointProperties.cs @@ -32,21 +32,33 @@ public RoutingServiceBusQueueEndpointProperties() /// Initializes a new instance of the /// RoutingServiceBusQueueEndpointProperties class. /// - /// The connection string of the service - /// bus queue endpoint. /// The name that identifies this endpoint. The name /// can only include alphanumeric characters, periods, underscores, /// hyphens and has a maximum length of 64 characters. The following /// names are reserved: events, fileNotifications, $default. Endpoint /// names must be unique across endpoint types. The name need not be /// the same as the actual queue name. + /// Id of the service bus queue endpoint + /// The connection string of the service + /// bus queue endpoint. + /// The url of the service bus queue + /// endpoint. It must include the protocol sb:// + /// Queue name on the service bus + /// namespace + /// Method used to authenticate + /// against the service bus queue endpoint. Possible values include: + /// 'keyBased', 'identityBased' /// The subscription identifier of the /// service bus queue endpoint. /// The name of the resource group of the /// service bus queue endpoint. - public RoutingServiceBusQueueEndpointProperties(string connectionString, string name, string subscriptionId = default(string), string resourceGroup = default(string)) + public RoutingServiceBusQueueEndpointProperties(string name, string id = default(string), string connectionString = default(string), string endpointUri = default(string), string entityPath = default(string), string authenticationType = default(string), string subscriptionId = default(string), string resourceGroup = default(string)) { + Id = id; ConnectionString = connectionString; + EndpointUri = endpointUri; + EntityPath = entityPath; + AuthenticationType = authenticationType; Name = name; SubscriptionId = subscriptionId; ResourceGroup = resourceGroup; @@ -58,6 +70,12 @@ public RoutingServiceBusQueueEndpointProperties() /// partial void CustomInit(); + /// + /// Gets or sets id of the service bus queue endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + /// /// Gets or sets the connection string of the service bus queue /// endpoint. @@ -65,6 +83,27 @@ public RoutingServiceBusQueueEndpointProperties() [JsonProperty(PropertyName = "connectionString")] public string ConnectionString { get; set; } + /// + /// Gets or sets the url of the service bus queue endpoint. It must + /// include the protocol sb:// + /// + [JsonProperty(PropertyName = "endpointUri")] + public string EndpointUri { get; set; } + + /// + /// Gets or sets queue name on the service bus namespace + /// + [JsonProperty(PropertyName = "entityPath")] + public string EntityPath { get; set; } + + /// + /// Gets or sets method used to authenticate against the service bus + /// queue endpoint. Possible values include: 'keyBased', + /// 'identityBased' + /// + [JsonProperty(PropertyName = "authenticationType")] + public string AuthenticationType { get; set; } + /// /// Gets or sets the name that identifies this endpoint. The name can /// only include alphanumeric characters, periods, underscores, hyphens @@ -98,10 +137,6 @@ public RoutingServiceBusQueueEndpointProperties() /// public virtual void Validate() { - if (ConnectionString == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionString"); - } if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusTopicEndpointProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusTopicEndpointProperties.cs index 05db867e03527..2c9627da6f751 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusTopicEndpointProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingServiceBusTopicEndpointProperties.cs @@ -32,21 +32,33 @@ public RoutingServiceBusTopicEndpointProperties() /// Initializes a new instance of the /// RoutingServiceBusTopicEndpointProperties class. /// - /// The connection string of the service - /// bus topic endpoint. /// The name that identifies this endpoint. The name /// can only include alphanumeric characters, periods, underscores, /// hyphens and has a maximum length of 64 characters. The following /// names are reserved: events, fileNotifications, $default. Endpoint /// names must be unique across endpoint types. The name need not be /// the same as the actual topic name. + /// Id of the service bus topic endpoint + /// The connection string of the service + /// bus topic endpoint. + /// The url of the service bus topic + /// endpoint. It must include the protocol sb:// + /// Queue name on the service bus + /// topic + /// Method used to authenticate + /// against the service bus topic endpoint. Possible values include: + /// 'keyBased', 'identityBased' /// The subscription identifier of the /// service bus topic endpoint. /// The name of the resource group of the /// service bus topic endpoint. - public RoutingServiceBusTopicEndpointProperties(string connectionString, string name, string subscriptionId = default(string), string resourceGroup = default(string)) + public RoutingServiceBusTopicEndpointProperties(string name, string id = default(string), string connectionString = default(string), string endpointUri = default(string), string entityPath = default(string), string authenticationType = default(string), string subscriptionId = default(string), string resourceGroup = default(string)) { + Id = id; ConnectionString = connectionString; + EndpointUri = endpointUri; + EntityPath = entityPath; + AuthenticationType = authenticationType; Name = name; SubscriptionId = subscriptionId; ResourceGroup = resourceGroup; @@ -58,6 +70,12 @@ public RoutingServiceBusTopicEndpointProperties() /// partial void CustomInit(); + /// + /// Gets or sets id of the service bus topic endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + /// /// Gets or sets the connection string of the service bus topic /// endpoint. @@ -65,6 +83,27 @@ public RoutingServiceBusTopicEndpointProperties() [JsonProperty(PropertyName = "connectionString")] public string ConnectionString { get; set; } + /// + /// Gets or sets the url of the service bus topic endpoint. It must + /// include the protocol sb:// + /// + [JsonProperty(PropertyName = "endpointUri")] + public string EndpointUri { get; set; } + + /// + /// Gets or sets queue name on the service bus topic + /// + [JsonProperty(PropertyName = "entityPath")] + public string EntityPath { get; set; } + + /// + /// Gets or sets method used to authenticate against the service bus + /// topic endpoint. Possible values include: 'keyBased', + /// 'identityBased' + /// + [JsonProperty(PropertyName = "authenticationType")] + public string AuthenticationType { get; set; } + /// /// Gets or sets the name that identifies this endpoint. The name can /// only include alphanumeric characters, periods, underscores, hyphens @@ -98,10 +137,6 @@ public RoutingServiceBusTopicEndpointProperties() /// public virtual void Validate() { - if (ConnectionString == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionString"); - } if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingSource.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingSource.cs index dd90eed51d44d..e1caf2ad9a7f4 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingSource.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingSource.cs @@ -21,6 +21,5 @@ public static class RoutingSource public const string TwinChangeEvents = "TwinChangeEvents"; public const string DeviceLifecycleEvents = "DeviceLifecycleEvents"; public const string DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents"; - public const string DigitalTwinChangeEvents = "DigitalTwinChangeEvents"; } } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingStorageContainerProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingStorageContainerProperties.cs index 58e6c19b3fdd2..31fb6a8c21d79 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingStorageContainerProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/RoutingStorageContainerProperties.cs @@ -32,8 +32,6 @@ public RoutingStorageContainerProperties() /// Initializes a new instance of the RoutingStorageContainerProperties /// class. /// - /// The connection string of the storage - /// account. /// The name that identifies this endpoint. The name /// can only include alphanumeric characters, periods, underscores, /// hyphens and has a maximum length of 64 characters. The following @@ -41,6 +39,14 @@ public RoutingStorageContainerProperties() /// names must be unique across endpoint types. /// The name of storage container in the /// storage account. + /// Id of the storage container endpoint + /// The connection string of the storage + /// account. + /// The url of the storage endpoint. It must + /// include the protocol https:// + /// Method used to authenticate + /// against the storage endpoint. Possible values include: 'keyBased', + /// 'identityBased' /// The subscription identifier of the /// storage account. /// The name of the resource group of the @@ -58,9 +64,12 @@ public RoutingStorageContainerProperties() /// to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. /// Default value is 'avro'. Possible values include: 'Avro', /// 'AvroDeflate', 'JSON' - public RoutingStorageContainerProperties(string connectionString, string name, string containerName, string subscriptionId = default(string), string resourceGroup = default(string), string fileNameFormat = default(string), int? batchFrequencyInSeconds = default(int?), int? maxChunkSizeInBytes = default(int?), string encoding = default(string)) + public RoutingStorageContainerProperties(string name, string containerName, string id = default(string), string connectionString = default(string), string endpointUri = default(string), string authenticationType = default(string), string subscriptionId = default(string), string resourceGroup = default(string), string fileNameFormat = default(string), int? batchFrequencyInSeconds = default(int?), int? maxChunkSizeInBytes = default(int?), string encoding = default(string)) { + Id = id; ConnectionString = connectionString; + EndpointUri = endpointUri; + AuthenticationType = authenticationType; Name = name; SubscriptionId = subscriptionId; ResourceGroup = resourceGroup; @@ -77,12 +86,32 @@ public RoutingStorageContainerProperties() /// partial void CustomInit(); + /// + /// Gets or sets id of the storage container endpoint + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + /// /// Gets or sets the connection string of the storage account. /// [JsonProperty(PropertyName = "connectionString")] public string ConnectionString { get; set; } + /// + /// Gets or sets the url of the storage endpoint. It must include the + /// protocol https:// + /// + [JsonProperty(PropertyName = "endpointUri")] + public string EndpointUri { get; set; } + + /// + /// Gets or sets method used to authenticate against the storage + /// endpoint. Possible values include: 'keyBased', 'identityBased' + /// + [JsonProperty(PropertyName = "authenticationType")] + public string AuthenticationType { get; set; } + /// /// Gets or sets the name that identifies this endpoint. The name can /// only include alphanumeric characters, periods, underscores, hyphens @@ -152,10 +181,6 @@ public RoutingStorageContainerProperties() /// public virtual void Validate() { - if (ConnectionString == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionString"); - } if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/StorageEndpointProperties.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/StorageEndpointProperties.cs index 9cc407931a64a..b7d2f3400fddc 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/StorageEndpointProperties.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/StorageEndpointProperties.cs @@ -38,11 +38,15 @@ public StorageEndpointProperties() /// The period of time for which the SAS /// URI generated by IoT Hub for file upload is valid. See: /// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. - public StorageEndpointProperties(string connectionString, string containerName, System.TimeSpan? sasTtlAsIso8601 = default(System.TimeSpan?)) + /// Specifies authentication type + /// being used for connecting to the storage account. Possible values + /// include: 'keyBased', 'identityBased' + public StorageEndpointProperties(string connectionString, string containerName, System.TimeSpan? sasTtlAsIso8601 = default(System.TimeSpan?), string authenticationType = default(string)) { SasTtlAsIso8601 = sasTtlAsIso8601; ConnectionString = connectionString; ContainerName = containerName; + AuthenticationType = authenticationType; CustomInit(); } @@ -74,6 +78,14 @@ public StorageEndpointProperties() [JsonProperty(PropertyName = "containerName")] public string ContainerName { get; set; } + /// + /// Gets or sets specifies authentication type being used for + /// connecting to the storage account. Possible values include: + /// 'keyBased', 'identityBased' + /// + [JsonProperty(PropertyName = "authenticationType")] + public string AuthenticationType { get; set; } + /// /// Validate the object. /// diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/TestAllRoutesInput.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/TestAllRoutesInput.cs index 67b3d0c42d074..84ad4754dafa0 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/TestAllRoutesInput.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/Models/TestAllRoutesInput.cs @@ -31,8 +31,7 @@ public TestAllRoutesInput() /// /// Routing source. Possible values /// include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - /// 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', - /// 'DigitalTwinChangeEvents' + /// 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents' /// Routing message /// Routing Twin Reference public TestAllRoutesInput(string routingSource = default(string), RoutingMessage message = default(RoutingMessage), RoutingTwin twin = default(RoutingTwin)) @@ -51,7 +50,7 @@ public TestAllRoutesInput() /// /// Gets or sets routing source. Possible values include: 'Invalid', /// 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', - /// 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents' + /// 'DeviceJobLifecycleEvents' /// [JsonProperty(PropertyName = "routingSource")] public string RoutingSource { get; set; } diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateEndpointConnectionsOperations.cs new file mode 100644 index 0000000000000..d225fa927dc2f --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -0,0 +1,970 @@ +// +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateEndpointConnectionsOperations operations. + /// + internal partial class PrivateEndpointConnectionsOperations : IServiceOperations, IPrivateEndpointConnectionsOperations + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateEndpointConnectionsOperations(IotHubClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the IotHubClient + /// + public IotHubClient Client { get; private set; } + + /// + /// List private endpoint connections + /// + /// + /// List private endpoint connection properties + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _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; + } + + /// + /// Get private endpoint connection + /// + /// + /// Get private endpoint connection properties + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// 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 resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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 ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _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; + } + + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + if (privateEndpointConnection == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnection"); + } + if (privateEndpointConnection != null) + { + privateEndpointConnection.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointConnection", privateEndpointConnection); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(privateEndpointConnection != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointConnection, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// 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> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _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/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs new file mode 100644 index 0000000000000..5b191e5d8aa6e --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -0,0 +1,345 @@ +// +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateEndpointConnectionsOperations. + /// + public static partial class PrivateEndpointConnectionsOperationsExtensions + { + /// + /// List private endpoint connections + /// + /// + /// List private endpoint connection properties + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + public static IList List(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// List private endpoint connections + /// + /// + /// List private endpoint connection properties + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get private endpoint connection + /// + /// + /// Get private endpoint connection properties + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + { + return operations.GetAsync(resourceGroupName, resourceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Get private endpoint connection + /// + /// + /// Get private endpoint connection properties + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + public static PrivateEndpointConnection Update(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection) + { + return operations.UpdateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection).GetAwaiter().GetResult(); + } + + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + public static PrivateEndpointConnection Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + { + return operations.DeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + public static PrivateEndpointConnection BeginUpdate(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection) + { + return operations.BeginUpdateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection).GetAwaiter().GetResult(); + } + + /// + /// Update private endpoint connection + /// + /// + /// Update the status of a private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The private endpoint connection with updated properties + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + public static PrivateEndpointConnection BeginDelete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + { + return operations.BeginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Delete private endpoint connection + /// + /// + /// Delete private endpoint connection with the specified name + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private endpoint connection + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateLinkResourcesOperations.cs new file mode 100644 index 0000000000000..222d4d1583ef7 --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateLinkResourcesOperations.cs @@ -0,0 +1,451 @@ +// +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PrivateLinkResourcesOperations operations. + /// + internal partial class PrivateLinkResourcesOperations : IServiceOperations, IPrivateLinkResourcesOperations + { + /// + /// Initializes a new instance of the PrivateLinkResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PrivateLinkResourcesOperations(IotHubClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the IotHubClient + /// + public IotHubClient Client { get; private set; } + + /// + /// List private link resources + /// + /// + /// List private link resources for the given IotHub + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _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; + } + + /// + /// Get the specified private link resource + /// + /// + /// Get the specified private link resource for the given IotHub + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private link 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (groupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("groupId", groupId); + 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.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId)); + 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 ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorDetails _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/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateLinkResourcesOperationsExtensions.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateLinkResourcesOperationsExtensions.cs new file mode 100644 index 0000000000000..366f151918bbf --- /dev/null +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -0,0 +1,123 @@ +// +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PrivateLinkResourcesOperations. + /// + public static partial class PrivateLinkResourcesOperationsExtensions + { + /// + /// List private link resources + /// + /// + /// List private link resources for the given IotHub + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + public static PrivateLinkResources List(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// List private link resources + /// + /// + /// List private link resources for the given IotHub + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the specified private link resource + /// + /// + /// Get the specified private link resource for the given IotHub + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private link resource + /// + public static GroupIdInformation Get(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName, string groupId) + { + return operations.GetAsync(resourceGroupName, resourceName, groupId).GetAwaiter().GetResult(); + } + + /// + /// Get the specified private link resource + /// + /// + /// Get the specified private link resource for the given IotHub + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the IoT hub. + /// + /// + /// The name of the IoT hub. + /// + /// + /// The name of the private link resource + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string resourceName, string groupId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, groupId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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 d7f57f93b58b3..4871c80aeb2ed 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,24 +19,15 @@ public static IEnumerable> ApiInfo_iotHubClient { return new Tuple[] { - new Tuple("Devices", "Certificates", "2019-07-01-preview"), - new Tuple("Devices", "IotHub", "2019-07-01-preview"), - new Tuple("Devices", "IotHubResource", "2019-07-01-preview"), - new Tuple("Devices", "Operations", "2019-07-01-preview"), - new Tuple("Devices", "ResourceProviderCommon", "2019-07-01-preview"), + new Tuple("Devices", "Certificates", "2020-08-31"), + new Tuple("Devices", "IotHub", "2020-08-31"), + new Tuple("Devices", "IotHubResource", "2020-08-31"), + new Tuple("Devices", "Operations", "2020-08-31"), + new Tuple("Devices", "PrivateEndpointConnections", "2020-08-31"), + new Tuple("Devices", "PrivateLinkResources", "2020-08-31"), + new Tuple("Devices", "ResourceProviderCommon", "2020-08-31"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/iothub/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "a942bf5703a34a66ca0fb7190bdb6e0c0875e12a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -