diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperations.cs
index 451d64bce3f3..541fb1b47309 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperations.cs
@@ -1,32 +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.RecoveryServices.Backup.CrossRegionRestore
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
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;
///
/// AadPropertiesOperations operations.
///
- internal partial class AadPropertiesOperations : IServiceOperations, IAadPropertiesOperations
+ internal partial class AadPropertiesOperations : Microsoft.Rest.IServiceOperations, IAadPropertiesOperations
{
///
/// Initializes a new instance of the AadPropertiesOperations class.
@@ -37,13 +24,13 @@ internal partial class AadPropertiesOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal AadPropertiesOperations(RecoveryServicesBackupClient client)
+ internal AadPropertiesOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -54,25 +41,25 @@ internal AadPropertiesOperations(RecoveryServicesBackupClient client)
///
/// Fetches the AAD properties from target region BCM stamp.
///
+ ///
+ ///
+ ///
///
/// Azure region to hit Api
///
- ///
- /// OData parameters to apply to the operation.
- ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when unable to deserialize the response
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -81,74 +68,85 @@ internal AadPropertiesOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string azureRegion, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string azureRegion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (azureRegion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureRegion");
}
- 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");
}
+
// 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("odataQuery", odataQuery);
tracingParameters.Add("azureRegion", azureRegion);
+
+
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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties").ToString();
_url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (odataQuery != null)
{
- var _odataFilter = odataQuery.ToString();
- if (!string.IsNullOrEmpty(_odataFilter))
+ var _bmsaadPropertiesQueryObject = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_bmsaadPropertiesQueryObject))
{
- _queryParameters.Add(_odataFilter);
+ _queryParameters.Add(_bmsaadPropertiesQueryObject);
}
}
- 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)
@@ -160,50 +158,51 @@ internal AadPropertiesOperations(RecoveryServicesBackupClient 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -213,9 +212,10 @@ internal AadPropertiesOperations(RecoveryServicesBackupClient 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();
@@ -226,24 +226,28 @@ internal AadPropertiesOperations(RecoveryServicesBackupClient 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperationsExtensions.cs
index f8f9fc827aae..0627a521c5ac 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/AadPropertiesOperationsExtensions.cs
@@ -1,66 +1,55 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for AadPropertiesOperations.
+ /// Extension methods for AadPropertiesOperations
///
public static partial class AadPropertiesOperationsExtensions
{
- ///
- /// Fetches the AAD properties from target region BCM stamp.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- public static AADPropertiesResource Get(this IAadPropertiesOperations operations, string azureRegion, ODataQuery odataQuery = default(ODataQuery))
- {
- return operations.GetAsync(azureRegion, odataQuery).GetAwaiter().GetResult();
- }
+ ///
+ /// Fetches the AAD properties from target region BCM stamp.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ public static AADPropertiesResource Get(this IAadPropertiesOperations operations, string azureRegion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery))
+ {
+ return ((IAadPropertiesOperations)operations).GetAsync(azureRegion, odataQuery).GetAwaiter().GetResult();
+ }
- ///
- /// Fetches the AAD properties from target region BCM stamp.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this IAadPropertiesOperations operations, string azureRegion, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Fetches the AAD properties from target region BCM stamp.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GetAsync(this IAadPropertiesOperations operations, string azureRegion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, odataQuery, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, odataQuery, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
-
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperations.cs
index ce6d2eadc9b4..bee3d34c6284 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperations.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.RecoveryServices.Backup.CrossRegionRestore
{
+ 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;
///
/// BackupCrrJobDetailsOperations operations.
///
- internal partial class BackupCrrJobDetailsOperations : IServiceOperations, IBackupCrrJobDetailsOperations
+ internal partial class BackupCrrJobDetailsOperations : Microsoft.Rest.IServiceOperations, IBackupCrrJobDetailsOperations
{
///
/// Initializes a new instance of the BackupCrrJobDetailsOperations class.
@@ -36,13 +24,13 @@ internal partial class BackupCrrJobDetailsOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal BackupCrrJobDetailsOperations(RecoveryServicesBackupClient client)
+ internal BackupCrrJobDetailsOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -68,13 +56,13 @@ internal BackupCrrJobDetailsOperations(RecoveryServicesBackupClient 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,72 +71,82 @@ internal BackupCrrJobDetailsOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string azureRegion, string resourceId = default(string), string jobName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string azureRegion, string resourceId = default(string), string jobName = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (azureRegion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureRegion");
}
- 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");
}
+
CrrJobRequest parameters = new CrrJobRequest();
- if (resourceId != null || jobName != null)
+ if(resourceId != null||jobName != null)
{
parameters.ResourceId = resourceId;
parameters.JobName = jobName;
}
// 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("azureRegion", azureRegion);
+
tracingParameters.Add("parameters", parameters);
+
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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob").ToString();
_url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion));
- _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)
@@ -160,56 +158,57 @@ internal BackupCrrJobDetailsOperations(RecoveryServicesBackupClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(parameters != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -219,9 +218,10 @@ internal BackupCrrJobDetailsOperations(RecoveryServicesBackupClient 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();
@@ -232,24 +232,28 @@ internal BackupCrrJobDetailsOperations(RecoveryServicesBackupClient 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperationsExtensions.cs
index 98c68ad4ac04..41d2d882231d 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobDetailsOperationsExtensions.cs
@@ -1,71 +1,49 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for BackupCrrJobDetailsOperations.
+ /// Extension methods for BackupCrrJobDetailsOperations
///
public static partial class BackupCrrJobDetailsOperationsExtensions
{
- ///
- /// Get CRR job details from target region.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// Entire ARM resource id of the resource
- ///
- ///
- /// Job Name of the job to be fetched
- ///
- public static JobResource Get(this IBackupCrrJobDetailsOperations operations, string azureRegion, string resourceId = default(string), string jobName = default(string))
- {
- return operations.GetAsync(azureRegion, resourceId, jobName).GetAwaiter().GetResult();
- }
+ ///
+ /// Get CRR job details from target region.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ public static JobResource Get(this IBackupCrrJobDetailsOperations operations, string azureRegion, string resourceId = default(string), string jobName = default(string))
+ {
+ return ((IBackupCrrJobDetailsOperations)operations).GetAsync(azureRegion, resourceId, jobName).GetAwaiter().GetResult();
+ }
- ///
- /// Get CRR job details from target region.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// Entire ARM resource id of the resource
- ///
- ///
- /// Job Name of the job to be fetched
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this IBackupCrrJobDetailsOperations operations, string azureRegion, string resourceId = default(string), string jobName = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Get CRR job details from target region.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GetAsync(this IBackupCrrJobDetailsOperations operations, string azureRegion, string resourceId = default(string), string jobName = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, resourceId, jobName, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, resourceId, jobName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
-
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperations.cs
index 4fd7b051d767..4841b78accd5 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperations.cs
@@ -1,32 +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.RecoveryServices.Backup.CrossRegionRestore
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
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;
///
/// BackupCrrJobsOperations operations.
///
- internal partial class BackupCrrJobsOperations : IServiceOperations, IBackupCrrJobsOperations
+ internal partial class BackupCrrJobsOperations : Microsoft.Rest.IServiceOperations, IBackupCrrJobsOperations
{
///
/// Initializes a new instance of the BackupCrrJobsOperations class.
@@ -37,13 +24,13 @@ internal partial class BackupCrrJobsOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal BackupCrrJobsOperations(RecoveryServicesBackupClient client)
+ internal BackupCrrJobsOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -54,12 +41,12 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient client)
///
/// Gets the list of CRR jobs from the target region.
///
+ ///
+ ///
+ ///
///
/// Azure region to hit Api
///
- ///
- /// OData parameters to apply to the operation.
- ///
///
/// skipToken Filter.
///
@@ -75,13 +62,13 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient 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
///
///
@@ -90,57 +77,70 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string azureRegion, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), string resourceId = default(string), string jobName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string azureRegion, string resourceId = default(string), string jobName = default(string), Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (azureRegion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureRegion");
}
- 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");
}
+
+
CrrJobRequest parameters = new CrrJobRequest();
- if (resourceId != null || jobName != null)
+ if(resourceId != null||jobName != null)
{
parameters.ResourceId = resourceId;
parameters.JobName = jobName;
}
// 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("odataQuery", odataQuery);
tracingParameters.Add("azureRegion", azureRegion);
tracingParameters.Add("skipToken", skipToken);
+
tracingParameters.Add("parameters", parameters);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", 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.RecoveryServices/locations/{azureRegion}/backupCrrJobs").ToString();
_url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (odataQuery != null)
{
- var _odataFilter = odataQuery.ToString();
- if (!string.IsNullOrEmpty(_odataFilter))
+ var _jobQueryObject = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_jobQueryObject))
{
- _queryParameters.Add(_odataFilter);
+ _queryParameters.Add(_jobQueryObject);
}
}
- 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 (skipToken != null)
{
@@ -151,25 +151,24 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient client)
_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)
@@ -181,56 +180,57 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(parameters != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -240,9 +240,10 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient 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();
@@ -253,25 +254,29 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient 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 list of CRR jobs from the target region.
///
@@ -284,13 +289,13 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient 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
///
///
@@ -299,51 +304,54 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("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)
@@ -355,50 +363,51 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -408,9 +417,10 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient 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();
@@ -421,24 +431,28 @@ internal BackupCrrJobsOperations(RecoveryServicesBackupClient 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperationsExtensions.cs
index 7c8bb28995b1..265fe11527fe 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupCrrJobsOperationsExtensions.cs
@@ -1,118 +1,94 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for BackupCrrJobsOperations.
+ /// Extension methods for BackupCrrJobsOperations
///
public static partial class BackupCrrJobsOperationsExtensions
{
- ///
- /// Gets the list of CRR jobs from the target region.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- ///
- /// skipToken Filter.
- ///
- ///
- /// Entire ARM resource id of the resource
- ///
- ///
- /// Job Name of the job to be fetched
- ///
- public static IPage List(this IBackupCrrJobsOperations operations, string azureRegion, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), string resourceId = default(string), string jobName = default(string))
- {
- return operations.ListAsync(azureRegion, odataQuery, skipToken, resourceId, jobName).GetAwaiter().GetResult();
- }
+ ///
+ /// Gets the list of CRR jobs from the target region.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ /// skipToken Filter.
+ ///
+ public static Microsoft.Rest.Azure.IPage List(this IBackupCrrJobsOperations operations, string azureRegion, string resourceId = default(string), string jobName = default(string), Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string))
+ {
+ return ((IBackupCrrJobsOperations)operations).ListAsync(azureRegion, resourceId, jobName, odataQuery, skipToken).GetAwaiter().GetResult();
+ }
- ///
- /// Gets the list of CRR jobs from the target region.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- ///
- /// skipToken Filter.
- ///
- ///
- /// Entire ARM resource id of the resource
- ///
- ///
- /// Job Name of the job to be fetched
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IBackupCrrJobsOperations operations, string azureRegion, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), string resourceId = default(string), string jobName = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Gets the list of CRR jobs from the target region.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ /// skipToken Filter.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task> ListAsync(this IBackupCrrJobsOperations operations, string azureRegion, string resourceId = default(string), string jobName = default(string), Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(azureRegion, resourceId, jobName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.ListWithHttpMessagesAsync(azureRegion, odataQuery, skipToken, resourceId, jobName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
+ }
+ ///
+ /// Gets the list of CRR jobs from the target region.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static Microsoft.Rest.Azure.IPage ListNext(this IBackupCrrJobsOperations operations, string nextPageLink)
+ {
+ return ((IBackupCrrJobsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
- ///
- /// Gets the list of CRR jobs from the target region.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this IBackupCrrJobsOperations operations, string nextPageLink)
+ ///
+ /// Gets the list of CRR jobs from the target region.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task> ListNextAsync(this IBackupCrrJobsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return _result.Body;
}
-
- ///
- /// Gets the list of CRR jobs from the target region.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListNextAsync(this IBackupCrrJobsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperations.cs
index 4b6e8555ea1c..c42cdb0d47bc 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperations.cs
@@ -1,32 +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.RecoveryServices.Backup.CrossRegionRestore
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
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;
///
/// BackupProtectedItemsCrrOperations operations.
///
- internal partial class BackupProtectedItemsCrrOperations : IServiceOperations, IBackupProtectedItemsCrrOperations
+ internal partial class BackupProtectedItemsCrrOperations : Microsoft.Rest.IServiceOperations, IBackupProtectedItemsCrrOperations
{
///
/// Initializes a new instance of the BackupProtectedItemsCrrOperations class.
@@ -37,13 +24,13 @@ internal partial class BackupProtectedItemsCrrOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient client)
+ internal BackupProtectedItemsCrrOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -54,15 +41,14 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient client)
///
/// Provides a pageable list of all items that are backed up within a vault.
///
+ ///
+ ///
+ ///
///
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// OData parameters to apply to the operation.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// skipToken Filter.
@@ -73,13 +59,13 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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
///
///
@@ -88,56 +74,70 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (vaultName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "vaultName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- 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");
}
+
+
// 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("odataQuery", odataQuery);
tracingParameters.Add("vaultName", vaultName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("skipToken", skipToken);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", 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.RecoveryServices/vaults/{vaultName}/backupProtectedItems/").ToString();
_url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (odataQuery != null)
{
- var _odataFilter = odataQuery.ToString();
- if (!string.IsNullOrEmpty(_odataFilter))
+ var _protectedItemQueryObject = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_protectedItemQueryObject))
{
- _queryParameters.Add(_odataFilter);
+ _queryParameters.Add(_protectedItemQueryObject);
}
}
- 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 (skipToken != null)
{
@@ -148,25 +148,24 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient client)
_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)
@@ -178,50 +177,51 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -231,9 +231,10 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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();
@@ -244,25 +245,29 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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;
- }
+
+
+
+
+ }
///
/// Provides a pageable list of all items that are backed up within a vault.
///
@@ -275,13 +280,13 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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
///
///
@@ -290,51 +295,54 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
- List _queryParameters = new List();
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ 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)
@@ -346,50 +354,51 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -399,9 +408,10 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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();
@@ -412,24 +422,28 @@ internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperationsExtensions.cs
index fece298df751..ef074df9bfa3 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupProtectedItemsCrrOperationsExtensions.cs
@@ -1,114 +1,100 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for BackupProtectedItemsCrrOperations.
+ /// Extension methods for BackupProtectedItemsCrrOperations
///
public static partial class BackupProtectedItemsCrrOperationsExtensions
{
- ///
- /// Provides a pageable list of all items that are backed up within a vault.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- ///
- /// skipToken Filter.
- ///
- public static IPage List(this IBackupProtectedItemsCrrOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string))
- {
- return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult();
- }
+ ///
+ /// Provides a pageable list of all items that are backed up within a vault.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ ///
+ /// skipToken Filter.
+ ///
+ public static Microsoft.Rest.Azure.IPage List(this IBackupProtectedItemsCrrOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string))
+ {
+ return ((IBackupProtectedItemsCrrOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult();
+ }
- ///
- /// Provides a pageable list of all items that are backed up within a vault.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- ///
- /// skipToken Filter.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IBackupProtectedItemsCrrOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Provides a pageable list of all items that are backed up within a vault.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ ///
+ /// skipToken Filter.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectedItemsCrrOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
+ }
+ ///
+ /// Provides a pageable list of all items that are backed up within a vault.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static Microsoft.Rest.Azure.IPage ListNext(this IBackupProtectedItemsCrrOperations operations, string nextPageLink)
+ {
+ return ((IBackupProtectedItemsCrrOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
- ///
- /// Provides a pageable list of all items that are backed up within a vault.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this IBackupProtectedItemsCrrOperations operations, string nextPageLink)
+ ///
+ /// Provides a pageable list of all items that are backed up within a vault.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task> ListNextAsync(this IBackupProtectedItemsCrrOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return _result.Body;
}
-
- ///
- /// Provides a pageable list of all items that are backed up within a vault.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListNextAsync(this IBackupProtectedItemsCrrOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperations.cs
index 9507ab506f16..c907dff1221d 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperations.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.RecoveryServices.Backup.CrossRegionRestore
{
+ 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;
///
/// BackupResourceStorageConfigsOperations operations.
///
- internal partial class BackupResourceStorageConfigsOperations : IServiceOperations, IBackupResourceStorageConfigsOperations
+ internal partial class BackupResourceStorageConfigsOperations : Microsoft.Rest.IServiceOperations, IBackupResourceStorageConfigsOperations
{
///
/// Initializes a new instance of the BackupResourceStorageConfigsOperations class.
@@ -36,13 +24,13 @@ internal partial class BackupResourceStorageConfigsOperations : IServiceOperatio
///
/// Thrown when a required parameter is null
///
- internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient client)
+ internal BackupResourceStorageConfigsOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -57,8 +45,7 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// Headers that will be added to request.
@@ -66,13 +53,13 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
///
/// 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
///
///
@@ -81,71 +68,82 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (vaultName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "vaultName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- 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");
}
+
// 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("vaultName", vaultName);
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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString();
_url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _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)
@@ -157,50 +155,51 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
_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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -210,9 +209,10 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
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();
@@ -223,25 +223,29 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
_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;
- }
+
+
+
+
+ }
///
/// Updates vault storage model type.
///
@@ -249,8 +253,7 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// Vault storage config request
@@ -261,13 +264,13 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
///
/// 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
///
///
@@ -276,76 +279,88 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
///
/// A response object containing the response body and response headers.
///
- public async Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.ApiVersion == null)
+
+
+
+
+ if (parameters == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters");
}
- if (vaultName == null)
+
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "vaultName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (resourceGroupName == null)
+
+ if (vaultName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName");
}
- if (Client.SubscriptionId == null)
+
+ if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (parameters == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
// 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("vaultName", vaultName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
tracingParameters.Add("parameters", parameters);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", 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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString();
_url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _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("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)
@@ -357,56 +372,57 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(parameters != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -416,9 +432,10 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
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();
@@ -429,25 +446,29 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
_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;
- }
+
+
+
+
+ }
///
/// Updates vault storage model type.
///
@@ -455,8 +476,7 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// Vault storage config request
@@ -467,10 +487,10 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -479,76 +499,87 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
///
/// A response object containing the response body and response headers.
///
- public async Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- if (Client.ApiVersion == null)
+
+
+
+
+ if (parameters == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters");
}
- if (vaultName == null)
+ if (this.Client.ApiVersion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "vaultName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
- if (resourceGroupName == null)
+
+ if (vaultName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName");
}
- if (Client.SubscriptionId == null)
+
+ if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- if (parameters == null)
+
+ if (this.Client.SubscriptionId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+
// 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("vaultName", vaultName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
+
tracingParameters.Add("parameters", parameters);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Patch", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Patch", 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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString();
_url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _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("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)
@@ -560,56 +591,57 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(parameters != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 != 204)
{
var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -619,19 +651,24 @@ internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient cli
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;
- }
+
+
+
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperationsExtensions.cs
index 1c096728dc20..f35a0328dbe6 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupResourceStorageConfigsOperationsExtensions.cs
@@ -1,160 +1,130 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for BackupResourceStorageConfigsOperations.
+ /// Extension methods for BackupResourceStorageConfigsOperations
///
public static partial class BackupResourceStorageConfigsOperationsExtensions
{
- ///
- /// Fetches resource storage config.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- public static BackupResourceConfigResource Get(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName)
- {
- return operations.GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult();
- }
-
- ///
- /// Fetches resource storage config.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Updates vault storage model type.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// Vault storage config request
- ///
- public static BackupResourceConfigResource Update(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters)
- {
- return operations.UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult();
- }
-
- ///
- /// Updates vault storage model type.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// Vault storage config request
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task UpdateAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
+ ///
+ /// Fetches resource storage config.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ public static BackupResourceConfigResource Get(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName)
+ {
+ return ((IBackupResourceStorageConfigsOperations)operations).GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult();
+ }
- ///
- /// Updates vault storage model type.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// Vault storage config request
- ///
- public static void Patch(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters)
+ ///
+ /// Fetches resource storage config.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GetAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
- operations.PatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult();
+ return _result.Body;
}
+ }
+ ///
+ /// Updates vault storage model type.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ public static BackupResourceConfigResource Update(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters)
+ {
+ return ((IBackupResourceStorageConfigsOperations)operations).UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult();
+ }
- ///
- /// Updates vault storage model type.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// Vault storage config request
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task PatchAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Updates vault storage model type.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task UpdateAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false))
{
- (await operations.PatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ return _result.Body;
}
+ }
+ ///
+ /// Updates vault storage model type.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ public static void Patch(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters)
+ {
+ ((IBackupResourceStorageConfigsOperations)operations).PatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult();
+ }
+ ///
+ /// Updates vault storage model type.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task PatchAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ (await operations.PatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperations.cs
index dc7f46792d16..72d5ce1840d2 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperations.cs
@@ -1,35 +1,22 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
+ using System.Linq;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
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;
///
- /// BackupUsageSummariesCRROperations operations.
+ /// BackupUsageSummariesCrrOperations operations.
///
- internal partial class BackupUsageSummariesCRROperations : IServiceOperations, IBackupUsageSummariesCRROperations
+ internal partial class BackupUsageSummariesCrrOperations : Microsoft.Rest.IServiceOperations, IBackupUsageSummariesCrrOperations
{
///
- /// Initializes a new instance of the BackupUsageSummariesCRROperations class.
+ /// Initializes a new instance of the BackupUsageSummariesCrrOperations class.
///
///
/// Reference to the service client.
@@ -37,13 +24,13 @@ internal partial class BackupUsageSummariesCRROperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client)
+ internal BackupUsageSummariesCrrOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -54,15 +41,14 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client)
///
/// Fetches the backup management usage summaries of the vault.
///
+ ///
+ ///
+ ///
///
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// OData parameters to apply to the operation.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// skipToken Filter.
@@ -73,13 +59,13 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient 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
///
///
@@ -88,56 +74,70 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (vaultName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "vaultName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName");
}
+
if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
- 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");
}
+
+
// 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("odataQuery", odataQuery);
tracingParameters.Add("vaultName", vaultName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("skipToken", skipToken);
+
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", 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.RecoveryServices/vaults/{vaultName}/backupUsageSummaries").ToString();
_url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
- List _queryParameters = new List();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
+
+ System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List();
if (odataQuery != null)
{
- var _odataFilter = odataQuery.ToString();
- if (!string.IsNullOrEmpty(_odataFilter))
+ var _bmsBackupSummariesQueryObject = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_bmsBackupSummariesQueryObject))
{
- _queryParameters.Add(_odataFilter);
+ _queryParameters.Add(_bmsBackupSummariesQueryObject);
}
}
- 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 (skipToken != null)
{
@@ -148,25 +148,24 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client)
_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)
@@ -178,50 +177,51 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -231,9 +231,10 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient 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();
@@ -244,24 +245,28 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperationsExtensions.cs
index e4ccb7b7987a..86bf234739ea 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/BackupUsageSummariesCRROperationsExtensions.cs
@@ -1,82 +1,67 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for BackupUsageSummariesCRROperations.
+ /// Extension methods for BackupUsageSummariesCrrOperations
///
- public static partial class BackupUsageSummariesCRROperationsExtensions
+ public static partial class BackupUsageSummariesCrrOperationsExtensions
{
- ///
- /// Fetches the backup management usage summaries of the vault.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- ///
- /// skipToken Filter.
- ///
- public static IEnumerable List(this IBackupUsageSummariesCRROperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string))
- {
- return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult();
- }
+ ///
+ /// Fetches the backup management usage summaries of the vault.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ ///
+ /// skipToken Filter.
+ ///
+ public static System.Collections.Generic.IEnumerable List(this IBackupUsageSummariesCrrOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string))
+ {
+ return ((IBackupUsageSummariesCrrOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult();
+ }
- ///
- /// Fetches the backup management usage summaries of the vault.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The name of the recovery services vault.
- ///
- ///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// OData parameters to apply to the operation.
- ///
- ///
- /// skipToken Filter.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IBackupUsageSummariesCRROperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ /// Fetches the backup management usage summaries of the vault.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the recovery services vault.
+ ///
+ ///
+ /// The name of the resource group where the recovery services vault is present.
+ ///
+ ///
+ /// skipToken Filter.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task> ListAsync(this IBackupUsageSummariesCrrOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
-
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperations.cs
index ae47f7ec8b68..1cb5478cdb3d 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperations.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.RecoveryServices.Backup.CrossRegionRestore
{
+ 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;
///
/// CrossRegionRestoreOperations operations.
///
- internal partial class CrossRegionRestoreOperations : IServiceOperations, ICrossRegionRestoreOperations
+ internal partial class CrossRegionRestoreOperations : Microsoft.Rest.IServiceOperations, ICrossRegionRestoreOperations
{
///
/// Initializes a new instance of the CrossRegionRestoreOperations class.
@@ -36,13 +24,13 @@ internal partial class CrossRegionRestoreOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client)
+ internal CrossRegionRestoreOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -51,8 +39,7 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client)
public RecoveryServicesBackupClient Client { get; private set; }
///
- /// Restores the specified backed up data in a different region as compared to
- /// where the data is backed up.
+ /// Restores the specified backed up data in a different region as compared to where the data is backed up.
///
///
/// Azure region to hit Api
@@ -64,21 +51,20 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client)
/// Request object for triggering restore
///
///
- /// The headers that will be added to request.
+ /// Headers that will be added to request.
///
///
/// The cancellation token.
///
- public async Task TriggerWithHttpMessagesAsync(string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- // Send request
- AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ // Send Request
+ Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
///
- /// Restores the specified backed up data in a different region as compared to
- /// where the data is backed up.
+ /// Restores the specified backed up data in a different region as compared to where the data is backed up.
///
///
/// Azure region to hit Api
@@ -95,10 +81,10 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -107,72 +93,82 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task BeginTriggerWithHttpMessagesAsync(string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task BeginTriggerWithHttpMessagesAsync(string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (azureRegion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureRegion");
}
- 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");
}
+
CrossRegionRestoreRequest parameters = new CrossRegionRestoreRequest();
- if (crossRegionRestoreAccessDetails != null || restoreRequest != null)
+ if(crossRegionRestoreAccessDetails != null||restoreRequest != null)
{
parameters.CrossRegionRestoreAccessDetails = crossRegionRestoreAccessDetails;
parameters.RestoreRequest = restoreRequest;
}
// 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("azureRegion", azureRegion);
+
tracingParameters.Add("parameters", parameters);
+
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "BeginTrigger", tracingParameters);
+ Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginTrigger", 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.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore").ToString();
_url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion));
- _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)
@@ -184,56 +180,57 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client)
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
-
// Serialize Request
string _requestContent = null;
if(parameters != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 != 202)
{
var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -243,19 +240,24 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient 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;
- }
+
+
+
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperationsExtensions.cs
index 7a0c80369f83..337007abc60e 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrossRegionRestoreOperationsExtensions.cs
@@ -1,115 +1,76 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for CrossRegionRestoreOperations.
+ /// Extension methods for CrossRegionRestoreOperations
///
public static partial class CrossRegionRestoreOperationsExtensions
{
- ///
- /// Restores the specified backed up data in a different region as compared to
- /// where the data is backed up.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// Access details for cross region restore
- ///
- ///
- /// Request object for triggering restore
- ///
- public static void Trigger(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest))
- {
- operations.TriggerAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest).GetAwaiter().GetResult();
- }
-
- ///
- /// Restores the specified backed up data in a different region as compared to
- /// where the data is backed up.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// Access details for cross region restore
- ///
- ///
- /// Request object for triggering restore
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task TriggerAsync(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), CancellationToken cancellationToken = default(CancellationToken))
- {
- (await operations.TriggerWithHttpMessagesAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest, null, cancellationToken).ConfigureAwait(false)).Dispose();
- }
-
- ///
- /// Restores the specified backed up data in a different region as compared to
- /// where the data is backed up.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// Access details for cross region restore
- ///
- ///
- /// Request object for triggering restore
- ///
- public static void BeginTrigger(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest))
- {
- operations.BeginTriggerAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest).GetAwaiter().GetResult();
- }
+ ///
+ /// Restores the specified backed up data in a different region as compared to where the data is backed up.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ public static void Trigger(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest))
+ {
+ ((ICrossRegionRestoreOperations)operations).TriggerAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest).GetAwaiter().GetResult();
+ }
- ///
- /// Restores the specified backed up data in a different region as compared to
- /// where the data is backed up.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- /// Access details for cross region restore
- ///
- ///
- /// Request object for triggering restore
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task BeginTriggerAsync(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), CancellationToken cancellationToken = default(CancellationToken))
- {
- (await operations.BeginTriggerWithHttpMessagesAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest, null, cancellationToken).ConfigureAwait(false)).Dispose();
- }
+ ///
+ /// Restores the specified backed up data in a different region as compared to where the data is backed up.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task TriggerAsync(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ (await operations.TriggerWithHttpMessagesAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+ ///
+ /// Restores the specified backed up data in a different region as compared to where the data is backed up.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ public static void BeginTrigger(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest))
+ {
+ ((ICrossRegionRestoreOperations)operations).BeginTriggerAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest).GetAwaiter().GetResult();
+ }
+ ///
+ /// Restores the specified backed up data in a different region as compared to where the data is backed up.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task BeginTriggerAsync(this ICrossRegionRestoreOperations operations, string azureRegion, CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ (await operations.BeginTriggerWithHttpMessagesAsync(azureRegion, crossRegionRestoreAccessDetails, restoreRequest, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperations.cs
index 7ccd43e482b7..932fbab9e4b4 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperations.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.RecoveryServices.Backup.CrossRegionRestore
{
+ 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;
///
/// CrrOperationResultsOperations operations.
///
- internal partial class CrrOperationResultsOperations : IServiceOperations, ICrrOperationResultsOperations
+ internal partial class CrrOperationResultsOperations : Microsoft.Rest.IServiceOperations, ICrrOperationResultsOperations
{
///
/// Initializes a new instance of the CrrOperationResultsOperations class.
@@ -36,13 +24,13 @@ internal partial class CrrOperationResultsOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal CrrOperationResultsOperations(RecoveryServicesBackupClient client)
+ internal CrrOperationResultsOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -54,6 +42,7 @@ internal CrrOperationResultsOperations(RecoveryServicesBackupClient client)
/// Azure region to hit Api
///
///
+ ///
///
///
/// Headers that will be added to request.
@@ -61,10 +50,10 @@ internal CrrOperationResultsOperations(RecoveryServicesBackupClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
- ///
+ ///
/// Thrown when a required parameter is null
///
///
@@ -73,71 +62,82 @@ internal CrrOperationResultsOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task GetWithHttpMessagesAsync(string azureRegion, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task GetWithHttpMessagesAsync(string azureRegion, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (azureRegion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureRegion");
}
- 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 (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
+
// 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("azureRegion", azureRegion);
tracingParameters.Add("operationId", operationId);
+
+
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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}").ToString();
_url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- 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)
@@ -149,50 +149,51 @@ internal CrrOperationResultsOperations(RecoveryServicesBackupClient 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)
{
var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -202,19 +203,24 @@ internal CrrOperationResultsOperations(RecoveryServicesBackupClient 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;
- }
+
+
+
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperationsExtensions.cs
index 21884624d6b3..085debc50138 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationResultsOperationsExtensions.cs
@@ -1,54 +1,52 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for CrrOperationResultsOperations.
+ /// Extension methods for CrrOperationResultsOperations
///
public static partial class CrrOperationResultsOperationsExtensions
{
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- ///
- public static void Get(this ICrrOperationResultsOperations operations, string azureRegion, string operationId)
- {
- operations.GetAsync(azureRegion, operationId).GetAwaiter().GetResult();
- }
-
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this ICrrOperationResultsOperations operations, string azureRegion, string operationId, CancellationToken cancellationToken = default(CancellationToken))
- {
- (await operations.GetWithHttpMessagesAsync(azureRegion, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose();
- }
+ ///
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ ///
+ ///
+ public static void Get(this ICrrOperationResultsOperations operations, string azureRegion, string operationId)
+ {
+ ((ICrrOperationResultsOperations)operations).GetAsync(azureRegion, operationId).GetAwaiter().GetResult();
+ }
+ ///
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GetAsync(this ICrrOperationResultsOperations operations, string azureRegion, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ (await operations.GetWithHttpMessagesAsync(azureRegion, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperations.cs
index be298b9e46d1..507dc3c0e7f0 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperations.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.RecoveryServices.Backup.CrossRegionRestore
{
+ 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;
///
/// CrrOperationStatusOperations operations.
///
- internal partial class CrrOperationStatusOperations : IServiceOperations, ICrrOperationStatusOperations
+ internal partial class CrrOperationStatusOperations : Microsoft.Rest.IServiceOperations, ICrrOperationStatusOperations
{
///
/// Initializes a new instance of the CrrOperationStatusOperations class.
@@ -36,13 +24,13 @@ internal partial class CrrOperationStatusOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal CrrOperationStatusOperations(RecoveryServicesBackupClient client)
+ internal CrrOperationStatusOperations (RecoveryServicesBackupClient client)
{
- if (client == null)
+ if (client == null)
{
throw new System.ArgumentNullException("client");
}
- Client = client;
+ this.Client = client;
}
///
@@ -54,6 +42,7 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client)
/// Azure region to hit Api
///
///
+ ///
///
///
/// Headers that will be added to request.
@@ -61,13 +50,13 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient 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
///
///
@@ -76,71 +65,82 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string azureRegion, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string azureRegion, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- 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");
}
+
if (azureRegion == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "azureRegion");
}
- 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 (operationId == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId");
}
+
// 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("azureRegion", azureRegion);
tracingParameters.Add("operationId", operationId);
+
+
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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}").ToString();
_url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion));
- _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
- 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)
@@ -152,50 +152,51 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient 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 NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
- NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ NewErrorResponse _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)
@@ -205,9 +206,10 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient 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();
@@ -218,24 +220,28 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperationsExtensions.cs
index 8af572f9f894..e7ae3913b3ed 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperationsExtensions.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/CrrOperationStatusOperationsExtensions.cs
@@ -1,57 +1,55 @@
-//
// 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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Threading;
- using System.Threading.Tasks;
///
- /// Extension methods for CrrOperationStatusOperations.
+ /// Extension methods for CrrOperationStatusOperations
///
public static partial class CrrOperationStatusOperationsExtensions
{
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- ///
- public static OperationStatus Get(this ICrrOperationStatusOperations operations, string azureRegion, string operationId)
- {
- return operations.GetAsync(azureRegion, operationId).GetAwaiter().GetResult();
- }
+ ///
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ ///
+ ///
+ public static OperationStatus Get(this ICrrOperationStatusOperations operations, string azureRegion, string operationId)
+ {
+ return ((ICrrOperationStatusOperations)operations).GetAsync(azureRegion, operationId).GetAwaiter().GetResult();
+ }
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Azure region to hit Api
- ///
- ///
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this ICrrOperationStatusOperations operations, string azureRegion, string operationId, CancellationToken cancellationToken = default(CancellationToken))
+ ///
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Azure region to hit Api
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async System.Threading.Tasks.Task GetAsync(this ICrrOperationStatusOperations operations, string azureRegion, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, operationId, null, cancellationToken).ConfigureAwait(false))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, operationId, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
+ return _result.Body;
}
-
+ }
}
}
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IAadPropertiesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IAadPropertiesOperations.cs
index 301b45861417..04d992d99ade 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IAadPropertiesOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IAadPropertiesOperations.cs
@@ -1,23 +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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
///
/// AadPropertiesOperations operations.
@@ -27,27 +16,28 @@ public partial interface IAadPropertiesOperations
///
/// Fetches the AAD properties from target region BCM stamp.
///
+ ///
+ /// Fetches the AAD properties from target region BCM stamp.
+ ///
+ ///
+ ///
+ ///
///
/// Azure region to hit Api
///
- ///
- /// OData parameters to apply to the operation.
- ///
///
/// The headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> GetWithHttpMessagesAsync(string azureRegion, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string azureRegion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
}
-}
+}
\ No newline at end of file
diff --git a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobDetailsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobDetailsOperations.cs
index e890b3b4fe4f..dd22701786fc 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobDetailsOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobDetailsOperations.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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
///
/// BackupCrrJobDetailsOperations operations.
@@ -26,6 +16,9 @@ public partial interface IBackupCrrJobDetailsOperations
///
/// Get CRR job details from target region.
///
+ ///
+ /// Get CRR job details from target region.
+ ///
///
/// Azure region to hit Api
///
@@ -41,15 +34,13 @@ public partial interface IBackupCrrJobDetailsOperations
///
/// 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 azureRegion, string resourceId = default(string), string jobName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string azureRegion, string resourceId = default(string), string jobName = 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobsOperations.cs
index 41332b5985a1..4f5f36efd089 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobsOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupCrrJobsOperations.cs
@@ -1,23 +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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
///
/// BackupCrrJobsOperations operations.
@@ -27,12 +16,15 @@ public partial interface IBackupCrrJobsOperations
///
/// Gets the list of CRR jobs from the target region.
///
+ ///
+ /// Gets the list of CRR jobs from the target region.
+ ///
+ ///
+ ///
+ ///
///
/// Azure region to hit Api
///
- ///
- /// OData parameters to apply to the operation.
- ///
///
/// skipToken Filter.
///
@@ -48,19 +40,20 @@ public partial interface IBackupCrrJobsOperations
///
/// 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 azureRegion, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), string resourceId = default(string), string jobName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string azureRegion, string resourceId = default(string), string jobName = default(string), Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
/// Gets the list of CRR jobs from the target region.
///
+ ///
+ /// Gets the list of CRR jobs from the target region.
+ ///
///
/// The NextLink from the previous successful call to List operation.
///
@@ -70,15 +63,13 @@ public partial interface IBackupCrrJobsOperations
///
/// 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupProtectedItemsCrrOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupProtectedItemsCrrOperations.cs
index edd6c06d9077..e3c60dabe719 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupProtectedItemsCrrOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupProtectedItemsCrrOperations.cs
@@ -1,23 +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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
- using Microsoft.Rest.Azure.OData;
using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
///
/// BackupProtectedItemsCrrOperations operations.
@@ -25,18 +14,19 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.CrossRegionRestore
public partial interface IBackupProtectedItemsCrrOperations
{
///
- /// Provides a pageable list of all items that are backed up within a
- /// vault.
+ /// Provides a pageable list of all items that are backed up within a vault.
///
+ ///
+ /// Provides a pageable list of all items that are backed up within a vault.
+ ///
+ ///
+ ///
+ ///
///
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
- ///
- ///
- /// OData parameters to apply to the operation.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// skipToken Filter.
@@ -47,20 +37,20 @@ public partial interface IBackupProtectedItemsCrrOperations
///
/// 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 vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
- /// Provides a pageable list of all items that are backed up within a
- /// vault.
+ /// Provides a pageable list of all items that are backed up within a vault.
///
+ ///
+ /// Provides a pageable list of all items that are backed up within a vault.
+ ///
///
/// The NextLink from the previous successful call to List operation.
///
@@ -70,15 +60,13 @@ public partial interface IBackupProtectedItemsCrrOperations
///
/// 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/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupResourceStorageConfigsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupResourceStorageConfigsOperations.cs
index 4fa13353bc26..2c1cd46ac8b5 100644
--- a/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupResourceStorageConfigsOperations.cs
+++ b/src/RecoveryServices/RecoveryServices.Backup.CrossRegionRestore.Management.Sdk/Generated/IBackupResourceStorageConfigsOperations.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.RecoveryServices.Backup.CrossRegionRestore
{
- using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
///
/// BackupResourceStorageConfigsOperations operations.
@@ -26,12 +16,14 @@ public partial interface IBackupResourceStorageConfigsOperations
///
/// Fetches resource storage config.
///
+ ///
+ /// Fetches resource storage config.
+ ///
///
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// The headers that will be added to request.
@@ -39,25 +31,25 @@ public partial interface IBackupResourceStorageConfigsOperations
///
/// 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 vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
/// Updates vault storage model type.
///
+ ///
+ /// Updates vault storage model type.
+ ///
///
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// Vault storage config request
@@ -68,25 +60,25 @@ public partial interface IBackupResourceStorageConfigsOperations
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
/// Thrown when unable to deserialize the response
///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+
///
/// Updates vault storage model type.
///
+ ///
+ /// Updates vault storage model type.
+ ///
///
/// The name of the recovery services vault.
///
///
- /// The name of the resource group where the recovery services vault is
- /// present.
+ /// The name of the resource group where the recovery services vault is present.
///
///
/// Vault storage config request
@@ -97,12 +89,10 @@ public partial interface IBackupResourceStorageConfigsOperations
///
/// The cancellation token.
///
- ///
+ ///