diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperations.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperations.cs
index 95ad4bd19b33..32b6a54bcf16 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperations.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperations.cs
@@ -1,31 +1,19 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.DeviceProvisioningServices
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Threading;
- using System.Threading.Tasks;
///
/// DpsCertificateOperations operations.
///
- internal partial class DpsCertificateOperations : IServiceOperations, IDpsCertificateOperations
+ internal partial class DpsCertificateOperations : Microsoft.Rest.IServiceOperations, IDpsCertificateOperations
{
///
/// Initializes a new instance of the DpsCertificateOperations class.
@@ -36,13 +24,13 @@ internal partial class DpsCertificateOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal DpsCertificateOperations(IotDpsClient client)
+ internal DpsCertificateOperations (IotDpsClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -71,13 +59,13 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// 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
///
///
@@ -86,86 +74,99 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (certificateName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "certificateName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "certificateName");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.ApiVersion == null)
+
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("certificateName", certificateName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("ifMatch", ifMatch);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}").ToString();
_url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.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)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (ifMatch != null)
+ if (this.Client.AcceptLanguage != null)
{
- if (_httpRequest.Headers.Contains("If-Match"))
+ if (_httpRequest.Headers.Contains("accept-language"))
{
- _httpRequest.Headers.Remove("If-Match");
+ _httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
- if (Client.AcceptLanguage != null)
+ if (ifMatch != null)
{
- if (_httpRequest.Headers.Contains("accept-language"))
+ if (_httpRequest.Headers.Contains("If-Match"))
{
- _httpRequest.Headers.Remove("accept-language");
+ _httpRequest.Headers.Remove("If-Match");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -177,50 +178,51 @@ internal DpsCertificateOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -230,9 +232,10 @@ internal DpsCertificateOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -243,31 +246,32 @@ internal DpsCertificateOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Upload the certificate to the provisioning service.
- ///
- ///
/// Add new certificate or update an existing certificate.
- ///
+ ///
///
/// Resource group identifier.
///
@@ -281,9 +285,8 @@ internal DpsCertificateOperations(IotDpsClient client)
/// ETag of the certificate. This is required to update an existing
/// certificate, and ignored while creating a brand new certificate.
///
- ///
- /// Base-64 representation of the X509 leaf certificate .cer file or just .pem
- /// file content.
+ ///
+ /// The certificate body.
///
///
/// Headers that will be added to request.
@@ -291,13 +294,13 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// 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
///
///
@@ -306,99 +309,111 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.ApiVersion == null)
+
+
+
+
+ if (certificateDescription == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "certificateDescription");
+ }
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
+
if (certificateName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "certificateName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "certificateName");
}
if (certificateName != null)
{
if (certificateName.Length > 256)
{
- throw new ValidationException(ValidationRules.MaxLength, "certificateName", 256);
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "certificateName", 256);
}
}
- CertificateBodyDescription certificateDescription = new CertificateBodyDescription();
- if (certificate != null)
- {
- certificateDescription.Certificate = certificate;
- }
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("certificateName", certificateName);
tracingParameters.Add("ifMatch", ifMatch);
+
tracingParameters.Add("certificateDescription", certificateDescription);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
_url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (ifMatch != null)
+ if (this.Client.AcceptLanguage != null)
{
- if (_httpRequest.Headers.Contains("If-Match"))
+ if (_httpRequest.Headers.Contains("accept-language"))
{
- _httpRequest.Headers.Remove("If-Match");
+ _httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
- if (Client.AcceptLanguage != null)
+ if (ifMatch != null)
{
- if (_httpRequest.Headers.Contains("accept-language"))
+ if (_httpRequest.Headers.Contains("If-Match"))
{
- _httpRequest.Headers.Remove("accept-language");
+ _httpRequest.Headers.Remove("If-Match");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -410,56 +425,57 @@ internal DpsCertificateOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(certificateDescription != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(certificateDescription, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateDescription, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.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)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -469,9 +485,10 @@ internal DpsCertificateOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -482,31 +499,32 @@ internal DpsCertificateOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// 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.
///
@@ -520,29 +538,28 @@ internal DpsCertificateOperations(IotDpsClient client)
/// This is a mandatory field, and is the logical name of the certificate that
/// the provisioning service will access by.
///
- ///
+ ///
/// This is optional, and it is the Common Name of the certificate.
///
- ///
+ ///
/// Raw data within the certificate.
///
- ///
+ ///
/// Indicates if certificate has been verified by owner of the private key.
///
- ///
- /// A description that mentions the purpose of the certificate. Possible values
- /// include: 'clientAuthentication', 'serverAuthentication'
+ ///
+ /// A description that mentions the purpose of the certificate.
///
- ///
+ ///
/// Time the certificate is created.
///
- ///
+ ///
/// Time the certificate is last updated.
///
- ///
+ ///
/// Indicates if the certificate contains a private key.
///
- ///
+ ///
/// Random number generated to indicate Proof of Possession.
///
///
@@ -551,10 +568,10 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -563,130 +580,151 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async 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))
+ public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ifMatch, string provisioningServiceName, string certificateName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
+
if (ifMatch == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ifMatch");
}
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
+
if (certificateName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "certificateName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "certificateName");
}
- if (Client.ApiVersion == null)
+
+
+
+
+
+
+
+
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("ifMatch", ifMatch);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("certificateName", certificateName);
- tracingParameters.Add("certificatename", certificatename);
- tracingParameters.Add("certificaterawBytes", certificaterawBytes);
- tracingParameters.Add("certificateisVerified", certificateisVerified);
- tracingParameters.Add("certificatepurpose", certificatepurpose);
- tracingParameters.Add("certificatecreated", certificatecreated);
- tracingParameters.Add("certificatelastUpdated", certificatelastUpdated);
- tracingParameters.Add("certificatehasPrivateKey", certificatehasPrivateKey);
- tracingParameters.Add("certificatenonce", certificatenonce);
+ tracingParameters.Add("certificateName1", certificateName1);
+ tracingParameters.Add("certificateRawBytes", certificateRawBytes);
+ tracingParameters.Add("certificateIsVerified", certificateIsVerified);
+ tracingParameters.Add("certificatePurpose", certificatePurpose);
+ tracingParameters.Add("certificateCreated", certificateCreated);
+ tracingParameters.Add("certificateLastUpdated", certificateLastUpdated);
+ tracingParameters.Add("certificateHasPrivateKey", certificateHasPrivateKey);
+ tracingParameters.Add("certificateNonce", certificateNonce);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
_url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName));
- List _queryParameters = new List();
- if (certificatename != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (certificateName1 != null)
{
- _queryParameters.Add(string.Format("certificate.name={0}", System.Uri.EscapeDataString(certificatename)));
+ _queryParameters.Add(string.Format("certificate.name={0}", System.Uri.EscapeDataString(certificateName1)));
}
- if (certificaterawBytes != null)
+ if (certificateRawBytes != null)
{
- _queryParameters.Add(string.Format("certificate.rawBytes={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificaterawBytes, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.rawBytes={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateRawBytes, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificateisVerified != null)
+ if (certificateIsVerified != null)
{
- _queryParameters.Add(string.Format("certificate.isVerified={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificateisVerified, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.isVerified={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateIsVerified, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatepurpose != null)
+ if (certificatePurpose != null)
{
- _queryParameters.Add(string.Format("certificate.purpose={0}", System.Uri.EscapeDataString(certificatepurpose)));
+ _queryParameters.Add(string.Format("certificate.purpose={0}", System.Uri.EscapeDataString(certificatePurpose)));
}
- if (certificatecreated != null)
+ if (certificateCreated != null)
{
- _queryParameters.Add(string.Format("certificate.created={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatecreated, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.created={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateCreated, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatelastUpdated != null)
+ if (certificateLastUpdated != null)
{
- _queryParameters.Add(string.Format("certificate.lastUpdated={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatelastUpdated, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.lastUpdated={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateLastUpdated, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatehasPrivateKey != null)
+ if (certificateHasPrivateKey != null)
{
- _queryParameters.Add(string.Format("certificate.hasPrivateKey={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatehasPrivateKey, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.hasPrivateKey={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateHasPrivateKey, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatenonce != null)
+ if (certificateNonce != null)
{
- _queryParameters.Add(string.Format("certificate.nonce={0}", System.Uri.EscapeDataString(certificatenonce)));
+ _queryParameters.Add(string.Format("certificate.nonce={0}", System.Uri.EscapeDataString(certificateNonce)));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (ifMatch != null)
+ if (this.Client.AcceptLanguage != null)
{
- if (_httpRequest.Headers.Contains("If-Match"))
+ if (_httpRequest.Headers.Contains("accept-language"))
{
- _httpRequest.Headers.Remove("If-Match");
+ _httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
- if (Client.AcceptLanguage != null)
+ if (ifMatch != null)
{
- if (_httpRequest.Headers.Contains("accept-language"))
+ if (_httpRequest.Headers.Contains("If-Match"))
{
- _httpRequest.Headers.Remove("accept-language");
+ _httpRequest.Headers.Remove("If-Match");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -698,50 +736,51 @@ internal DpsCertificateOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
+
if ((int)_statusCode != 200 && (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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -751,211 +790,25 @@ internal DpsCertificateOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
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.
///
@@ -973,29 +826,28 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// Name of provisioning service.
///
- ///
+ ///
/// Common Name for the certificate.
///
- ///
+ ///
/// Raw data of certificate.
///
- ///
+ ///
/// Indicates if the certificate has been verified by owner of the private key.
///
- ///
- /// Description mentioning the purpose of the certificate. Possible values
- /// include: 'clientAuthentication', 'serverAuthentication'
+ ///
+ /// Description mentioning the purpose of the certificate.
///
- ///
+ ///
/// Certificate creation time.
///
- ///
+ ///
/// Certificate last updated time.
///
- ///
+ ///
/// Indicates if the certificate contains private key.
///
- ///
+ ///
/// Random number generated to indicate Proof of Possession.
///
///
@@ -1004,13 +856,13 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// 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
///
///
@@ -1019,130 +871,151 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GenerateVerificationCodeWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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))
+ public async System.Threading.Tasks.Task> GenerateVerificationCodeWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (certificateName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "certificateName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "certificateName");
}
+
if (ifMatch == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ifMatch");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.ApiVersion == null)
+
+
+
+
+
+
+
+
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("certificateName", certificateName);
tracingParameters.Add("ifMatch", ifMatch);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
- tracingParameters.Add("certificatename", certificatename);
- tracingParameters.Add("certificaterawBytes", certificaterawBytes);
- tracingParameters.Add("certificateisVerified", certificateisVerified);
- tracingParameters.Add("certificatepurpose", certificatepurpose);
- tracingParameters.Add("certificatecreated", certificatecreated);
- tracingParameters.Add("certificatelastUpdated", certificatelastUpdated);
- tracingParameters.Add("certificatehasPrivateKey", certificatehasPrivateKey);
- tracingParameters.Add("certificatenonce", certificatenonce);
+ tracingParameters.Add("certificateName1", certificateName1);
+ tracingParameters.Add("certificateRawBytes", certificateRawBytes);
+ tracingParameters.Add("certificateIsVerified", certificateIsVerified);
+ tracingParameters.Add("certificatePurpose", certificatePurpose);
+ tracingParameters.Add("certificateCreated", certificateCreated);
+ tracingParameters.Add("certificateLastUpdated", certificateLastUpdated);
+ tracingParameters.Add("certificateHasPrivateKey", certificateHasPrivateKey);
+ tracingParameters.Add("certificateNonce", certificateNonce);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GenerateVerificationCode", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GenerateVerificationCode", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode").ToString();
_url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
- List _queryParameters = new List();
- if (certificatename != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (certificateName1 != null)
{
- _queryParameters.Add(string.Format("certificate.name={0}", System.Uri.EscapeDataString(certificatename)));
+ _queryParameters.Add(string.Format("certificate.name={0}", System.Uri.EscapeDataString(certificateName1)));
}
- if (certificaterawBytes != null)
+ if (certificateRawBytes != null)
{
- _queryParameters.Add(string.Format("certificate.rawBytes={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificaterawBytes, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.rawBytes={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateRawBytes, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificateisVerified != null)
+ if (certificateIsVerified != null)
{
- _queryParameters.Add(string.Format("certificate.isVerified={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificateisVerified, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.isVerified={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateIsVerified, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatepurpose != null)
+ if (certificatePurpose != null)
{
- _queryParameters.Add(string.Format("certificate.purpose={0}", System.Uri.EscapeDataString(certificatepurpose)));
+ _queryParameters.Add(string.Format("certificate.purpose={0}", System.Uri.EscapeDataString(certificatePurpose)));
}
- if (certificatecreated != null)
+ if (certificateCreated != null)
{
- _queryParameters.Add(string.Format("certificate.created={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatecreated, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.created={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateCreated, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatelastUpdated != null)
+ if (certificateLastUpdated != null)
{
- _queryParameters.Add(string.Format("certificate.lastUpdated={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatelastUpdated, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.lastUpdated={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateLastUpdated, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatehasPrivateKey != null)
+ if (certificateHasPrivateKey != null)
{
- _queryParameters.Add(string.Format("certificate.hasPrivateKey={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatehasPrivateKey, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.hasPrivateKey={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateHasPrivateKey, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatenonce != null)
+ if (certificateNonce != null)
{
- _queryParameters.Add(string.Format("certificate.nonce={0}", System.Uri.EscapeDataString(certificatenonce)));
+ _queryParameters.Add(string.Format("certificate.nonce={0}", System.Uri.EscapeDataString(certificateNonce)));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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("POST");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (ifMatch != null)
+ if (this.Client.AcceptLanguage != null)
{
- if (_httpRequest.Headers.Contains("If-Match"))
+ if (_httpRequest.Headers.Contains("accept-language"))
{
- _httpRequest.Headers.Remove("If-Match");
+ _httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
- if (Client.AcceptLanguage != null)
+ if (ifMatch != null)
{
- if (_httpRequest.Headers.Contains("accept-language"))
+ if (_httpRequest.Headers.Contains("If-Match"))
{
- _httpRequest.Headers.Remove("accept-language");
+ _httpRequest.Headers.Remove("If-Match");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1154,50 +1027,51 @@ internal DpsCertificateOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1207,9 +1081,10 @@ internal DpsCertificateOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -1220,32 +1095,33 @@ internal DpsCertificateOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Verify certificate's private key possession.
- ///
- ///
- /// Verifies the certificate's private key possession by providing the leaf
+ /// Verifies the certificate's private key possession by providing the leaf
/// cert issued by the verifying pre uploaded certificate.
- ///
+ ///
///
/// The mandatory logical name of the certificate, that the provisioning
/// service uses to access.
@@ -1259,34 +1135,32 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// Provisioning service name.
///
- ///
+ ///
/// Common Name for the certificate.
///
- ///
+ ///
/// Raw data of certificate.
///
- ///
+ ///
/// Indicates if the certificate has been verified by owner of the private key.
///
- ///
- /// Describe the purpose of the certificate. Possible values include:
- /// 'clientAuthentication', 'serverAuthentication'
+ ///
+ /// Describe the purpose of the certificate.
///
- ///
+ ///
/// Certificate creation time.
///
- ///
+ ///
/// Certificate last updated time.
///
- ///
+ ///
/// Indicates if the certificate contains private key.
///
- ///
+ ///
/// Random number generated to indicate Proof of Possession.
///
- ///
- /// base-64 representation of X509 certificate .cer file or just .pem file
- /// content.
+ ///
+ /// The name of the certificate
///
///
/// Headers that will be added to request.
@@ -1294,13 +1168,13 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// 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
///
///
@@ -1309,136 +1183,157 @@ internal DpsCertificateOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> VerifyCertificateWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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), string certificate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> VerifyCertificateWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, VerificationCodeRequest request, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
+ if (request == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "request");
+ }
+
if (certificateName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "certificateName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "certificateName");
}
+
if (ifMatch == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ifMatch");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- VerificationCodeRequest request = new VerificationCodeRequest();
- if (certificate != null)
+
+
+
+
+
+
+
+
+
+ if (this.Client.ApiVersion == null)
{
- request.Certificate = certificate;
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("certificateName", certificateName);
tracingParameters.Add("ifMatch", ifMatch);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
- tracingParameters.Add("certificatename", certificatename);
- tracingParameters.Add("certificaterawBytes", certificaterawBytes);
- tracingParameters.Add("certificateisVerified", certificateisVerified);
- tracingParameters.Add("certificatepurpose", certificatepurpose);
- tracingParameters.Add("certificatecreated", certificatecreated);
- tracingParameters.Add("certificatelastUpdated", certificatelastUpdated);
- tracingParameters.Add("certificatehasPrivateKey", certificatehasPrivateKey);
- tracingParameters.Add("certificatenonce", certificatenonce);
+ tracingParameters.Add("certificateName1", certificateName1);
+ tracingParameters.Add("certificateRawBytes", certificateRawBytes);
+ tracingParameters.Add("certificateIsVerified", certificateIsVerified);
+ tracingParameters.Add("certificatePurpose", certificatePurpose);
+ tracingParameters.Add("certificateCreated", certificateCreated);
+ tracingParameters.Add("certificateLastUpdated", certificateLastUpdated);
+ tracingParameters.Add("certificateHasPrivateKey", certificateHasPrivateKey);
+ tracingParameters.Add("certificateNonce", certificateNonce);
+
tracingParameters.Add("request", request);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "VerifyCertificate", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "VerifyCertificate", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/verify").ToString();
_url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
- List _queryParameters = new List();
- if (certificatename != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (certificateName1 != null)
{
- _queryParameters.Add(string.Format("certificate.name={0}", System.Uri.EscapeDataString(certificatename)));
+ _queryParameters.Add(string.Format("certificate.name={0}", System.Uri.EscapeDataString(certificateName1)));
}
- if (certificaterawBytes != null)
+ if (certificateRawBytes != null)
{
- _queryParameters.Add(string.Format("certificate.rawBytes={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificaterawBytes, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.rawBytes={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateRawBytes, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificateisVerified != null)
+ if (certificateIsVerified != null)
{
- _queryParameters.Add(string.Format("certificate.isVerified={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificateisVerified, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.isVerified={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateIsVerified, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatepurpose != null)
+ if (certificatePurpose != null)
{
- _queryParameters.Add(string.Format("certificate.purpose={0}", System.Uri.EscapeDataString(certificatepurpose)));
+ _queryParameters.Add(string.Format("certificate.purpose={0}", System.Uri.EscapeDataString(certificatePurpose)));
}
- if (certificatecreated != null)
+ if (certificateCreated != null)
{
- _queryParameters.Add(string.Format("certificate.created={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatecreated, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.created={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateCreated, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatelastUpdated != null)
+ if (certificateLastUpdated != null)
{
- _queryParameters.Add(string.Format("certificate.lastUpdated={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatelastUpdated, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.lastUpdated={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateLastUpdated, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatehasPrivateKey != null)
+ if (certificateHasPrivateKey != null)
{
- _queryParameters.Add(string.Format("certificate.hasPrivateKey={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(certificatehasPrivateKey, Client.SerializationSettings).Trim('"'))));
+ _queryParameters.Add(string.Format("certificate.hasPrivateKey={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(certificateHasPrivateKey, this.Client.SerializationSettings).Trim('"'))));
}
- if (certificatenonce != null)
+ if (certificateNonce != null)
{
- _queryParameters.Add(string.Format("certificate.nonce={0}", System.Uri.EscapeDataString(certificatenonce)));
+ _queryParameters.Add(string.Format("certificate.nonce={0}", System.Uri.EscapeDataString(certificateNonce)));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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("POST");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (ifMatch != null)
+ if (this.Client.AcceptLanguage != null)
{
- if (_httpRequest.Headers.Contains("If-Match"))
+ if (_httpRequest.Headers.Contains("accept-language"))
{
- _httpRequest.Headers.Remove("If-Match");
+ _httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
- if (Client.AcceptLanguage != null)
+ if (ifMatch != null)
{
- if (_httpRequest.Headers.Contains("accept-language"))
+ if (_httpRequest.Headers.Contains("If-Match"))
{
- _httpRequest.Headers.Remove("accept-language");
+ _httpRequest.Headers.Remove("If-Match");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1450,56 +1345,57 @@ internal DpsCertificateOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(request != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(request, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.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)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1509,9 +1405,10 @@ internal DpsCertificateOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -1522,24 +1419,28 @@ internal DpsCertificateOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperationsExtensions.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperationsExtensions.cs
index da68b00bbfc8..41331ebb32b8 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperationsExtensions.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificateOperationsExtensions.cs
@@ -1,518 +1,424 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
-
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.DeviceProvisioningServices
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for DpsCertificateOperations.
+ /// Extension methods for DpsCertificateOperations
///
public static partial class DpsCertificateOperationsExtensions
{
- ///
- /// Get the certificate from the provisioning service.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the certificate to retrieve.
- ///
- ///
- /// Resource group identifier.
- ///
- ///
- /// Name of the provisioning service the certificate is associated with.
- ///
- ///
- /// ETag of the certificate.
- ///
- public static CertificateResponse Get(this IDpsCertificateOperations operations, string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string))
- {
- return operations.GetAsync(certificateName, resourceGroupName, provisioningServiceName, ifMatch).GetAwaiter().GetResult();
- }
-
- ///
- /// Get the certificate from the provisioning service.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Name of the certificate to retrieve.
- ///
- ///
- /// Resource group identifier.
- ///
- ///
- /// Name of the provisioning service the certificate is associated with.
- ///
- ///
- /// ETag of the certificate.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this IDpsCertificateOperations operations, string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.GetWithHttpMessagesAsync(certificateName, resourceGroupName, provisioningServiceName, ifMatch, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Upload the certificate to the provisioning service.
- ///
- ///
- /// Add new certificate or update an existing certificate.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Resource group identifier.
- ///
- ///
- /// The name of the provisioning service.
- ///
- ///
- /// The name of the certificate create or update.
- ///
- ///
- /// ETag of the certificate. This is required to update an existing
- /// certificate, and ignored while creating a brand new certificate.
- ///
- ///
- /// Base-64 representation of the X509 leaf certificate .cer file or just .pem
- /// file content.
- ///
- public static CertificateResponse CreateOrUpdate(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string))
- {
- return operations.CreateOrUpdateAsync(resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificate).GetAwaiter().GetResult();
- }
-
- ///
- /// Upload the certificate to the provisioning service.
- ///
- ///
- /// Add new certificate or update an existing certificate.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Resource group identifier.
- ///
- ///
- /// The name of the provisioning service.
- ///
- ///
- /// The name of the certificate create or update.
- ///
- ///
- /// ETag of the certificate. This is required to update an existing
- /// certificate, and ignored while creating a brand new certificate.
- ///
- ///
- /// Base-64 representation of the X509 leaf certificate .cer file or just .pem
- /// file content.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task CreateOrUpdateAsync(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string), CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, certificateName, ifMatch, certificate, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
+ ///
+ /// Get the certificate from the provisioning service.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of the certificate to retrieve.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// Name of the provisioning service the certificate is associated with.
+ ///
+ ///
+ /// ETag of the certificate.
+ ///
+ public static CertificateResponse Get(this IDpsCertificateOperations operations, string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string))
+ {
+ return ((IDpsCertificateOperations)operations).GetAsync(certificateName, resourceGroupName, provisioningServiceName, ifMatch).GetAwaiter().GetResult();
+ }
- ///
- /// Delete the Provisioning Service Certificate.
- ///
- ///
- /// Deletes the specified certificate associated with the Provisioning Service
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Resource group identifier.
- ///
- ///
- /// ETag of the certificate
- ///
- ///
- /// The name of the provisioning service.
- ///
- ///
- /// This is a mandatory field, and is the logical name of the certificate that
- /// the provisioning service will access by.
- ///
- ///
- /// This is optional, and it is the Common Name of the certificate.
- ///
- ///
- /// Raw data within the certificate.
- ///
- ///
- /// Indicates if certificate has been verified by owner of the private key.
- ///
- ///
- /// A description that mentions the purpose of the certificate. Possible values
- /// include: 'clientAuthentication', 'serverAuthentication'
- ///
- ///
- /// Time the certificate is created.
- ///
- ///
- /// Time the certificate is last updated.
- ///
- ///
- /// Indicates if the certificate contains a private key.
- ///
- ///
- /// Random number generated to indicate Proof of Possession.
- ///
- public static void Delete(this IDpsCertificateOperations operations, 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))
+ ///
+ /// Get the certificate from the provisioning service.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of the certificate to retrieve.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// Name of the provisioning service the certificate is associated with.
+ ///
+ ///
+ /// ETag of the certificate.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GetAsync(this IDpsCertificateOperations operations, string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(certificateName, resourceGroupName, provisioningServiceName, ifMatch, null, cancellationToken).ConfigureAwait(false))
{
- operations.DeleteAsync(resourceGroupName, ifMatch, provisioningServiceName, certificateName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce).GetAwaiter().GetResult();
+ return _result.Body;
}
+ }
+ ///
+ /// Add new certificate or update an existing certificate.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the certificate create or update.
+ ///
+ ///
+ /// ETag of the certificate. This is required to update an existing
+ /// certificate, and ignored while creating a brand new certificate.
+ ///
+ public static CertificateResponse CreateOrUpdate(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string))
+ {
+ return ((IDpsCertificateOperations)operations).CreateOrUpdateAsync(resourceGroupName, provisioningServiceName, certificateName, certificateDescription, ifMatch).GetAwaiter().GetResult();
+ }
- ///
- /// Delete the Provisioning Service Certificate.
- ///
- ///
- /// Deletes the specified certificate associated with the Provisioning Service
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Resource group identifier.
- ///
- ///
- /// ETag of the certificate
- ///
- ///
- /// The name of the provisioning service.
- ///
- ///
- /// This is a mandatory field, and is the logical name of the certificate that
- /// the provisioning service will access by.
- ///
- ///
- /// This is optional, and it is the Common Name of the certificate.
- ///
- ///
- /// Raw data within the certificate.
- ///
- ///
- /// Indicates if certificate has been verified by owner of the private key.
- ///
- ///
- /// A description that mentions the purpose of the certificate. Possible values
- /// include: 'clientAuthentication', 'serverAuthentication'
- ///
- ///
- /// Time the certificate is created.
- ///
- ///
- /// Time the certificate is last updated.
- ///
- ///
- /// Indicates if the certificate contains a private key.
- ///
- ///
- /// Random number generated to indicate Proof of Possession.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task DeleteAsync(this IDpsCertificateOperations operations, 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), CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Add new certificate or update an existing certificate.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// The name of the certificate create or update.
+ ///
+ ///
+ /// ETag of the certificate. This is required to update an existing
+ /// certificate, and ignored while creating a brand new certificate.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDpsCertificateOperations operations, string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, certificateName, certificateDescription, ifMatch, null, cancellationToken).ConfigureAwait(false))
{
- (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ifMatch, provisioningServiceName, certificateName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ return _result.Body;
}
+ }
+ ///
+ /// Deletes the specified certificate assosciated with the Provisioning Service
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// ETag of the certificate
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// This is a mandatory field, and is the logical name of the certificate that
+ /// the provisioning service will access by.
+ ///
+ ///
+ /// This is optional, and it is the Common Name of the certificate.
+ ///
+ ///
+ /// Raw data within the certificate.
+ ///
+ ///
+ /// Indicates if certificate has been verified by owner of the private key.
+ ///
+ ///
+ /// A description that mentions the purpose of the certificate.
+ ///
+ ///
+ /// Time the certificate is created.
+ ///
+ ///
+ /// Time the certificate is last updated.
+ ///
+ ///
+ /// Indicates if the certificate contains a private key.
+ ///
+ ///
+ /// Random number generated to indicate Proof of Possession.
+ ///
+ public static void Delete(this IDpsCertificateOperations operations, string resourceGroupName, string ifMatch, string provisioningServiceName, string certificateName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string))
+ {
+ ((IDpsCertificateOperations)operations).DeleteAsync(resourceGroupName, ifMatch, provisioningServiceName, certificateName, certificateName1, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreated, certificateLastUpdated, certificateHasPrivateKey, certificateNonce).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.
- ///
- 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.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The mandatory logical name of the certificate, that the provisioning
- /// service uses to access.
- ///
- ///
- /// ETag of the certificate. This is required to update an existing
- /// certificate, and ignored while creating a brand new certificate.
- ///
- ///
- /// name of resource group.
- ///
- ///
- /// Name of provisioning service.
- ///
- ///
- /// Common Name for the certificate.
- ///
- ///
- /// Raw data of certificate.
- ///
- ///
- /// Indicates if the certificate has been verified by owner of the private key.
- ///
- ///
- /// Description mentioning the purpose of the certificate. Possible values
- /// include: 'clientAuthentication', 'serverAuthentication'
- ///
- ///
- /// Certificate creation time.
- ///
- ///
- /// Certificate last updated time.
- ///
- ///
- /// Indicates if the certificate contains private key.
- ///
- ///
- /// Random number generated to indicate Proof of Possession.
- ///
- public static VerificationCodeResponse GenerateVerificationCode(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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))
- {
- return operations.GenerateVerificationCodeAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce).GetAwaiter().GetResult();
- }
-
- ///
- /// Generate verification code for Proof of Possession.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The mandatory logical name of the certificate, that the provisioning
- /// service uses to access.
- ///
- ///
- /// ETag of the certificate. This is required to update an existing
- /// certificate, and ignored while creating a brand new certificate.
- ///
- ///
- /// name of resource group.
- ///
- ///
- /// Name of provisioning service.
- ///
- ///
- /// Common Name for the certificate.
- ///
- ///
- /// Raw data of certificate.
- ///
- ///
- /// Indicates if the certificate has been verified by owner of the private key.
- ///
- ///
- /// Description mentioning the purpose of the certificate. Possible values
- /// include: 'clientAuthentication', 'serverAuthentication'
- ///
- ///
- /// Certificate creation time.
- ///
- ///
- /// Certificate last updated time.
- ///
- ///
- /// Indicates if the certificate contains private key.
- ///
- ///
- /// Random number generated to indicate Proof of Possession.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GenerateVerificationCodeAsync(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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), CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.GenerateVerificationCodeWithHttpMessagesAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
+ ///
+ /// Deletes the specified certificate assosciated with the Provisioning Service
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Resource group identifier.
+ ///
+ ///
+ /// ETag of the certificate
+ ///
+ ///
+ /// The name of the provisioning service.
+ ///
+ ///
+ /// This is a mandatory field, and is the logical name of the certificate that
+ /// the provisioning service will access by.
+ ///
+ ///
+ /// This is optional, and it is the Common Name of the certificate.
+ ///
+ ///
+ /// Raw data within the certificate.
+ ///
+ ///
+ /// Indicates if certificate has been verified by owner of the private key.
+ ///
+ ///
+ /// A description that mentions the purpose of the certificate.
+ ///
+ ///
+ /// Time the certificate is created.
+ ///
+ ///
+ /// Time the certificate is last updated.
+ ///
+ ///
+ /// Indicates if the certificate contains a private key.
+ ///
+ ///
+ /// Random number generated to indicate Proof of Possession.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task DeleteAsync(this IDpsCertificateOperations operations, string resourceGroupName, string ifMatch, string provisioningServiceName, string certificateName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ifMatch, provisioningServiceName, certificateName, certificateName1, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreated, certificateLastUpdated, certificateHasPrivateKey, certificateNonce, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+ ///
+ /// Generate verification code for Proof of Possession.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The mandatory logical name of the certificate, that the provisioning
+ /// service uses to access.
+ ///
+ ///
+ /// ETag of the certificate. This is required to update an existing
+ /// certificate, and ignored while creating a brand new certificate.
+ ///
+ ///
+ /// name of resource group.
+ ///
+ ///
+ /// Name of provisioning service.
+ ///
+ ///
+ /// Common Name for the certificate.
+ ///
+ ///
+ /// Raw data of certificate.
+ ///
+ ///
+ /// Indicates if the certificate has been verified by owner of the private key.
+ ///
+ ///
+ /// Description mentioning the purpose of the certificate.
+ ///
+ ///
+ /// Certificate creation time.
+ ///
+ ///
+ /// Certificate last updated time.
+ ///
+ ///
+ /// Indicates if the certificate contains private key.
+ ///
+ ///
+ /// Random number generated to indicate Proof of Possession.
+ ///
+ public static VerificationCodeResponse GenerateVerificationCode(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string))
+ {
+ return ((IDpsCertificateOperations)operations).GenerateVerificationCodeAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, certificateName1, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreated, certificateLastUpdated, certificateHasPrivateKey, certificateNonce).GetAwaiter().GetResult();
+ }
- ///
- /// Verify certificate's private key possession.
- ///
- ///
- /// Verifies the certificate's private key possession by providing the leaf
- /// cert issued by the verifying pre uploaded certificate.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The mandatory logical name of the certificate, that the provisioning
- /// service uses to access.
- ///
- ///
- /// ETag of the certificate.
- ///
- ///
- /// Resource group name.
- ///
- ///
- /// Provisioning service name.
- ///
- ///
- /// Common Name for the certificate.
- ///
- ///
- /// Raw data of certificate.
- ///
- ///
- /// Indicates if the certificate has been verified by owner of the private key.
- ///
- ///
- /// Describe the purpose of the certificate. Possible values include:
- /// 'clientAuthentication', 'serverAuthentication'
- ///
- ///
- /// Certificate creation time.
- ///
- ///
- /// Certificate last updated time.
- ///
- ///
- /// Indicates if the certificate contains private key.
- ///
- ///
- /// Random number generated to indicate Proof of Possession.
- ///
- ///
- /// base-64 representation of X509 certificate .cer file or just .pem file
- /// content.
- ///
- public static CertificateResponse VerifyCertificate(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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), string certificate = default(string))
+ ///
+ /// Generate verification code for Proof of Possession.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The mandatory logical name of the certificate, that the provisioning
+ /// service uses to access.
+ ///
+ ///
+ /// ETag of the certificate. This is required to update an existing
+ /// certificate, and ignored while creating a brand new certificate.
+ ///
+ ///
+ /// name of resource group.
+ ///
+ ///
+ /// Name of provisioning service.
+ ///
+ ///
+ /// Common Name for the certificate.
+ ///
+ ///
+ /// Raw data of certificate.
+ ///
+ ///
+ /// Indicates if the certificate has been verified by owner of the private key.
+ ///
+ ///
+ /// Description mentioning the purpose of the certificate.
+ ///
+ ///
+ /// Certificate creation time.
+ ///
+ ///
+ /// Certificate last updated time.
+ ///
+ ///
+ /// Indicates if the certificate contains private key.
+ ///
+ ///
+ /// Random number generated to indicate Proof of Possession.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GenerateVerificationCodeAsync(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.GenerateVerificationCodeWithHttpMessagesAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, certificateName1, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreated, certificateLastUpdated, certificateHasPrivateKey, certificateNonce, null, cancellationToken).ConfigureAwait(false))
{
- return operations.VerifyCertificateAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce, certificate).GetAwaiter().GetResult();
+ return _result.Body;
}
+ }
+ ///
+ /// Verifies the certificate's private key possession by providing the leaf
+ /// cert issued by the verifying pre uploaded certificate.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The mandatory logical name of the certificate, that the provisioning
+ /// service uses to access.
+ ///
+ ///
+ /// ETag of the certificate.
+ ///
+ ///
+ /// Resource group name.
+ ///
+ ///
+ /// Provisioning service name.
+ ///
+ ///
+ /// Common Name for the certificate.
+ ///
+ ///
+ /// Raw data of certificate.
+ ///
+ ///
+ /// Indicates if the certificate has been verified by owner of the private key.
+ ///
+ ///
+ /// Describe the purpose of the certificate.
+ ///
+ ///
+ /// Certificate creation time.
+ ///
+ ///
+ /// Certificate last updated time.
+ ///
+ ///
+ /// Indicates if the certificate contains private key.
+ ///
+ ///
+ /// Random number generated to indicate Proof of Possession.
+ ///
+ public static CertificateResponse VerifyCertificate(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, VerificationCodeRequest request, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string))
+ {
+ return ((IDpsCertificateOperations)operations).VerifyCertificateAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, request, certificateName1, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreated, certificateLastUpdated, certificateHasPrivateKey, certificateNonce).GetAwaiter().GetResult();
+ }
- ///
- /// Verify certificate's private key possession.
- ///
- ///
- /// Verifies the certificate's private key possession by providing the leaf
- /// cert issued by the verifying pre uploaded certificate.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The mandatory logical name of the certificate, that the provisioning
- /// service uses to access.
- ///
- ///
- /// ETag of the certificate.
- ///
- ///
- /// Resource group name.
- ///
- ///
- /// Provisioning service name.
- ///
- ///
- /// Common Name for the certificate.
- ///
- ///
- /// Raw data of certificate.
- ///
- ///
- /// Indicates if the certificate has been verified by owner of the private key.
- ///
- ///
- /// Describe the purpose of the certificate. Possible values include:
- /// 'clientAuthentication', 'serverAuthentication'
- ///
- ///
- /// Certificate creation time.
- ///
- ///
- /// Certificate last updated time.
- ///
- ///
- /// Indicates if the certificate contains private key.
- ///
- ///
- /// Random number generated to indicate Proof of Possession.
- ///
- ///
- /// base-64 representation of X509 certificate .cer file or just .pem file
- /// content.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task VerifyCertificateAsync(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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), string certificate = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Verifies the certificate's private key possession by providing the leaf
+ /// cert issued by the verifying pre uploaded certificate.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The mandatory logical name of the certificate, that the provisioning
+ /// service uses to access.
+ ///
+ ///
+ /// ETag of the certificate.
+ ///
+ ///
+ /// Resource group name.
+ ///
+ ///
+ /// Provisioning service name.
+ ///
+ ///
+ /// Common Name for the certificate.
+ ///
+ ///
+ /// Raw data of certificate.
+ ///
+ ///
+ /// Indicates if the certificate has been verified by owner of the private key.
+ ///
+ ///
+ /// Describe the purpose of the certificate.
+ ///
+ ///
+ /// Certificate creation time.
+ ///
+ ///
+ /// Certificate last updated time.
+ ///
+ ///
+ /// Indicates if the certificate contains private key.
+ ///
+ ///
+ /// Random number generated to indicate Proof of Possession.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task VerifyCertificateAsync(this IDpsCertificateOperations operations, string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, VerificationCodeRequest request, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.VerifyCertificateWithHttpMessagesAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, request, certificateName1, certificateRawBytes, certificateIsVerified, certificatePurpose, certificateCreated, certificateLastUpdated, certificateHasPrivateKey, certificateNonce, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.VerifyCertificateWithHttpMessagesAsync(certificateName, ifMatch, resourceGroupName, provisioningServiceName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce, certificate, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
-
+ }
}
}
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificatesOperations.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificatesOperations.cs
new file mode 100644
index 000000000000..75fee466c2a3
--- /dev/null
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificatesOperations.cs
@@ -0,0 +1,250 @@
+// 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
+{
+ using System.Linq;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+
+ ///
+ /// DpsCertificatesOperations operations.
+ ///
+ internal partial class DpsCertificatesOperations : Microsoft.Rest.IServiceOperations, IDpsCertificatesOperations
+ {
+ ///
+ /// Initializes a new instance of the DpsCertificatesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal DpsCertificatesOperations (IotDpsClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ this.Client = client;
+ }
+
+ ///
+ /// Gets a reference to the IotDpsClient
+ ///
+ public IotDpsClient Client { get; private set; }
+
+ ///
+ /// 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 System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+
+
+
+
+ if (this.Client.SubscriptionId == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+
+ if (resourceGroupName == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+
+ if (provisioningServiceName == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
+ }
+
+ if (this.Client.ApiVersion == null)
+ {
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+
+ // Tracing
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("provisioningServiceName", provisioningServiceName);
+
+
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+
+ var _baseUrl = this.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(this.Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (this.Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+
+ System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (Newtonsoft.Json.JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
+ }
+ catch (Newtonsoft.Json.JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+
+
+
+
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificatesOperationsExtensions.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificatesOperationsExtensions.cs
new file mode 100644
index 000000000000..87a7bef72129
--- /dev/null
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/DpsCertificatesOperationsExtensions.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
+{
+ using Microsoft.Rest.Azure;
+ using Models;
+
+ ///
+ /// Extension methods for DpsCertificatesOperations
+ ///
+ public static partial class DpsCertificatesOperationsExtensions
+ {
+ ///
+ /// 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 IDpsCertificatesOperations operations, string resourceGroupName, string provisioningServiceName)
+ {
+ return ((IDpsCertificatesOperations)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 System.Threading.Tasks.Task ListAsync(this IDpsCertificatesOperations operations, string resourceGroupName, string provisioningServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+ }
+}
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IDpsCertificateOperations.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IDpsCertificateOperations.cs
index 9ec14ce8004f..51ae3132f5d7 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IDpsCertificateOperations.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IDpsCertificateOperations.cs
@@ -1,22 +1,12 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
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;
///
/// DpsCertificateOperations operations.
@@ -26,6 +16,9 @@ public partial interface IDpsCertificateOperations
///
/// Get the certificate from the provisioning service.
///
+ ///
+ /// Get the certificate from the provisioning service.
+ ///
///
/// Name of the certificate to retrieve.
///
@@ -33,8 +26,7 @@ public partial interface IDpsCertificateOperations
/// Resource group identifier.
///
///
- /// Name of the provisioning service the certificate is associated
- /// with.
+ /// Name of the provisioning service the certificate is associated with.
///
///
/// ETag of the certificate.
@@ -45,18 +37,16 @@ public partial interface IDpsCertificateOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> GetWithHttpMessagesAsync(string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string certificateName, string resourceGroupName, string provisioningServiceName, string ifMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Upload the certificate to the provisioning service.
+ /// Add new certificate or update an existing certificate.
///
///
/// Add new certificate or update an existing certificate.
@@ -74,9 +64,8 @@ public partial interface IDpsCertificateOperations
/// ETag of the certificate. This is required to update an existing
/// certificate, and ignored while creating a brand new certificate.
///
- ///
- /// Base-64 representation of the X509 leaf certificate .cer file or
- /// just .pem file content.
+ ///
+ /// The certificate body.
///
///
/// The headers that will be added to request.
@@ -84,22 +73,19 @@ public partial interface IDpsCertificateOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, string ifMatch = default(string), string certificate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, string certificateName, CertificateBodyDescription certificateDescription, string ifMatch = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Delete the Provisioning Service Certificate.
+ /// Deletes the specified certificate assosciated with the Provisioning Service
///
///
- /// Deletes the specified certificate associated with the Provisioning
- /// Service
+ /// Deletes the specified certificate assosciated with the Provisioning Service
///
///
/// Resource group identifier.
@@ -111,34 +97,31 @@ public partial interface IDpsCertificateOperations
/// The name of the provisioning service.
///
///
- /// This is a mandatory field, and is the logical name of the
- /// certificate that the provisioning service will access by.
+ /// This is a mandatory field, and is the logical name of the certificate that
+ /// the provisioning service will access by.
///
- ///
+ ///
/// This is optional, and it is the Common Name of the certificate.
///
- ///
+ ///
/// Raw data within the certificate.
///
- ///
- /// Indicates if certificate has been verified by owner of the private
- /// key.
+ ///
+ /// Indicates if certificate has been verified by owner of the private key.
///
- ///
+ ///
/// A description that mentions the purpose of the certificate.
- /// Possible values include: 'clientAuthentication',
- /// 'serverAuthentication'
///
- ///
+ ///
/// Time the certificate is created.
///
- ///
+ ///
/// Time the certificate is last updated.
///
- ///
+ ///
/// Indicates if the certificate contains a private key.
///
- ///
+ ///
/// Random number generated to indicate Proof of Possession.
///
///
@@ -147,44 +130,20 @@ public partial interface IDpsCertificateOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
- /// Thrown when a required parameter is null
- ///
- 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));
+ System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ifMatch, string provisioningServiceName, string certificateName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
/// Generate verification code for Proof of Possession.
///
+ ///
+ /// Generate verification code for Proof of Possession.
+ ///
///
- /// The mandatory logical name of the certificate, that the
- /// provisioning service uses to access.
+ /// The mandatory logical name of the certificate, that the provisioning
+ /// service uses to access.
///
///
/// ETag of the certificate. This is required to update an existing
@@ -196,30 +155,28 @@ public partial interface IDpsCertificateOperations
///
/// Name of provisioning service.
///
- ///
+ ///
/// Common Name for the certificate.
///
- ///
+ ///
/// Raw data of certificate.
///
- ///
- /// Indicates if the certificate has been verified by owner of the
- /// private key.
+ ///
+ /// Indicates if the certificate has been verified by owner of the private key.
///
- ///
- /// Description mentioning the purpose of the certificate. Possible
- /// values include: 'clientAuthentication', 'serverAuthentication'
+ ///
+ /// Description mentioning the purpose of the certificate.
///
- ///
+ ///
/// Certificate creation time.
///
- ///
+ ///
/// Certificate last updated time.
///
- ///
+ ///
/// Indicates if the certificate contains private key.
///
- ///
+ ///
/// Random number generated to indicate Proof of Possession.
///
///
@@ -228,26 +185,25 @@ public partial interface IDpsCertificateOperations
///
/// 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> GenerateVerificationCodeWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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));
+ System.Threading.Tasks.Task> GenerateVerificationCodeWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Verify certificate's private key possession.
+ /// Verifies the certificate's private key possession by providing the leaf
+ /// cert issued by the verifying pre uploaded certificate.
///
///
- /// Verifies the certificate's private key possession by providing the
- /// leaf cert issued by the verifying pre uploaded certificate.
+ /// Verifies the certificate's private key possession by providing the leaf
+ /// cert issued by the verifying pre uploaded certificate.
///
///
- /// The mandatory logical name of the certificate, that the
- /// provisioning service uses to access.
+ /// The mandatory logical name of the certificate, that the provisioning
+ /// service uses to access.
///
///
/// ETag of the certificate.
@@ -258,35 +214,32 @@ public partial interface IDpsCertificateOperations
///
/// Provisioning service name.
///
- ///
+ ///
/// Common Name for the certificate.
///
- ///
+ ///
/// Raw data of certificate.
///
- ///
- /// Indicates if the certificate has been verified by owner of the
- /// private key.
+ ///
+ /// Indicates if the certificate has been verified by owner of the private key.
///
- ///
- /// Describe the purpose of the certificate. Possible values include:
- /// 'clientAuthentication', 'serverAuthentication'
+ ///
+ /// Describe the purpose of the certificate.
///
- ///
+ ///
/// Certificate creation time.
///
- ///
+ ///
/// Certificate last updated time.
///
- ///
+ ///
/// Indicates if the certificate contains private key.
///
- ///
+ ///
/// Random number generated to indicate Proof of Possession.
///
- ///
- /// base-64 representation of X509 certificate .cer file or just .pem
- /// file content.
+ ///
+ /// The name of the certificate
///
///
/// The headers that will be added to request.
@@ -294,15 +247,13 @@ public partial interface IDpsCertificateOperations
///
/// 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> VerifyCertificateWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, 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), string certificate = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> VerifyCertificateWithHttpMessagesAsync(string certificateName, string ifMatch, string resourceGroupName, string provisioningServiceName, VerificationCodeRequest request, string certificateName1 = default(string), byte[] certificateRawBytes = default(byte[]), bool? certificateIsVerified = default(bool?), string certificatePurpose = default(string), System.DateTimeOffset? certificateCreated = default(System.DateTimeOffset?), System.DateTimeOffset? certificateLastUpdated = default(System.DateTimeOffset?), bool? certificateHasPrivateKey = default(bool?), string certificateNonce = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
}
-}
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IDpsCertificatesOperations.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IDpsCertificatesOperations.cs
new file mode 100644
index 000000000000..e861b7f4af6e
--- /dev/null
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IDpsCertificatesOperations.cs
@@ -0,0 +1,43 @@
+// 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
+{
+ using Microsoft.Rest.Azure;
+ using Models;
+
+ ///
+ /// DpsCertificatesOperations operations.
+ ///
+ public partial interface IDpsCertificatesOperations
+ {
+ ///
+ /// Get all the certificates tied to the provisioning service.
+ ///
+ ///
+ /// 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
+ ///
+ System.Threading.Tasks.Task> ListWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
+ }
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsClient.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsClient.cs
index c8d8617c8462..5af258afbe31 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsClient.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsClient.cs
@@ -1,24 +1,18 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.DeviceProvisioningServices
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using Newtonsoft.Json;
///
/// API for using the Azure IoT Hub Device Provisioning Service features.
///
- public partial interface IIotDpsClient : System.IDisposable
+ public partial interface IIotDpsClient : System.IDisposable
{
///
/// The base URI of the service.
@@ -28,61 +22,71 @@ public partial interface IIotDpsClient : System.IDisposable
///
/// Gets or sets json serialization settings.
///
- JsonSerializerSettings SerializationSettings { get; }
+ Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }
///
/// Gets or sets json deserialization settings.
///
- JsonSerializerSettings DeserializationSettings { get; }
+ Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
///
/// Credentials needed for the client to connect to Azure.
///
- ServiceClientCredentials Credentials { get; }
+ Microsoft.Rest.ServiceClientCredentials Credentials { get;}
+
///
- /// The subscription identifier.
+ /// The API version to use for this operation.
///
- string SubscriptionId { get; set; }
+ string ApiVersion { get;}
+
///
- /// The version of the API.
+ /// The subscription identifier.
///
- string ApiVersion { get; }
+ string SubscriptionId { get; set;}
+
///
/// The preferred language for the response.
///
- string AcceptLanguage { get; set; }
+ string AcceptLanguage { get; set;}
+
///
/// The retry timeout in seconds for Long Running Operations. Default
- /// value is 30.
+ /// /// value is 30.
///
- int? LongRunningOperationRetryTimeout { get; set; }
+ int? LongRunningOperationRetryTimeout { get; set;}
+
///
/// 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.
+ /// /// 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; }
+ bool? GenerateClientRequestId { get; set;}
///
- /// Gets the IOperations.
+ /// Gets the IOperations
///
IOperations Operations { get; }
///
- /// Gets the IDpsCertificateOperations.
+ /// Gets the IDpsCertificateOperations
///
IDpsCertificateOperations DpsCertificate { get; }
///
- /// Gets the IIotDpsResourceOperations.
+ /// Gets the IIotDpsResourceOperations
///
IIotDpsResourceOperations IotDpsResource { get; }
+ ///
+ /// Gets the IDpsCertificatesOperations
+ ///
+ IDpsCertificatesOperations DpsCertificates { get; }
+
}
-}
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsResourceOperations.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsResourceOperations.cs
index 82ef61e6e9c4..60b540360ae9 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsResourceOperations.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IIotDpsResourceOperations.cs
@@ -1,22 +1,12 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
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;
///
/// IotDpsResourceOperations operations.
@@ -24,7 +14,7 @@ namespace Microsoft.Azure.Management.DeviceProvisioningServices
public partial interface IIotDpsResourceOperations
{
///
- /// Get the non-security related metadata of the provisioning service.
+ /// Get the metadata of the provisioning service without SAS keys.
///
///
/// Get the metadata of the provisioning service without SAS keys.
@@ -41,25 +31,25 @@ public partial interface IIotDpsResourceOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> GetWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// 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.
///
///
- /// 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.
+ /// 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.
@@ -76,22 +66,21 @@ public partial interface IIotDpsResourceOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Update an existing provisioning service's tags.
+ /// Update an existing provisioning service's tags. to update other fields use
+ /// the CreateOrUpdate method
///
///
- /// Update an existing provisioning service's tags. to update other
- /// fields use the CreateOrUpdate method
+ /// Update an existing provisioning service's tags. to update other fields use
+ /// the CreateOrUpdate method
///
///
/// Resource group identifier.
@@ -99,8 +88,8 @@ public partial interface IIotDpsResourceOperations
///
/// Name of provisioning service to create or update.
///
- ///
- /// Resource tags
+ ///
+ /// Updated tag information to set into the provisioning service instance.
///
///
/// The headers that will be added to request.
@@ -114,12 +103,10 @@ public partial interface IIotDpsResourceOperations
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, TagsResource provisioningServiceTags, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Delete the Provisioning Service
+ /// Deletes the Provisioning Service.
///
///
/// Deletes the Provisioning Service.
@@ -136,15 +123,13 @@ public partial interface IIotDpsResourceOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task DeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get all the provisioning services in a subscription.
+ /// List all the provisioning services for a given subscription id.
///
///
/// List all the provisioning services for a given subscription id.
@@ -155,20 +140,20 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get a list of all provisioning services in the given resource
- /// group.
+ /// Get a list of all provisioning services in the given resource group.
///
+ ///
+ /// Get a list of all provisioning services in the given resource group.
+ ///
///
/// Resource group identifier.
///
@@ -178,23 +163,25 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Gets the status of a long running operation, such as create, update
- /// or delete a provisioning service.
+ /// Gets the status of a long running operation, such as create, update or
+ /// delete a provisioning service.
///
+ ///
+ /// Gets the status of a long running operation, such as create, update or
+ /// delete a provisioning service.
+ ///
///
- /// Operation id corresponding to long running operation. Use this to
- /// poll for the status.
+ /// Operation id corresponding to long running operation. Use this to poll for
+ /// the status.
///
///
/// Resource group identifier.
@@ -203,8 +190,8 @@ public partial interface IIotDpsResourceOperations
/// Name of provisioning service that the operation is running on.
///
///
- /// Async header used to poll on the status of the operation, obtained
- /// while creating the long running operation.
+ /// Async header used to poll on the status of the operation, obtained while
+ /// creating the long running operation.
///
///
/// The headers that will be added to request.
@@ -212,18 +199,16 @@ public partial interface IIotDpsResourceOperations
///
/// 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> GetOperationResultWithHttpMessagesAsync(string operationId, string resourceGroupName, string provisioningServiceName, string asyncinfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> GetOperationResultWithHttpMessagesAsync(string operationId, string resourceGroupName, string provisioningServiceName, string asyncinfo, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get the list of valid SKUs for a provisioning service.
+ /// Gets the list of valid SKUs and tiers for a provisioning service.
///
///
/// Gets the list of valid SKUs and tiers for a provisioning service.
@@ -240,26 +225,25 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListValidSkusWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListValidSkusWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Check if a provisioning service name is available.
+ /// Check if a provisioning service name is available. This will validate if
+ /// the name is syntactically valid and if the name is usable
///
///
- /// Check if a provisioning service name is available. This will
- /// validate if the name is syntactically valid and if the name is
- /// usable
+ /// Check if a provisioning service name is available. This will validate if
+ /// the name is syntactically valid and if the name is usable
///
- ///
- /// The name of the Provisioning Service to check.
+ ///
+ /// Set the name parameter in the OperationInputs structure to the name of the
+ /// provisioning service to check.
///
///
/// The headers that will be added to request.
@@ -267,18 +251,16 @@ public partial interface IIotDpsResourceOperations
///
/// 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> CheckProvisioningServiceNameAvailabilityWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> CheckProvisioningServiceNameAvailabilityWithHttpMessagesAsync(OperationInputs arguments, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get the security metadata for a provisioning service.
+ /// List the primary and secondary keys for a provisioning service.
///
///
/// List the primary and secondary keys for a provisioning service.
@@ -295,18 +277,16 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListKeysWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListKeysWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get a shared access policy by name from a provisioning service.
+ /// List primary and secondary keys for a specific key name
///
///
/// List primary and secondary keys for a specific key name
@@ -318,8 +298,7 @@ public partial interface IIotDpsResourceOperations
/// Logical key name to get key-values for.
///
///
- /// The name of the resource group that contains the provisioning
- /// service.
+ /// The name of the resource group that contains the provisioning service.
///
///
/// The headers that will be added to request.
@@ -327,25 +306,25 @@ public partial interface IIotDpsResourceOperations
///
/// 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> ListKeysForKeyNameWithHttpMessagesAsync(string provisioningServiceName, string keyName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> ListKeysForKeyNameWithHttpMessagesAsync(string provisioningServiceName, string keyName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// 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.
///
///
- /// 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.
+ /// 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.
@@ -362,22 +341,21 @@ public partial interface IIotDpsResourceOperations
///
/// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Update an existing provisioning service's tags.
+ /// Update an existing provisioning service's tags. to update other fields use
+ /// the CreateOrUpdate method
///
///
- /// Update an existing provisioning service's tags. to update other
- /// fields use the CreateOrUpdate method
+ /// Update an existing provisioning service's tags. to update other fields use
+ /// the CreateOrUpdate method
///
///
/// Resource group identifier.
@@ -385,8 +363,8 @@ public partial interface IIotDpsResourceOperations
///
/// Name of provisioning service to create or update.
///
- ///
- /// Resource tags
+ ///
+ /// Updated tag information to set into the provisioning service instance.
///
///
/// The headers that will be added to request.
@@ -400,12 +378,10 @@ public partial interface IIotDpsResourceOperations
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, TagsResource provisioningServiceTags, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Delete the Provisioning Service
+ /// Deletes the Provisioning Service.
///
///
/// Deletes the Provisioning Service.
@@ -422,15 +398,13 @@ public partial interface IIotDpsResourceOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task BeginDeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get all the provisioning services in a subscription.
+ /// List all the provisioning services for a given subscription id.
///
///
/// List all the provisioning services for a given subscription id.
@@ -444,20 +418,20 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get a list of all provisioning services in the given resource
- /// group.
+ /// Get a list of all provisioning services in the given resource group.
///
+ ///
+ /// Get a list of all provisioning services in the given resource group.
+ ///
///
/// The NextLink from the previous successful call to List operation.
///
@@ -467,18 +441,16 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get the list of valid SKUs for a provisioning service.
+ /// Gets the list of valid SKUs and tiers for a provisioning service.
///
///
/// Gets the list of valid SKUs and tiers for a provisioning service.
@@ -492,18 +464,16 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListValidSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListValidSkusNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Get the security metadata for a provisioning service.
+ /// List the primary and secondary keys for a provisioning service.
///
///
/// List the primary and secondary keys for a provisioning service.
@@ -517,15 +487,13 @@ public partial interface IIotDpsResourceOperations
///
/// 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>> ListKeysNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListKeysNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
}
-}
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IOperations.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IOperations.cs
index 4ffca0bd4ec3..c09c8c17ce6f 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IOperations.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IOperations.cs
@@ -1,22 +1,12 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
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;
///
/// Operations operations.
@@ -26,25 +16,29 @@ public partial interface IOperations
///
/// Lists all of the available Microsoft.Devices REST API operations.
///
+ ///
+ /// Lists all of the available Microsoft.Devices REST API operations.
+ ///
///
/// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
/// Lists all of the available Microsoft.Devices REST API operations.
///
+ ///
+ /// Lists all of the available Microsoft.Devices REST API operations.
+ ///
///
/// The NextLink from the previous successful call to List operation.
///
@@ -54,15 +48,13 @@ public partial interface IOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
}
-}
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsClient.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsClient.cs
index d109c80199ba..5a6bf95d5d13 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsClient.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsClient.cs
@@ -1,94 +1,81 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.DeviceProvisioningServices
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Serialization;
using Models;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
///
/// API for using the Azure IoT Hub Device Provisioning Service features.
///
- public partial class IotDpsClient : ServiceClient, IIotDpsClient, IAzureClient
+ public partial class IotDpsClient : Microsoft.Rest.ServiceClient, IIotDpsClient, IAzureClient
{
///
/// The base URI of the service.
///
public System.Uri BaseUri { get; set; }
-
///
/// Gets or sets json serialization settings.
///
- public JsonSerializerSettings SerializationSettings { get; private set; }
-
+ public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; }
///
/// Gets or sets json deserialization settings.
///
- public JsonSerializerSettings DeserializationSettings { get; private set; }
-
+ public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; }
///
/// Credentials needed for the client to connect to Azure.
///
- public ServiceClientCredentials Credentials { get; private set; }
+ public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; }
///
- /// The subscription identifier.
+ /// The API version to use for this operation.
///
- public string SubscriptionId { get; set; }
+ public string ApiVersion { get; private set; }
///
- /// The version of the API.
+ /// The subscription identifier.
///
- public string ApiVersion { get; private set; }
+ public string SubscriptionId { get; set;}
///
/// The preferred language for the response.
///
- public string AcceptLanguage { get; set; }
+ public string AcceptLanguage { get; set;}
///
- /// 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; }
+ public int? LongRunningOperationRetryTimeout { get; set;}
///
- /// 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.
+ /// 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; }
+ public bool? GenerateClientRequestId { get; set;}
///
- /// Gets the IOperations.
+ /// Gets the IOperations
///
public virtual IOperations Operations { get; private set; }
-
///
- /// Gets the IDpsCertificateOperations.
+ /// Gets the IDpsCertificateOperations
///
public virtual IDpsCertificateOperations DpsCertificate { get; private set; }
-
///
- /// Gets the IIotDpsResourceOperations.
+ /// Gets the IIotDpsResourceOperations
///
public virtual IIotDpsResourceOperations IotDpsResource { get; private set; }
-
+ ///
+ /// Gets the IDpsCertificatesOperations
+ ///
+ public virtual IDpsCertificatesOperations DpsCertificates { get; private set; }
///
/// Initializes a new instance of the IotDpsClient class.
///
@@ -97,24 +84,22 @@ public partial class IotDpsClient : ServiceClient, IIotDpsClient,
///
///
/// 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)
+ protected IotDpsClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
{
- Initialize();
+ this.Initialize();
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
- protected IotDpsClient(params DelegatingHandler[] handlers) : base(handlers)
+ protected IotDpsClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers)
{
- Initialize();
+ this.Initialize();
}
-
///
- /// Initializes a new instance of the IotDpsClient class.
+ /// Initializes a new instance of the IotDpsClient class.
///
///
/// Optional. The http client handler used to handle http transport.
@@ -122,11 +107,10 @@ protected IotDpsClient(params DelegatingHandler[] handlers) : base(handlers)
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
- protected IotDpsClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
+ protected IotDpsClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers)
{
- Initialize();
+ this.Initialize();
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
@@ -139,15 +123,14 @@ protected IotDpsClient(HttpClientHandler rootHandler, params DelegatingHandler[]
///
/// Thrown when a required parameter is null
///
- protected IotDpsClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
+ protected IotDpsClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
- BaseUri = baseUri;
+ this.BaseUri = baseUri;
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
@@ -163,15 +146,15 @@ protected IotDpsClient(System.Uri baseUri, params DelegatingHandler[] handlers)
///
/// Thrown when a required parameter is null
///
- protected IotDpsClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ protected IotDpsClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
- BaseUri = baseUri;
+
+ this.BaseUri = baseUri;
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
@@ -184,23 +167,23 @@ protected IotDpsClient(System.Uri baseUri, HttpClientHandler rootHandler, params
///
/// Thrown when a required parameter is null
///
- public IotDpsClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ public IotDpsClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
{
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
- Credentials = credentials;
- if (Credentials != null)
+ this.Credentials = credentials;
+ if (this.Credentials != null)
{
- Credentials.InitializeServiceClient(this);
+ this.Credentials.InitializeServiceClient(this);
}
+
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
- ///
+ ///
/// Required. Credentials needed for the client to connect to Azure.
///
///
@@ -211,23 +194,23 @@ public IotDpsClient(ServiceClientCredentials credentials, params DelegatingHandl
///
/// Thrown when a required parameter is null
///
- public IotDpsClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ public IotDpsClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
{
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
- Credentials = credentials;
- if (Credentials != null)
+ this.Credentials = credentials;
+ if (this.Credentials != null)
{
- Credentials.InitializeServiceClient(this);
+ this.Credentials.InitializeServiceClient(this);
}
+
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
- ///
+ ///
/// Required. Credentials needed for the client to connect to Azure.
///
///
@@ -239,26 +222,26 @@ public IotDpsClient(ServiceClientCredentials credentials, HttpClient httpClient,
///
/// Thrown when a required parameter is null
///
- public IotDpsClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ public IotDpsClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
- Credentials = credentials;
- if (Credentials != null)
+ this.Credentials = credentials;
+ if (this.Credentials != null)
{
- Credentials.InitializeServiceClient(this);
+ this.Credentials.InitializeServiceClient(this);
}
+
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
///
/// Optional. The base URI of the service.
///
- ///
+ ///
/// Required. Credentials needed for the client to connect to Azure.
///
///
@@ -267,7 +250,7 @@ public IotDpsClient(ServiceClientCredentials credentials, HttpClientHandler root
///
/// Thrown when a required parameter is null
///
- public IotDpsClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ public IotDpsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
{
@@ -277,33 +260,30 @@ public IotDpsClient(System.Uri baseUri, ServiceClientCredentials credentials, pa
{
throw new System.ArgumentNullException("credentials");
}
- BaseUri = baseUri;
- Credentials = credentials;
- if (Credentials != null)
+ this.BaseUri = baseUri;
+ this.Credentials = credentials;
+ if (this.Credentials != null)
{
- Credentials.InitializeServiceClient(this);
+ this.Credentials.InitializeServiceClient(this);
}
+
}
-
///
/// Initializes a new instance of the IotDpsClient class.
///
///
/// Optional. The base URI of the service.
///
- ///
+ ///
/// Required. Credentials needed for the client to connect to Azure.
///
///
/// Optional. The http client handler used to handle http transport.
///
- ///
- /// Optional. The delegating handlers to add to the http client pipeline.
- ///
///
/// Thrown when a required parameter is null
///
- public IotDpsClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ public IotDpsClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
{
@@ -313,58 +293,60 @@ public IotDpsClient(System.Uri baseUri, ServiceClientCredentials credentials, Ht
{
throw new System.ArgumentNullException("credentials");
}
- BaseUri = baseUri;
- Credentials = credentials;
- if (Credentials != null)
+ this.BaseUri = baseUri;
+ this.Credentials = credentials;
+ if (this.Credentials != null)
{
- Credentials.InitializeServiceClient(this);
+ this.Credentials.InitializeServiceClient(this);
}
+
}
-
///
/// An optional partial-method to perform custom initialization.
///
partial void CustomInitialize();
+
///
/// Initializes client properties.
///
private void Initialize()
{
- Operations = new Operations(this);
- DpsCertificate = new DpsCertificateOperations(this);
- IotDpsResource = new IotDpsResourceOperations(this);
- BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2017-11-15";
- AcceptLanguage = "en-US";
- LongRunningOperationRetryTimeout = 30;
- GenerateClientRequestId = true;
- SerializationSettings = new JsonSerializerSettings
+ this.Operations = new Operations(this);
+ this.DpsCertificate = new DpsCertificateOperations(this);
+ this.IotDpsResource = new IotDpsResourceOperations(this);
+ this.DpsCertificates = new DpsCertificatesOperations(this);
+ this.BaseUri = new System.Uri("https://management.azure.com");
+ this.ApiVersion = "2017-11-15";
+ this.AcceptLanguage = "en-US";
+ this.LongRunningOperationRetryTimeout = 30;
+ this.GenerateClientRequestId = true;
+ SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings
{
Formatting = Newtonsoft.Json.Formatting.Indented,
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
- ContractResolver = new ReadOnlyJsonContractResolver(),
- Converters = new List
+ ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
+ Converters = new System.Collections.Generic.List
{
- new Iso8601TimeSpanConverter()
+ new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
}
};
- DeserializationSettings = new JsonSerializerSettings
+ DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings
{
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
- ContractResolver = new ReadOnlyJsonContractResolver(),
- Converters = new List
+ ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(),
+ Converters = new System.Collections.Generic.List
{
- new Iso8601TimeSpanConverter()
+ new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter()
}
};
CustomInitialize();
- DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
+ DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter());
}
}
-}
+}
\ No newline at end of file
diff --git a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsResourceOperations.cs b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsResourceOperations.cs
index ab861d80033e..00be9f60212d 100644
--- a/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsResourceOperations.cs
+++ b/src/DeviceProvisioningServices/DeviceProvisioningServices.Management.Sdk/Generated/IotDpsResourceOperations.cs
@@ -1,31 +1,19 @@
-//
// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
+// 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.
-//
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
namespace Microsoft.Azure.Management.DeviceProvisioningServices
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Threading;
- using System.Threading.Tasks;
///
/// IotDpsResourceOperations operations.
///
- internal partial class IotDpsResourceOperations : IServiceOperations, IIotDpsResourceOperations
+ internal partial class IotDpsResourceOperations : Microsoft.Rest.IServiceOperations, IIotDpsResourceOperations
{
///
/// Initializes a new instance of the IotDpsResourceOperations class.
@@ -36,13 +24,13 @@ internal partial class IotDpsResourceOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal IotDpsResourceOperations(IotDpsClient client)
+ internal IotDpsResourceOperations (IotDpsClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -51,11 +39,8 @@ internal IotDpsResourceOperations(IotDpsClient client)
public IotDpsClient Client { get; private set; }
///
- /// Get the non-security related metadata of the provisioning service.
- ///
- ///
/// Get the metadata of the provisioning service without SAS keys.
- ///
+ ///
///
/// Name of the provisioning service to retrieve.
///
@@ -68,13 +53,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -83,71 +68,82 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.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("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -159,50 +155,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -212,9 +209,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -225,34 +223,35 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// 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.
///
@@ -263,53 +262,47 @@ internal IotDpsResourceOperations(IotDpsClient client)
/// Description of the provisioning service to create or update.
///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send Request
- AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, iotDpsDescription, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, iotDpsDescription, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Update an existing provisioning service's tags.
- ///
- ///
- /// Update an existing provisioning service's tags. to update other fields use
+ /// 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.
///
- ///
- /// Resource tags
+ ///
+ /// Updated tag information to set into the provisioning service instance.
///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, TagsResource provisioningServiceTags, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send Request
- AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, tags, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, provisioningServiceTags, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Delete the Provisioning Service
- ///
- ///
/// Deletes the Provisioning Service.
- ///
+ ///
///
/// Name of provisioning service to delete.
///
@@ -317,37 +310,34 @@ internal IotDpsResourceOperations(IotDpsClient client)
/// Resource group identifier.
///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task DeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send request
- AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(provisioningServiceName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(provisioningServiceName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Get all the provisioning services in a subscription.
- ///
- ///
/// List all the provisioning services for a given subscription id.
- ///
+ ///
///
/// 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
///
///
@@ -356,59 +346,68 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Devices/provisioningServices").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -420,50 +419,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -473,9 +473,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -486,25 +487,29 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Get a list of all provisioning services in the given resource group.
///
@@ -517,13 +522,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -532,65 +537,75 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -602,50 +617,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -655,9 +671,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -668,25 +685,29 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
/// Gets the status of a long running operation, such as create, update or
/// delete a provisioning service.
@@ -711,13 +732,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -726,86 +747,99 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetOperationResultWithHttpMessagesAsync(string operationId, string resourceGroupName, string provisioningServiceName, string asyncinfo, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetOperationResultWithHttpMessagesAsync(string operationId, string resourceGroupName, string provisioningServiceName, string asyncinfo, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
+
if (asyncinfo == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "asyncinfo");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "asyncinfo");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("operationId", operationId);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("asyncinfo", asyncinfo);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetOperationResult", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetOperationResult", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/operationresults/{operationId}").ToString();
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (asyncinfo != null)
{
_queryParameters.Add(string.Format("asyncinfo={0}", System.Uri.EscapeDataString(asyncinfo)));
}
- if (Client.ApiVersion != null)
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -817,50 +851,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -870,9 +905,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -883,31 +919,32 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Get the list of valid SKUs for a provisioning service.
- ///
- ///
/// Gets the list of valid SKUs and tiers for a provisioning service.
- ///
+ ///
///
/// Name of provisioning service.
///
@@ -920,13 +957,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -935,71 +972,82 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListValidSkusWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListValidSkusWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListValidSkus", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListValidSkus", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/skus").ToString();
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1011,50 +1059,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1064,9 +1113,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -1077,34 +1127,36 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Check if a provisioning service name is available.
- ///
- ///
/// Check if a provisioning service name is available. This will validate if
/// the name is syntactically valid and if the name is usable
- ///
- ///
- /// The name of the Provisioning Service to check.
+ ///
+ ///
+ /// Set the name parameter in the OperationInputs structure to the name of the
+ /// provisioning service to check.
///
///
/// Headers that will be added to request.
@@ -1112,13 +1164,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -1127,69 +1179,77 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CheckProvisioningServiceNameAvailabilityWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> CheckProvisioningServiceNameAvailabilityWithHttpMessagesAsync(OperationInputs arguments, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (arguments == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "arguments");
}
- if (Client.ApiVersion == null)
+ if (arguments != null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ arguments.Validate();
}
- if (name == null)
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- OperationInputs arguments = new OperationInputs();
- if (name != null)
+
+ if (this.Client.ApiVersion == null)
{
- arguments.Name = name;
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
+
tracingParameters.Add("arguments", arguments);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "CheckProvisioningServiceNameAvailability", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckProvisioningServiceNameAvailability", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkProvisioningServiceNameAvailability").ToString();
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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("POST");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1201,56 +1261,57 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(arguments != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(arguments, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(arguments, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.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)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1260,9 +1321,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -1273,31 +1335,32 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Get the security metadata for a provisioning service.
- ///
- ///
/// List the primary and secondary keys for a provisioning service.
- ///
+ ///
///
/// The provisioning service name to get the shared access keys for.
///
@@ -1310,13 +1373,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -1325,71 +1388,82 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListKeysWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListKeysWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/listkeys").ToString();
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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("POST");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1401,50 +1475,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1454,9 +1529,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -1467,31 +1543,32 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Get a shared access policy by name from a provisioning service.
- ///
- ///
/// List primary and secondary keys for a specific key name
- ///
+ ///
///
/// Name of the provisioning service.
///
@@ -1507,13 +1584,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -1522,77 +1599,89 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListKeysForKeyNameWithHttpMessagesAsync(string provisioningServiceName, string keyName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> ListKeysForKeyNameWithHttpMessagesAsync(string provisioningServiceName, string keyName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
+
if (keyName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "keyName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyName");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("keyName", keyName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListKeysForKeyName", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListKeysForKeyName", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/keys/{keyName}/listkeys").ToString();
_url = _url.Replace("{provisioningServiceName}", System.Uri.EscapeDataString(provisioningServiceName));
_url = _url.Replace("{keyName}", System.Uri.EscapeDataString(keyName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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("POST");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1604,50 +1693,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1657,9 +1747,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -1670,34 +1761,35 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// 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.
///
@@ -1713,13 +1805,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -1728,80 +1820,91 @@ 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 System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (iotDpsDescription == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "iotDpsDescription");
}
- if (resourceGroupName == null)
+ if (iotDpsDescription != null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ iotDpsDescription.Validate();
}
- if (provisioningServiceName == null)
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (iotDpsDescription == null)
+
+ if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "iotDpsDescription");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (iotDpsDescription != null)
+
+ if (provisioningServiceName == null)
{
- iotDpsDescription.Validate();
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
+
tracingParameters.Add("iotDpsDescription", iotDpsDescription);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.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("{subscriptionId}", System.Uri.EscapeDataString(this.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)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -1813,56 +1916,57 @@ internal IotDpsResourceOperations(IotDpsClient client)
_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);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(iotDpsDescription, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.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)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -1872,9 +1976,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -1885,16 +1990,16 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
// Deserialize Response
@@ -1903,40 +2008,41 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.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
+ /// 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.
///
- ///
- /// Resource tags
+ ///
+ /// Updated tag information to set into the provisioning service instance.
///
///
/// Headers that will be added to request.
@@ -1944,13 +2050,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -1959,77 +2065,87 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string provisioningServiceName, TagsResource provisioningServiceTags, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.SubscriptionId == null)
+
+
+
+
+ if (provisioningServiceTags == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceTags");
}
- if (resourceGroupName == null)
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- if (provisioningServiceName == null)
+
+ if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+
+ if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- TagsResource provisioningServiceTags = new TagsResource();
- if (tags != null)
+
+ if (this.Client.ApiVersion == null)
{
- provisioningServiceTags.Tags = tags;
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
+
tracingParameters.Add("provisioningServiceTags", provisioningServiceTags);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.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("{subscriptionId}", System.Uri.EscapeDataString(this.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)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -2041,61 +2157,62 @@ internal IotDpsResourceOperations(IotDpsClient client)
_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);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(provisioningServiceTags, this.Client.SerializationSettings);
+ _httpRequest.Content = new System.Net.Http.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)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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));
+ var ex = new Microsoft.Rest.Azure.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);
+ CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
+ ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.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);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -2105,9 +2222,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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();
@@ -2118,31 +2236,32 @@ internal IotDpsResourceOperations(IotDpsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
}
- catch (JsonException ex)
+ catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
- ServiceClientTracing.Exit(_invocationId, _result);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Delete the Provisioning Service
- ///
- ///
/// Deletes the Provisioning Service.
- ///
+ ///
///
/// Name of provisioning service to delete.
///
@@ -2155,10 +2274,10 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -2167,71 +2286,82 @@ 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 System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string provisioningServiceName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
+
+
+
if (provisioningServiceName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "provisioningServiceName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "provisioningServiceName");
}
- if (Client.SubscriptionId == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (Client.ApiVersion == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("provisioningServiceName", provisioningServiceName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
+
+ var _baseUrl = this.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("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- List _queryParameters = new List();
- if (Client.ApiVersion != null)
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
+ if (this.Client.ApiVersion != null)
{
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.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");
+ var _httpRequest = new System.Net.Http.HttpRequestMessage();
+ System.Net.Http.HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
- if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
- if (Client.AcceptLanguage != null)
+ if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
- _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}
-
if (customHeaders != null)
{
foreach(var _header in customHeaders)
@@ -2243,50 +2373,51 @@ internal IotDpsResourceOperations(IotDpsClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
// Set Credentials
- if (Client.Credentials != null)
+ if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
- await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
- ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
- _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
- ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
- HttpStatusCode _statusCode = _httpResponse.StatusCode;
+
+ System.Net.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);
+ ErrorDetails _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
- catch (JsonException)
+ catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
- ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
- ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
- ServiceClientTracing.Error(_invocationId, ex);
+ Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
@@ -2296,26 +2427,28 @@ internal IotDpsResourceOperations(IotDpsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new Microsoft.Rest.Azure.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);
+ Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
- }
+
+
+
+
+ }
///
- /// Get all the provisioning services in a subscription.
- ///
- ///
/// List all the provisioning services for a given subscription id.
- ///
+ ///
///
/// The NextLink from the previous successful call to List operation.
///
@@ -2325,13 +2458,13 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// 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
///
///
@@ -2340,51 +2473,54 @@ internal IotDpsResourceOperations(IotDpsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
+
if (nextPageLink == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
+ _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
+ System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- List _queryParameters = new List