diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs
index 350b8bee2a8bd..eb8ffe1330ece 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperations.cs
@@ -503,7 +503,7 @@ internal DpsCertificateOperations(IotDpsClient client)
/// Delete the Provisioning Service Certificate.
///
///
- /// Deletes the specified certificate assosciated with the Provisioning Service
+ /// Deletes the specified certificate associated with the Provisioning Service
///
///
/// Resource group identifier.
@@ -763,6 +763,197 @@ internal DpsCertificateOperations(IotDpsClient client)
return _result;
}
+ ///
+ /// Get all the certificates tied to the provisioning service.
+ ///
+ ///
+ /// Name of resource group.
+ ///
+ ///
+ /// Name of provisioning service to retrieve certificates for.
+ ///
+ ///
+ /// 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 provisioningServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (provisioningServiceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("provisioningServiceName", provisioningServiceName);
+ 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/provisioningServices/{provisioningServiceName}/certificates").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+ 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;
+ }
+
///
/// Generate verification code for Proof of Possession.
///
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs
index 9f2d1cfa4b8b8..9808c4d144a14 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/DpsCertificateOperationsExtensions.cs
@@ -143,7 +143,7 @@ public static partial class DpsCertificateOperationsExtensions
/// Delete the Provisioning Service Certificate.
///
///
- /// Deletes the specified certificate assosciated with the Provisioning Service
+ /// Deletes the specified certificate associated with the Provisioning Service
///
///
/// The operations group for this extension method.
@@ -195,7 +195,7 @@ public static partial class DpsCertificateOperationsExtensions
/// Delete the Provisioning Service Certificate.
///
///
- /// Deletes the specified certificate assosciated with the Provisioning Service
+ /// Deletes the specified certificate associated with the Provisioning Service
///
///
/// The operations group for this extension method.
@@ -246,6 +246,46 @@ public static partial class DpsCertificateOperationsExtensions
(await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ifMatch, provisioningServiceName, certificateName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
+ ///
+ /// Get all the certificates tied to the provisioning service.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of resource group.
+ ///
+ ///
+ /// Name of provisioning service to retrieve certificates for.
+ ///
+ public static CertificateListDescription List(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName)
+ {
+ return operations.ListAsync(resourceGroupName, provisioningServiceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get all the certificates tied to the provisioning service.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of resource group.
+ ///
+ ///
+ /// Name of provisioning service to retrieve certificates for.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListAsync(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Generate verification code for Proof of Possession.
///
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs
index 1fa168aa18532..9a46d3ad6377d 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IDpsCertificateOperations.cs
@@ -97,7 +97,7 @@ public partial interface IDpsCertificateOperations
/// Delete the Provisioning Service Certificate.
///
///
- /// Deletes the specified certificate assosciated with the Provisioning
+ /// Deletes the specified certificate associated with the Provisioning
/// Service
///
///
@@ -154,6 +154,31 @@ public partial interface IDpsCertificateOperations
///
Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ifMatch, string provisioningServiceName, string certificateName, string certificatename = default(string), byte[] certificaterawBytes = default(byte[]), bool? certificateisVerified = default(bool?), string certificatepurpose = default(string), System.DateTime? certificatecreated = default(System.DateTime?), System.DateTime? certificatelastUpdated = default(System.DateTime?), bool? certificatehasPrivateKey = default(bool?), string certificatenonce = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Get all the certificates tied to the provisioning service.
+ ///
+ ///
+ /// Name of resource group.
+ ///
+ ///
+ /// Name of provisioning service to retrieve certificates for.
+ ///
+ ///
+ /// 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 provisioningServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Generate verification code for Proof of Possession.
///
///
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsClient.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsClient.cs
index 90bb04df9dd47..c8d8617c8462b 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsClient.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsClient.cs
@@ -51,19 +51,20 @@ public partial interface IIotDpsClient : System.IDisposable
string ApiVersion { get; }
///
- /// Gets or sets the preferred language for the response.
+ /// The preferred language for the response.
///
string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running
- /// Operations. Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default
+ /// value is 30.
///
int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is generated
- /// and included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When
+ /// set to true a unique x-ms-client-request-id value is generated and
+ /// included in each request. Default is true.
///
bool? GenerateClientRequestId { get; set; }
@@ -83,10 +84,5 @@ public partial interface IIotDpsClient : System.IDisposable
///
IIotDpsResourceOperations IotDpsResource { get; }
- ///
- /// Gets the IDpsCertificatesOperations.
- ///
- IDpsCertificatesOperations DpsCertificates { get; }
-
}
}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsResourceOperations.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsResourceOperations.cs
index 38dd659835f4d..0ace16fc4d1aa 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsResourceOperations.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IIotDpsResourceOperations.cs
@@ -340,6 +340,197 @@ public partial interface IIotDpsResourceOperations
///
Task> ListKeysForKeyNameWithHttpMessagesAsync(string provisioningServiceName, string keyName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// List private link resources
+ ///
+ ///
+ /// List private link resources for the given provisioning service
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> ListPrivateLinkResourcesWithHttpMessagesAsync(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 provisioning
+ /// service
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> GetPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string resourceName, string groupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// List private endpoint connections
+ ///
+ ///
+ /// List private endpoint connection properties
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(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 provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> GetPrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or update the status of a private endpoint connection with
+ /// the specified name
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> CreateOrUpdatePrivateEndpointConnectionWithHttpMessagesAsync(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 provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Create or update the metadata of the provisioning service.
///
///
@@ -433,6 +624,74 @@ public partial interface IIotDpsResourceOperations
///
Task BeginDeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or update the status of a private endpoint connection with
+ /// the specified name
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> BeginCreateOrUpdatePrivateEndpointConnectionWithHttpMessagesAsync(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 provisioning
+ /// service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Get all the provisioning services in a subscription.
///
///
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsClient.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsClient.cs
index 1077c59836faa..0197ce54e8f76 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsClient.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsClient.cs
@@ -57,19 +57,20 @@ public partial class IotDpsClient : ServiceClient, IIotDpsClient,
public string ApiVersion { get; private set; }
///
- /// Gets or sets the preferred language for the response.
+ /// The preferred language for the response.
///
public string AcceptLanguage { get; set; }
///
- /// Gets or sets the retry timeout in seconds for Long Running Operations.
- /// Default value is 30.
+ /// The retry timeout in seconds for Long Running Operations. Default value is
+ /// 30.
///
public int? LongRunningOperationRetryTimeout { get; set; }
///
- /// When set to true a unique x-ms-client-request-id value is generated and
- /// included in each request. Default is true.
+ /// Whether a unique x-ms-client-request-id should be generated. When set to
+ /// true a unique x-ms-client-request-id value is generated and included in
+ /// each request. Default is true.
///
public bool? GenerateClientRequestId { get; set; }
@@ -89,9 +90,17 @@ public partial class IotDpsClient : ServiceClient, IIotDpsClient,
public virtual IIotDpsResourceOperations IotDpsResource { get; private set; }
///
- /// Gets the IDpsCertificatesOperations.
+ /// Initializes a new instance of the IotDpsClient class.
///
- public virtual IDpsCertificatesOperations DpsCertificates { get; private set; }
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling IotDpsClient.Dispose(). False: will not dispose provided httpClient
+ protected IotDpsClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
///
/// Initializes a new instance of the IotDpsClient class.
@@ -188,6 +197,33 @@ public IotDpsClient(ServiceClientCredentials credentials, params DelegatingHandl
}
}
+ ///
+ /// Initializes a new instance of the IotDpsClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling IotDpsClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public IotDpsClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
///
/// Initializes a new instance of the IotDpsClient class.
///
@@ -297,9 +333,8 @@ private void Initialize()
Operations = new Operations(this);
DpsCertificate = new DpsCertificateOperations(this);
IotDpsResource = new IotDpsResourceOperations(this);
- DpsCertificates = new DpsCertificatesOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2017-11-15";
+ ApiVersion = "2020-09-01-preview";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperations.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperations.cs
index 48a881ae3c80c..93f51256b138b 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperations.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperations.cs
@@ -1690,22 +1690,16 @@ internal IotDpsResourceOperations(IotDpsClient client)
}
///
- /// Create or update the metadata of the provisioning service.
+ /// List private link resources
///
///
- /// Create or update the metadata of the provisioning service. The usual
- /// pattern to modify a property is to retrieve the provisioning service
- /// metadata and security metadata, and then combine them with the modified
- /// values in a new body to update the provisioning service.
+ /// List private link resources for the given provisioning service
///
///
- /// Resource group identifier.
- ///
- ///
- /// Name of provisioning service to create or update.
+ /// The name of the resource group that contains the provisioning service.
///
- ///
- /// Description of the provisioning service to create or update.
+ ///
+ /// The name of the provisioning service.
///
///
/// Headers that will be added to request.
@@ -1728,8 +1722,12 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> ListPrivateLinkResourcesWithHttpMessagesAsync(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");
@@ -1738,21 +1736,9 @@ internal IotDpsResourceOperations(IotDpsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (provisioningServiceName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
- }
- if (iotDpsDescription == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "iotDpsDescription");
- }
- if (iotDpsDescription != null)
- {
- iotDpsDescription.Validate();
- }
- if (Client.ApiVersion == null)
+ if (resourceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1762,17 +1748,16 @@ internal IotDpsResourceOperations(IotDpsClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("provisioningServiceName", provisioningServiceName);
- tracingParameters.Add("iotDpsDescription", iotDpsDescription);
+ tracingParameters.Add("resourceName", resourceName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListPrivateLinkResources", 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/provisioningServices/{provisioningServiceName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
List _queryParameters = new List();
if (Client.ApiVersion != null)
{
@@ -1785,7 +1770,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1816,12 +1801,6 @@ internal IotDpsResourceOperations(IotDpsClient client)
// Serialize Request
string _requestContent = null;
- if(iotDpsDescription != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(iotDpsDescription, 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)
{
@@ -1842,7 +1821,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1872,7 +1851,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1885,25 +1864,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
_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);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1923,20 +1884,19 @@ internal IotDpsResourceOperations(IotDpsClient client)
}
///
- /// Update an existing provisioning service's tags.
+ /// Get the specified private link resource
///
///
- /// Update an existing provisioning service's tags. to update other fields use
- /// the CreateOrUpdate method
+ /// Get the specified private link resource for the given provisioning service
///
///
- /// Resource group identifier.
+ /// The name of the resource group that contains the provisioning service.
///
- ///
- /// Name of provisioning service to create or update.
+ ///
+ /// The name of the provisioning service.
///
- ///
- /// Updated tag information to set into the provisioning service instance.
+ ///
+ /// The name of the private link resource
///
///
/// Headers that will be added to request.
@@ -1944,7 +1904,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1959,8 +1919,12 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, TagsResource provisioningServiceTags, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetPrivateLinkResourcesWithHttpMessagesAsync(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");
@@ -1969,17 +1933,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (provisioningServiceName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
- }
- if (provisioningServiceTags == null)
+ if (resourceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceTags");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
}
- if (Client.ApiVersion == null)
+ if (groupId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "groupId");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1989,17 +1949,18 @@ internal IotDpsResourceOperations(IotDpsClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
- tracingParameters.Add("provisioningServiceName", provisioningServiceName);
- tracingParameters.Add("provisioningServiceTags", provisioningServiceTags);
+ tracingParameters.Add("resourceName", resourceName);
+ tracingParameters.Add("groupId", groupId);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResources", 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/provisioningServices/{provisioningServiceName}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{resourceName}/privateLinkResources/{groupId}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _url = _url.Replace("{groupId}", System.Uri.EscapeDataString(groupId));
List _queryParameters = new List();
if (Client.ApiVersion != null)
{
@@ -2012,7 +1973,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -2043,12 +2004,6 @@ internal IotDpsResourceOperations(IotDpsClient client)
// Serialize Request
string _requestContent = null;
- if(provisioningServiceTags != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(provisioningServiceTags, 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)
{
@@ -2071,14 +2026,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ ErrorDetails _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -2088,10 +2042,6 @@ internal IotDpsResourceOperations(IotDpsClient client)
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
- if (_httpResponse.Headers.Contains("x-ms-request-id"))
- {
- ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
- }
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -2104,7 +2054,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -2117,7 +2067,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -2137,16 +2087,16 @@ internal IotDpsResourceOperations(IotDpsClient client)
}
///
- /// Delete the Provisioning Service
+ /// List private endpoint connections
///
///
- /// Deletes the Provisioning Service.
+ /// List private endpoint connection properties
///
- ///
- /// Name of provisioning service to delete.
- ///
///
- /// Resource group identifier.
+ /// The name of the resource group that contains the provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
///
///
/// Headers that will be added to request.
@@ -2157,6 +2107,9 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// Thrown when the operation returned an invalid status code
///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// Thrown when a required parameter is null
///
@@ -2166,11 +2119,11 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginDeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListPrivateEndpointConnectionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (provisioningServiceName == null)
+ if (Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
if (Client.SubscriptionId == null)
{
@@ -2180,9 +2133,9 @@ internal IotDpsResourceOperations(IotDpsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+ if (resourceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -2191,17 +2144,17 @@ internal IotDpsResourceOperations(IotDpsClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("resourceName", resourceName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListPrivateEndpointConnections", 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/provisioningServices/{provisioningServiceName}").ToString();
- _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{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)
{
@@ -2214,7 +2167,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -2265,7 +2218,7 @@ internal IotDpsResourceOperations(IotDpsClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 404)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorDetailsException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -2295,13 +2248,1375 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ 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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> GetPrivateEndpointConnectionWithHttpMessagesAsync(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, "GetPrivateEndpointConnection", 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/provisioningServices/{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;
+ }
+
+ ///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or update the status of a private endpoint connection with the
+ /// specified name
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> CreateOrUpdatePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateOrUpdatePrivateEndpointConnectionWithHttpMessagesAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> DeletePrivateEndpointConnectionWithHttpMessagesAsync(string resourceGroupName, string resourceName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Create or update the metadata of the provisioning service.
+ ///
+ ///
+ /// Create or update the metadata of the provisioning service. The usual
+ /// pattern to modify a property is to retrieve the provisioning service
+ /// metadata and security metadata, and then combine them with the modified
+ /// values in a new body to update the provisioning service.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// Name of provisioning service to create or update.
+ ///
+ ///
+ /// Description of the provisioning service to create or update.
+ ///
+ ///
+ /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (provisioningServiceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ }
+ if (iotDpsDescription == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "iotDpsDescription");
+ }
+ if (iotDpsDescription != null)
+ {
+ iotDpsDescription.Validate();
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("provisioningServiceName", provisioningServiceName);
+ tracingParameters.Add("iotDpsDescription", iotDpsDescription);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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/provisioningServices/{provisioningServiceName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+ 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(iotDpsDescription != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(iotDpsDescription, 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;
+ }
+
+ ///
+ /// Update an existing provisioning service's tags.
+ ///
+ ///
+ /// Update an existing provisioning service's tags. to update other fields use
+ /// the CreateOrUpdate method
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// Name of provisioning service to create or update.
+ ///
+ ///
+ /// Updated tag information to set into the provisioning service instance.
+ ///
+ ///
+ /// 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 provisioningServiceName, TagsResource provisioningServiceTags, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (provisioningServiceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ }
+ if (provisioningServiceTags == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceTags");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("provisioningServiceName", provisioningServiceName);
+ tracingParameters.Add("provisioningServiceTags", provisioningServiceTags);
+ 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/provisioningServices/{provisioningServiceName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+ 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("PATCH");
+ _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(provisioningServiceTags != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(provisioningServiceTags, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ 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;
+ }
+
+ ///
+ /// Delete the Provisioning Service
+ ///
+ ///
+ /// Deletes the Provisioning Service.
+ ///
+ ///
+ /// Name of provisioning service to delete.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task BeginDeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (provisioningServiceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("provisioningServiceName", provisioningServiceName);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ 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/provisioningServices/{provisioningServiceName}").ToString();
+ _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ 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 && (int)_statusCode != 404)
+ {
+ 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();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or update the status of a private endpoint connection with the
+ /// specified name
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> BeginCreateOrUpdatePrivateEndpointConnectionWithHttpMessagesAsync(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, "BeginCreateOrUpdatePrivateEndpointConnection", 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/provisioningServices/{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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// 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> BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(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, "BeginDeletePrivateEndpointConnection", 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/provisioningServices/{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);
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperationsExtensions.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperationsExtensions.cs
index 76ff87ac24166..c8b15a15f33ac 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperationsExtensions.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/IotDpsResourceOperationsExtensions.cs
@@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.DeviceProvisioningServices
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
+ using System.Collections;
+ using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -536,6 +538,314 @@ public static SharedAccessSignatureAuthorizationRuleAccessRightsDescription List
}
}
+ ///
+ /// List private link resources
+ ///
+ ///
+ /// List private link resources for the given provisioning service
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ public static PrivateLinkResources ListPrivateLinkResources(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName)
+ {
+ return operations.ListPrivateLinkResourcesAsync(resourceGroupName, resourceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List private link resources
+ ///
+ ///
+ /// List private link resources for the given provisioning service
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListPrivateLinkResourcesAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get the specified private link resource
+ ///
+ ///
+ /// Get the specified private link resource for the given provisioning service
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private link resource
+ ///
+ public static GroupIdInformation GetPrivateLinkResources(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string groupId)
+ {
+ return operations.GetPrivateLinkResourcesAsync(resourceGroupName, resourceName, groupId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get the specified private link resource
+ ///
+ ///
+ /// Get the specified private link resource for the given provisioning service
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group that contains the provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private link resource
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetPrivateLinkResourcesAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string groupId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, resourceName, groupId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// 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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ public static IList ListPrivateEndpointConnections(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName)
+ {
+ return operations.ListPrivateEndpointConnectionsAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListPrivateEndpointConnectionsAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListPrivateEndpointConnectionsWithHttpMessagesAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ public static PrivateEndpointConnection GetPrivateEndpointConnection(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName)
+ {
+ return operations.GetPrivateEndpointConnectionAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetPrivateEndpointConnectionAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetPrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or 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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The private endpoint connection with updated properties
+ ///
+ public static PrivateEndpointConnection CreateOrUpdatePrivateEndpointConnection(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection)
+ {
+ return operations.CreateOrUpdatePrivateEndpointConnectionAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or 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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The private endpoint connection with updated properties
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdatePrivateEndpointConnectionAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdatePrivateEndpointConnectionWithHttpMessagesAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ public static PrivateEndpointConnection DeletePrivateEndpointConnection(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName)
+ {
+ return operations.DeletePrivateEndpointConnectionAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeletePrivateEndpointConnectionAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.DeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Create or update the metadata of the provisioning service.
///
@@ -691,6 +1001,118 @@ public static void BeginDelete(this IIotDpsResourceOperations operations, string
(await operations.BeginDeleteWithHttpMessagesAsync(provisioningServiceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
+ ///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or 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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The private endpoint connection with updated properties
+ ///
+ public static PrivateEndpointConnection BeginCreateOrUpdatePrivateEndpointConnection(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection)
+ {
+ return operations.BeginCreateOrUpdatePrivateEndpointConnectionAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or update private endpoint connection
+ ///
+ ///
+ /// Create or 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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The private endpoint connection with updated properties
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginCreateOrUpdatePrivateEndpointConnectionAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginCreateOrUpdatePrivateEndpointConnectionWithHttpMessagesAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ public static PrivateEndpointConnection BeginDeletePrivateEndpointConnection(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName)
+ {
+ return operations.BeginDeletePrivateEndpointConnectionAsync(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 provisioning service.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the private endpoint connection
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginDeletePrivateEndpointConnectionAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginDeletePrivateEndpointConnectionWithHttpMessagesAsync(resourceGroupName, resourceName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Get all the provisioning services in a subscription.
///
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/EncryptionPropertiesDescription.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/EncryptionPropertiesDescription.cs
new file mode 100644
index 0000000000000..8e9eaa551f513
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/EncryptionPropertiesDescription.cs
@@ -0,0 +1,64 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.DeviceProvisioningServices.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The encryption properties for the IoT DPS instance.
+ ///
+ public partial class EncryptionPropertiesDescription
+ {
+ ///
+ /// Initializes a new instance of the EncryptionPropertiesDescription
+ /// class.
+ ///
+ public EncryptionPropertiesDescription()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the EncryptionPropertiesDescription
+ /// class.
+ ///
+ /// The source of the key.
+ /// The properties of the KeyVault
+ /// key.
+ public EncryptionPropertiesDescription(string keySource = default(string), IList keyVaultProperties = default(IList))
+ {
+ KeySource = keySource;
+ KeyVaultProperties = keyVaultProperties;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the source of the key.
+ ///
+ [JsonProperty(PropertyName = "keySource")]
+ public string KeySource { get; set; }
+
+ ///
+ /// Gets or sets the properties of the KeyVault key.
+ ///
+ [JsonProperty(PropertyName = "keyVaultProperties")]
+ public IList KeyVaultProperties { get; set; }
+
+ }
+}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/ErrorDetails.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/ErrorDetails.cs
index 80bf511666df1..0568f50d8561a 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/ErrorDetails.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/ErrorDetails.cs
@@ -50,25 +50,25 @@ public ErrorDetails()
///
/// Gets the error code.
///
- [JsonProperty(PropertyName = "Code")]
+ [JsonProperty(PropertyName = "code")]
public string Code { get; private set; }
///
/// Gets the HTTP status code.
///
- [JsonProperty(PropertyName = "HttpStatusCode")]
+ [JsonProperty(PropertyName = "httpStatusCode")]
public string HttpStatusCode { get; private set; }
///
/// Gets the error message.
///
- [JsonProperty(PropertyName = "Message")]
+ [JsonProperty(PropertyName = "message")]
public string Message { get; private set; }
///
/// Gets the error details.
///
- [JsonProperty(PropertyName = "Details")]
+ [JsonProperty(PropertyName = "details")]
public string Details { get; private set; }
}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/GroupIdInformation.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/GroupIdInformation.cs
new file mode 100644
index 0000000000000..a307ec934dd37
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/GroupIdInformation.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.DeviceProvisioningServices.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The group information for creating a private endpoint on a provisioning
+ /// service
+ ///
+ public partial class GroupIdInformation
+ {
+ ///
+ /// Initializes a new instance of the GroupIdInformation class.
+ ///
+ public GroupIdInformation()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the GroupIdInformation class.
+ ///
+ /// The properties for a group information
+ /// object
+ /// 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; }
+
+ ///
+ /// Gets or sets the properties for a group information object
+ ///
+ [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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/GroupIdInformationProperties.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/GroupIdInformationProperties.cs
new file mode 100644
index 0000000000000..3888de1065be5
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/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.DeviceProvisioningServices.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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsPropertiesDescription.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsPropertiesDescription.cs
index dee983613f06c..7ab8fb5757874 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsPropertiesDescription.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsPropertiesDescription.cs
@@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.DeviceProvisioningServices.Models
using System.Linq;
///
- /// the service specific properties of a provisoning service, including
+ /// the service specific properties of a provisioning service, including
/// keys, linked iot hubs, current state, and system generated properties
/// such as hostname and idScope
///
@@ -40,9 +40,17 @@ public IotDpsPropertiesDescription()
/// 'Deleted', 'ActivationFailed', 'DeletionFailed', 'Transitioning',
/// 'Suspending', 'Suspended', 'Resuming', 'FailingOver',
/// 'FailoverFailed'
+ /// The encryption properties for the IoT DPS
+ /// instance.
+ /// Whether requests from Public
+ /// Network are allowed. Possible values include: 'Enabled',
+ /// 'Disabled'
+ /// The IP filter rules.
+ /// Private endpoint
+ /// connections created on this IotHub
/// The ARM provisioning state of the
/// provisioning service.
- /// List of IoT hubs assosciated with this
+ /// List of IoT hubs associated with this
/// provisioning service.
/// Allocation policy to be used by this
/// provisioning service. Possible values include: 'Hashed',
@@ -55,9 +63,13 @@ public IotDpsPropertiesDescription()
/// service.
/// List of authorization keys for
/// a provisioning service.
- public IotDpsPropertiesDescription(string state = default(string), string provisioningState = default(string), IList iotHubs = default(IList), string allocationPolicy = default(string), string serviceOperationsHostName = default(string), string deviceProvisioningHostName = default(string), string idScope = default(string), IList authorizationPolicies = default(IList))
+ public IotDpsPropertiesDescription(string state = default(string), EncryptionPropertiesDescription encryption = default(EncryptionPropertiesDescription), string publicNetworkAccess = default(string), IList ipFilterRules = default(IList), IList privateEndpointConnections = default(IList), string provisioningState = default(string), IList iotHubs = default(IList), string allocationPolicy = default(string), string serviceOperationsHostName = default(string), string deviceProvisioningHostName = default(string), string idScope = default(string), IList authorizationPolicies = default(IList))
{
State = state;
+ Encryption = encryption;
+ PublicNetworkAccess = publicNetworkAccess;
+ IpFilterRules = ipFilterRules;
+ PrivateEndpointConnections = privateEndpointConnections;
ProvisioningState = provisioningState;
IotHubs = iotHubs;
AllocationPolicy = allocationPolicy;
@@ -83,6 +95,31 @@ public IotDpsPropertiesDescription()
[JsonProperty(PropertyName = "state")]
public string State { get; set; }
+ ///
+ /// Gets or sets the encryption properties for the IoT DPS instance.
+ ///
+ [JsonProperty(PropertyName = "encryption")]
+ public EncryptionPropertiesDescription Encryption { 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; }
+
+ ///
+ /// Gets or sets private endpoint connections created on this IotHub
+ ///
+ [JsonProperty(PropertyName = "privateEndpointConnections")]
+ public IList PrivateEndpointConnections { get; set; }
+
///
/// Gets or sets the ARM provisioning state of the provisioning
/// service.
@@ -91,7 +128,7 @@ public IotDpsPropertiesDescription()
public string ProvisioningState { get; set; }
///
- /// Gets or sets list of IoT hubs assosciated with this provisioning
+ /// Gets or sets list of IoT hubs associated with this provisioning
/// service.
///
[JsonProperty(PropertyName = "iotHubs")]
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinition.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinition.cs
index 9cd9ba2244d47..299b122eaf11e 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinition.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuDefinition.cs
@@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.DeviceProvisioningServices.Models
using System.Linq;
///
- /// Available Sku's of tier and units.
+ /// Available SKUs of tier and units.
///
public partial class IotDpsSkuDefinition
{
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuInfo.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuInfo.cs
index 6b0738f5cda6f..2298cbd19cd59 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuInfo.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotDpsSkuInfo.cs
@@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.DeviceProvisioningServices.Models
using System.Linq;
///
- /// List of possible provisoning service SKUs.
+ /// List of possible provisioning service SKUs.
///
public partial class IotDpsSkuInfo
{
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs
index 087abaae8f2d8..28494e0de6af2 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IotHubDefinitionDescription.cs
@@ -32,7 +32,7 @@ public IotHubDefinitionDescription()
/// Initializes a new instance of the IotHubDefinitionDescription
/// class.
///
- /// Connection string og the IoT
+ /// Connection string of the IoT
/// hub.
/// ARM region of the IoT hub.
/// flag for applying
@@ -75,7 +75,7 @@ public IotHubDefinitionDescription()
public string Name { get; private set; }
///
- /// Gets or sets connection string og the IoT hub.
+ /// Gets or sets connection string of the IoT hub.
///
[JsonProperty(PropertyName = "connectionString")]
public string ConnectionString { get; set; }
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterActionType.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterActionType.cs
new file mode 100644
index 0000000000000..0f5c4363b261c
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterActionType.cs
@@ -0,0 +1,60 @@
+//
+// 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.DeviceProvisioningServices.Models
+{
+ using Newtonsoft.Json;
+ using Newtonsoft.Json.Converters;
+ using System.Runtime;
+ using System.Runtime.Serialization;
+
+ ///
+ /// Defines values for IpFilterActionType.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum IpFilterActionType
+ {
+ [EnumMember(Value = "Accept")]
+ Accept,
+ [EnumMember(Value = "Reject")]
+ Reject
+ }
+ internal static class IpFilterActionTypeEnumExtension
+ {
+ internal static string ToSerializedValue(this IpFilterActionType? value)
+ {
+ return value == null ? null : ((IpFilterActionType)value).ToSerializedValue();
+ }
+
+ internal static string ToSerializedValue(this IpFilterActionType value)
+ {
+ switch( value )
+ {
+ case IpFilterActionType.Accept:
+ return "Accept";
+ case IpFilterActionType.Reject:
+ return "Reject";
+ }
+ return null;
+ }
+
+ internal static IpFilterActionType? ParseIpFilterActionType(this string value)
+ {
+ switch( value )
+ {
+ case "Accept":
+ return IpFilterActionType.Accept;
+ case "Reject":
+ return IpFilterActionType.Reject;
+ }
+ return null;
+ }
+ }
+}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterRule.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterRule.cs
new file mode 100644
index 0000000000000..b0d1490de7a76
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterRule.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.DeviceProvisioningServices.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The IP filter rules for a provisioning Service.
+ ///
+ public partial class IpFilterRule
+ {
+ ///
+ /// Initializes a new instance of the IpFilterRule class.
+ ///
+ public IpFilterRule()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the IpFilterRule class.
+ ///
+ /// The name of the IP filter rule.
+ /// The desired action for requests captured by
+ /// this rule. Possible values include: 'Accept', 'Reject'
+ /// A string that contains the IP address range in
+ /// CIDR notation for the rule.
+ /// Target for requests captured by this rule.
+ /// Possible values include: 'all', 'serviceApi', 'deviceApi'
+ public IpFilterRule(string filterName, IpFilterActionType action, string ipMask, IpFilterTargetType? target = default(IpFilterTargetType?))
+ {
+ FilterName = filterName;
+ Action = action;
+ IpMask = ipMask;
+ Target = target;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the IP filter rule.
+ ///
+ [JsonProperty(PropertyName = "filterName")]
+ public string FilterName { get; set; }
+
+ ///
+ /// Gets or sets the desired action for requests captured by this rule.
+ /// Possible values include: 'Accept', 'Reject'
+ ///
+ [JsonProperty(PropertyName = "action")]
+ public IpFilterActionType 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; }
+
+ ///
+ /// Gets or sets target for requests captured by this rule. Possible
+ /// values include: 'all', 'serviceApi', 'deviceApi'
+ ///
+ [JsonProperty(PropertyName = "target")]
+ public IpFilterTargetType? Target { 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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterTargetType.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterTargetType.cs
new file mode 100644
index 0000000000000..83c1487d8f58f
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/IpFilterTargetType.cs
@@ -0,0 +1,66 @@
+//
+// 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.DeviceProvisioningServices.Models
+{
+ using Newtonsoft.Json;
+ using Newtonsoft.Json.Converters;
+ using System.Runtime;
+ using System.Runtime.Serialization;
+
+ ///
+ /// Defines values for IpFilterTargetType.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum IpFilterTargetType
+ {
+ [EnumMember(Value = "all")]
+ All,
+ [EnumMember(Value = "serviceApi")]
+ ServiceApi,
+ [EnumMember(Value = "deviceApi")]
+ DeviceApi
+ }
+ internal static class IpFilterTargetTypeEnumExtension
+ {
+ internal static string ToSerializedValue(this IpFilterTargetType? value)
+ {
+ return value == null ? null : ((IpFilterTargetType)value).ToSerializedValue();
+ }
+
+ internal static string ToSerializedValue(this IpFilterTargetType value)
+ {
+ switch( value )
+ {
+ case IpFilterTargetType.All:
+ return "all";
+ case IpFilterTargetType.ServiceApi:
+ return "serviceApi";
+ case IpFilterTargetType.DeviceApi:
+ return "deviceApi";
+ }
+ return null;
+ }
+
+ internal static IpFilterTargetType? ParseIpFilterTargetType(this string value)
+ {
+ switch( value )
+ {
+ case "all":
+ return IpFilterTargetType.All;
+ case "serviceApi":
+ return IpFilterTargetType.ServiceApi;
+ case "deviceApi":
+ return IpFilterTargetType.DeviceApi;
+ }
+ return null;
+ }
+ }
+}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/KeyVaultKeyProperties.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/KeyVaultKeyProperties.cs
new file mode 100644
index 0000000000000..0fac64d27a607
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/KeyVaultKeyProperties.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.DeviceProvisioningServices.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The properties of the KeyVault key.
+ ///
+ public partial class KeyVaultKeyProperties
+ {
+ ///
+ /// Initializes a new instance of the KeyVaultKeyProperties class.
+ ///
+ public KeyVaultKeyProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the KeyVaultKeyProperties class.
+ ///
+ /// The identifier of the key.
+ public KeyVaultKeyProperties(string keyIdentifier = default(string))
+ {
+ KeyIdentifier = keyIdentifier;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the identifier of the key.
+ ///
+ [JsonProperty(PropertyName = "keyIdentifier")]
+ public string KeyIdentifier { get; set; }
+
+ }
+}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/NameAvailabilityInfo.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/NameAvailabilityInfo.cs
index 12125656a6c00..51623c28e5b05 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/NameAvailabilityInfo.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/NameAvailabilityInfo.cs
@@ -33,7 +33,7 @@ public NameAvailabilityInfo()
/// not
/// specifies the reason a name is unavailable.
/// Possible values include: 'Invalid', 'AlreadyExists'
- /// message containing a etailed reason name is
+ /// message containing a detailed reason name is
/// unavailable
public NameAvailabilityInfo(bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string))
{
@@ -62,7 +62,7 @@ public NameAvailabilityInfo()
public string Reason { get; set; }
///
- /// Gets or sets message containing a etailed reason name is
+ /// Gets or sets message containing a detailed reason name is
/// unavailable
///
[JsonProperty(PropertyName = "message")]
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/Operation.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/Operation.cs
index 6af1781fa9d62..55bee1d883114 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/Operation.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/Operation.cs
@@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.DeviceProvisioningServices.Models
using System.Linq;
///
- /// IoT Hub REST API operation.
+ /// Provisioning Service REST API operation.
///
public partial class Operation
{
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpoint.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpoint.cs
new file mode 100644
index 0000000000000..9c58ab9ec9d47
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/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.DeviceProvisioningServices.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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpointConnection.cs
new file mode 100644
index 0000000000000..296af8d617b1d
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpointConnection.cs
@@ -0,0 +1,102 @@
+//
+// 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.DeviceProvisioningServices.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The private endpoint connection of a provisioning service
+ ///
+ 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 properties of a private endpoint
+ /// connection
+ /// 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; }
+
+ ///
+ /// Gets or sets the properties of a private endpoint connection
+ ///
+ [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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpointConnectionProperties.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpointConnectionProperties.cs
new file mode 100644
index 0000000000000..523caf506c386
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateEndpointConnectionProperties.cs
@@ -0,0 +1,82 @@
+//
+// 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.DeviceProvisioningServices.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.
+ ///
+ /// The current state
+ /// of a private endpoint connection
+ /// The private endpoint property of a
+ /// private endpoint connection
+ 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();
+
+ ///
+ /// Gets or sets the private endpoint property of a private endpoint
+ /// connection
+ ///
+ [JsonProperty(PropertyName = "privateEndpoint")]
+ public PrivateEndpoint PrivateEndpoint { get; set; }
+
+ ///
+ /// Gets or sets the current state of a private endpoint connection
+ ///
+ [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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateLinkResources.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateLinkResources.cs
new file mode 100644
index 0000000000000..6a8fa45ae4110
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateLinkResources.cs
@@ -0,0 +1,55 @@
+//
+// 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.DeviceProvisioningServices.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The available private link resources for a provisioning service
+ ///
+ public partial class PrivateLinkResources
+ {
+ ///
+ /// Initializes a new instance of the PrivateLinkResources class.
+ ///
+ public PrivateLinkResources()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PrivateLinkResources class.
+ ///
+ /// The list of available private link resources
+ /// for a provisioning service
+ public PrivateLinkResources(IList value = default(IList))
+ {
+ Value = value;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the list of available private link resources for a
+ /// provisioning service
+ ///
+ [JsonProperty(PropertyName = "value")]
+ public IList Value { get; set; }
+
+ }
+}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateLinkServiceConnectionState.cs
new file mode 100644
index 0000000000000..b4cf6457ec4cb
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/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.DeviceProvisioningServices.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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateLinkServiceConnectionStatus.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PrivateLinkServiceConnectionStatus.cs
new file mode 100644
index 0000000000000..93b56e6a613e8
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/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.DeviceProvisioningServices.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/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PublicNetworkAccess.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/Models/PublicNetworkAccess.cs
new file mode 100644
index 0000000000000..d8bddf61b0b35
--- /dev/null
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/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.DeviceProvisioningServices.Models
+{
+
+ ///
+ /// Defines values for PublicNetworkAccess.
+ ///
+ public static class PublicNetworkAccess
+ {
+ public const string Enabled = "Enabled";
+ public const string Disabled = "Disabled";
+ }
+}
diff --git a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs
index e0e84a89f3dee..89d19d0a718ba 100644
--- a/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs
+++ b/sdk/deviceprovisioningservices/Microsoft.Azure.Management.DeviceProvisioningServices/src/Generated/SdkInfo_iotDpsClient.cs
@@ -1,21 +1,29 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
-internal static partial class SdkInfo
+namespace Microsoft.Azure.Management.DeviceProvisioningServices
{
- public static IEnumerable> ApiInfo_iotDpsClient
- {
- get
- {
- return new Tuple[]
- {
- new Tuple("Devices", "DpsCertificate", "2017-11-15"),
- new Tuple("Devices", "DpsCertificates", "2017-11-15"),
- new Tuple("Devices", "IotDpsResource", "2017-11-15"),
- new Tuple("Devices", "Operations", "2017-11-15"),
- }.AsEnumerable();
- }
- }
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ internal static partial class SdkInfo
+ {
+ public static IEnumerable> ApiInfo_iotDpsClient
+ {
+ get
+ {
+ return new Tuple[]
+ {
+ new Tuple("Devices", "DpsCertificate", "2020-09-01-preview"),
+ new Tuple("Devices", "IotDpsResource", "2020-09-01-preview"),
+ new Tuple("Devices", "Operations", "2020-09-01-preview"),
+ }.AsEnumerable();
+ }
+ }
+ }
}