diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/AsyncOperationStatusOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/AsyncOperationStatusOperations.cs
new file mode 100644
index 000000000000..4d80ef62c496
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/AsyncOperationStatusOperations.cs
@@ -0,0 +1,245 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ 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;
+
+ ///
+ /// AsyncOperationStatusOperations operations.
+ ///
+ internal partial class AsyncOperationStatusOperations : IServiceOperations, IAsyncOperationStatusOperations
+ {
+ ///
+ /// Initializes a new instance of the AsyncOperationStatusOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal AsyncOperationStatusOperations(RedisManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the RedisManagementClient
+ ///
+ public RedisManagementClient Client { get; private set; }
+
+ ///
+ /// For checking the ongoing status of an operation
+ ///
+ ///
+ /// The location at which operation was triggered
+ ///
+ ///
+ /// The ID of asynchronous 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (operationId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "operationId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("operationId", operationId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/asyncOperations/{operationId}").ToString();
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/AsyncOperationStatusOperationsExtensions.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/AsyncOperationStatusOperationsExtensions.cs
new file mode 100644
index 000000000000..bc4768068f8d
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/AsyncOperationStatusOperationsExtensions.cs
@@ -0,0 +1,65 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for AsyncOperationStatusOperations.
+ ///
+ public static partial class AsyncOperationStatusOperationsExtensions
+ {
+ ///
+ /// For checking the ongoing status of an operation
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location at which operation was triggered
+ ///
+ ///
+ /// The ID of asynchronous operation
+ ///
+ public static OperationStatus Get(this IAsyncOperationStatusOperations operations, string location, string operationId)
+ {
+ return operations.GetAsync(location, operationId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// For checking the ongoing status of an operation
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The location at which operation was triggered
+ ///
+ ///
+ /// The ID of asynchronous operation
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IAsyncOperationStatusOperations operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/FirewallRulesOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/FirewallRulesOperations.cs
new file mode 100644
index 000000000000..2a0ab6c87cf1
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/FirewallRulesOperations.cs
@@ -0,0 +1,1037 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ 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;
+
+ ///
+ /// FirewallRulesOperations operations.
+ ///
+ internal partial class FirewallRulesOperations : IServiceOperations, IFirewallRulesOperations
+ {
+ ///
+ /// Initializes a new instance of the FirewallRulesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal FirewallRulesOperations(RedisManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the RedisManagementClient
+ ///
+ public RedisManagementClient Client { get; private set; }
+
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cacheName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (cacheName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "cacheName");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("cacheName", cacheName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{cacheName}", System.Uri.EscapeDataString(cacheName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or update a redis cache firewall rule
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// lowest IP address included in the range
+ ///
+ ///
+ /// highest IP address included in the range
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cacheName, string ruleName, string startIP, string endIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (cacheName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "cacheName");
+ }
+ if (ruleName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ruleName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (startIP == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "startIP");
+ }
+ if (endIP == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endIP");
+ }
+ RedisFirewallRule parameters = new RedisFirewallRule();
+ if (startIP != null || endIP != null)
+ {
+ parameters.StartIP = startIP;
+ parameters.EndIP = endIP;
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("cacheName", cacheName);
+ tracingParameters.Add("ruleName", ruleName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{cacheName}", System.Uri.EscapeDataString(cacheName));
+ _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string cacheName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (cacheName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "cacheName");
+ }
+ if (ruleName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ruleName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("cacheName", cacheName);
+ tracingParameters.Add("ruleName", ruleName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{cacheName}", System.Uri.EscapeDataString(cacheName));
+ _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Deletes a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string cacheName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (cacheName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "cacheName");
+ }
+ if (ruleName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ruleName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("cacheName", cacheName);
+ tracingParameters.Add("ruleName", ruleName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{cacheName}", System.Uri.EscapeDataString(cacheName));
+ _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new 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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/FirewallRulesOperationsExtensions.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/FirewallRulesOperationsExtensions.cs
new file mode 100644
index 000000000000..a757bef91429
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/FirewallRulesOperationsExtensions.cs
@@ -0,0 +1,246 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for FirewallRulesOperations.
+ ///
+ public static partial class FirewallRulesOperationsExtensions
+ {
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ public static IPage List(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName)
+ {
+ return operations.ListAsync(resourceGroupName, cacheName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, cacheName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or update a redis cache firewall rule
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// lowest IP address included in the range
+ ///
+ ///
+ /// highest IP address included in the range
+ ///
+ public static RedisFirewallRule CreateOrUpdate(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName, string ruleName, string startIP, string endIP)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, cacheName, ruleName, startIP, endIP).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or update a redis cache firewall rule
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// lowest IP address included in the range
+ ///
+ ///
+ /// highest IP address included in the range
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName, string ruleName, string startIP, string endIP, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cacheName, ruleName, startIP, endIP, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ public static RedisFirewallRule Get(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName, string ruleName)
+ {
+ return operations.GetAsync(resourceGroupName, cacheName, ruleName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName, string ruleName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, cacheName, ruleName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ public static void Delete(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName, string ruleName)
+ {
+ operations.DeleteAsync(resourceGroupName, cacheName, ruleName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IFirewallRulesOperations operations, string resourceGroupName, string cacheName, string ruleName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, cacheName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IFirewallRulesOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// 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 IFirewallRulesOperations 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/RedisCache/RedisCache.Management.Sdk/Generated/IAsyncOperationStatusOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IAsyncOperationStatusOperations.cs
new file mode 100644
index 000000000000..bbb13aa587c5
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IAsyncOperationStatusOperations.cs
@@ -0,0 +1,52 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// AsyncOperationStatusOperations operations.
+ ///
+ public partial interface IAsyncOperationStatusOperations
+ {
+ ///
+ /// For checking the ongoing status of an operation
+ ///
+ ///
+ /// The location at which operation was triggered
+ ///
+ ///
+ /// The ID of asynchronous 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 location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/IFirewallRulesOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IFirewallRulesOperations.cs
new file mode 100644
index 000000000000..db8dfb6ceb7d
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IFirewallRulesOperations.cs
@@ -0,0 +1,161 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// FirewallRulesOperations operations.
+ ///
+ public partial interface IFirewallRulesOperations
+ {
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cacheName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or update a redis cache firewall rule
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// lowest IP address included in the range
+ ///
+ ///
+ /// highest IP address included in the range
+ ///
+ ///
+ /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string cacheName, string ruleName, string startIP, string endIP, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string cacheName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a single firewall rule in a specified redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the firewall rule.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string cacheName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets all firewall rules in the specified redis cache.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/ILinkedServerOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/ILinkedServerOperations.cs
new file mode 100644
index 000000000000..7b039bf7bdec
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/ILinkedServerOperations.cs
@@ -0,0 +1,223 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// LinkedServerOperations operations.
+ ///
+ public partial interface ILinkedServerOperations
+ {
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis
+ /// cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server 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> CreateWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium
+ /// SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis
+ /// cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the detailed information about a linked server of a redis
+ /// cache (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the list of linked servers associated with this redis cache
+ /// (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis
+ /// cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server 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> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium
+ /// SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis
+ /// cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the list of linked servers associated with this redis cache
+ /// (requires Premium SKU).
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/IOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IOperations.cs
new file mode 100644
index 000000000000..7feaad514889
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IOperations.cs
@@ -0,0 +1,70 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Operations operations.
+ ///
+ public partial interface IOperations
+ {
+ ///
+ /// Lists all of the available REST API operations of the
+ /// Microsoft.Cache provider.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all of the available REST API operations of the
+ /// Microsoft.Cache provider.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/IPatchSchedulesOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IPatchSchedulesOperations.cs
new file mode 100644
index 000000000000..9f40a0b3ef44
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IPatchSchedulesOperations.cs
@@ -0,0 +1,151 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PatchSchedulesOperations operations.
+ ///
+ public partial interface IPatchSchedulesOperations
+ {
+ ///
+ /// Gets all patch schedules in the specified redis cache (there is
+ /// only one).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// 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>> ListByRedisResourceWithHttpMessagesAsync(string resourceGroupName, string cacheName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or replace the patching schedule for Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// List of patch schedules for a Redis cache.
+ ///
+ ///
+ /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, IList scheduleEntries, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the patching schedule of a redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the patching schedule of a redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets all patch schedules in the specified redis cache (there is
+ /// only one).
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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>> ListByRedisResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/IPrivateEndpointConnectionsOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IPrivateEndpointConnectionsOperations.cs
new file mode 100644
index 000000000000..1eefa2f8bb9a
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IPrivateEndpointConnectionsOperations.cs
@@ -0,0 +1,176 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PrivateEndpointConnectionsOperations operations.
+ ///
+ public partial interface IPrivateEndpointConnectionsOperations
+ {
+ ///
+ /// List all the private endpoint connections associated with the redis
+ /// cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, string cacheName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the specified private endpoint connection associated with the
+ /// redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the private endpoint connection associated with the
+ /// Azure resource
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string cacheName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update the state of specified private endpoint connection
+ /// associated with the redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the private endpoint connection associated with the
+ /// Azure resource
+ ///
+ ///
+ /// The private endpoint connection properties.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> PutWithHttpMessagesAsync(string resourceGroupName, string cacheName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the specified private endpoint connection associated with
+ /// the redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the private endpoint connection associated with the
+ /// Azure resource
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string cacheName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update the state of specified private endpoint connection
+ /// associated with the redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the private endpoint connection associated with the
+ /// Azure resource
+ ///
+ ///
+ /// The private endpoint connection properties.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginPutWithHttpMessagesAsync(string resourceGroupName, string cacheName, string privateEndpointConnectionName, PrivateEndpointConnection properties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/IPrivateLinkResourcesOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IPrivateLinkResourcesOperations.cs
new file mode 100644
index 000000000000..be727a2d5ed4
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IPrivateLinkResourcesOperations.cs
@@ -0,0 +1,53 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// PrivateLinkResourcesOperations operations.
+ ///
+ public partial interface IPrivateLinkResourcesOperations
+ {
+ ///
+ /// Gets the private link resources that need to be created for a redis
+ /// cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// 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>> ListByRedisCacheWithHttpMessagesAsync(string resourceGroupName, string cacheName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/IRedisManagementClient.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IRedisManagementClient.cs
new file mode 100644
index 000000000000..0a4ef188cd06
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IRedisManagementClient.cs
@@ -0,0 +1,115 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+
+ ///
+ /// REST API for Azure Redis Cache Service.
+ ///
+ public partial interface IRedisManagementClient : System.IDisposable
+ {
+ ///
+ /// The base URI of the service.
+ ///
+ System.Uri BaseUri { get; set; }
+
+ ///
+ /// Gets or sets json serialization settings.
+ ///
+ JsonSerializerSettings SerializationSettings { get; }
+
+ ///
+ /// Gets or sets json deserialization settings.
+ ///
+ JsonSerializerSettings DeserializationSettings { get; }
+
+ ///
+ /// Credentials needed for the client to connect to Azure.
+ ///
+ ServiceClientCredentials Credentials { get; }
+
+ ///
+ /// Gets subscription credentials which uniquely identify the Microsoft
+ /// Azure subscription. The subscription ID forms part of the URI for
+ /// every service call.
+ ///
+ string SubscriptionId { get; set; }
+
+ ///
+ /// Client Api Version.
+ ///
+ string ApiVersion { get; }
+
+ ///
+ /// The preferred language for the response.
+ ///
+ string AcceptLanguage { get; set; }
+
+ ///
+ /// The retry timeout in seconds for Long Running Operations. Default
+ /// value is 30.
+ ///
+ int? LongRunningOperationRetryTimeout { get; set; }
+
+ ///
+ /// Whether a unique x-ms-client-request-id should be generated. When
+ /// set to true a unique x-ms-client-request-id value is generated and
+ /// included in each request. Default is true.
+ ///
+ bool? GenerateClientRequestId { get; set; }
+
+
+ ///
+ /// Gets the IOperations.
+ ///
+ IOperations Operations { get; }
+
+ ///
+ /// Gets the IRedisOperations.
+ ///
+ IRedisOperations Redis { get; }
+
+ ///
+ /// Gets the IFirewallRulesOperations.
+ ///
+ IFirewallRulesOperations FirewallRules { get; }
+
+ ///
+ /// Gets the IPatchSchedulesOperations.
+ ///
+ IPatchSchedulesOperations PatchSchedules { get; }
+
+ ///
+ /// Gets the ILinkedServerOperations.
+ ///
+ ILinkedServerOperations LinkedServer { get; }
+
+ ///
+ /// Gets the IPrivateEndpointConnectionsOperations.
+ ///
+ IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; }
+
+ ///
+ /// Gets the IPrivateLinkResourcesOperations.
+ ///
+ IPrivateLinkResourcesOperations PrivateLinkResources { get; }
+
+ ///
+ /// Gets the IAsyncOperationStatusOperations.
+ ///
+ IAsyncOperationStatusOperations AsyncOperationStatus { get; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/IRedisOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/IRedisOperations.cs
new file mode 100644
index 000000000000..5147acbf6b04
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/IRedisOperations.cs
@@ -0,0 +1,554 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RedisOperations operations.
+ ///
+ public partial interface IRedisOperations
+ {
+ ///
+ /// Checks that the redis cache name is valid and is not already in
+ /// use.
+ ///
+ ///
+ /// Resource name.
+ ///
+ ///
+ /// Resource type. The only legal value of this property for checking
+ /// redis cache name availability is 'Microsoft.Cache/redis'.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task CheckNameAvailabilityWithHttpMessagesAsync(string name, string type, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets any upgrade notifications for a Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// how many minutes in past to look for upgrade notifications
+ ///
+ ///
+ /// 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>> ListUpgradeNotificationsWithHttpMessagesAsync(string resourceGroupName, string name, double history, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or replace (overwrite/recreate, with potential downtime) an
+ /// existing Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Redis 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> CreateWithHttpMessagesAsync(string resourceGroupName, string name, RedisCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update an existing Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Update Redis 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string name, RedisUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a Redis cache (resource description).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all Redis caches in a resource group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets all Redis caches in the specified subscription.
+ ///
+ ///
+ /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Retrieve a Redis cache's access keys. This operation requires write
+ /// permission to the cache resource.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// 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> ListKeysWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Regenerate Redis cache's access keys. This operation requires write
+ /// permission to the cache resource.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The Redis access key to regenerate. Possible values include:
+ /// 'Primary', 'Secondary'
+ ///
+ ///
+ /// 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> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string name, RedisKeyType keyType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Reboot specified Redis node(s). This operation requires write
+ /// permission to the cache resource. There can be potential data loss.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Specifies which Redis node(s) to reboot.
+ ///
+ ///
+ /// 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> ForceRebootWithHttpMessagesAsync(string resourceGroupName, string name, RedisRebootParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Import data into Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters for Redis import operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task ImportDataWithHttpMessagesAsync(string resourceGroupName, string name, ImportRDBParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Export data from the redis cache to blobs in a container.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters for Redis export operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task ExportDataWithHttpMessagesAsync(string resourceGroupName, string name, ExportRDBParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or replace (overwrite/recreate, with potential downtime) an
+ /// existing Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Redis 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> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string name, RedisCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update an existing Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Update Redis 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string name, RedisUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Import data into Redis cache.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters for Redis import operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginImportDataWithHttpMessagesAsync(string resourceGroupName, string name, ImportRDBParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Export data from the redis cache to blobs in a container.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// Parameters for Redis export operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task BeginExportDataWithHttpMessagesAsync(string resourceGroupName, string name, ExportRDBParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets any upgrade notifications for a Redis cache.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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>> ListUpgradeNotificationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all Redis caches in a resource group.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets all Redis caches in the specified subscription.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/LinkedServerOperations.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/LinkedServerOperations.cs
new file mode 100644
index 000000000000..06d4717e3ec8
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/LinkedServerOperations.cs
@@ -0,0 +1,1084 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ 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;
+
+ ///
+ /// LinkedServerOperations operations.
+ ///
+ internal partial class LinkedServerOperations : IServiceOperations, ILinkedServerOperations
+ {
+ ///
+ /// Initializes a new instance of the LinkedServerOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal LinkedServerOperations(RedisManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the RedisManagementClient
+ ///
+ public RedisManagementClient Client { get; private set; }
+
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets the detailed information about a linked server of a redis cache
+ /// (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (linkedServerName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "linkedServerName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("linkedServerName", linkedServerName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ _url = _url.Replace("{linkedServerName}", System.Uri.EscapeDataString(linkedServerName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets the list of linked servers associated with this redis cache (requires
+ /// Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (linkedServerName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "linkedServerName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("linkedServerName", linkedServerName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ _url = _url.Replace("{linkedServerName}", System.Uri.EscapeDataString(linkedServerName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string name, string linkedServerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (linkedServerName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "linkedServerName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("linkedServerName", linkedServerName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ _url = _url.Replace("{linkedServerName}", System.Uri.EscapeDataString(linkedServerName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets the list of linked servers associated with this redis cache (requires
+ /// Premium SKU).
+ ///
+ ///
+ /// The NextLink from the previous successful call to List 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new 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");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/LinkedServerOperationsExtensions.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/LinkedServerOperationsExtensions.cs
new file mode 100644
index 000000000000..83ffb7b35ac4
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/LinkedServerOperationsExtensions.cs
@@ -0,0 +1,341 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for LinkedServerOperations.
+ ///
+ public static partial class LinkedServerOperationsExtensions
+ {
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server operation.
+ ///
+ public static RedisLinkedServerWithProperties Create(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters)
+ {
+ return operations.CreateAsync(resourceGroupName, name, linkedServerName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ public static void Delete(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName)
+ {
+ operations.DeleteAsync(resourceGroupName, name, linkedServerName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Gets the detailed information about a linked server of a redis cache
+ /// (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server.
+ ///
+ public static RedisLinkedServerWithProperties Get(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName)
+ {
+ return operations.GetAsync(resourceGroupName, name, linkedServerName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the detailed information about a linked server of a redis cache
+ /// (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets the list of linked servers associated with this redis cache (requires
+ /// Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ public static IPage List(this ILinkedServerOperations operations, string resourceGroupName, string name)
+ {
+ return operations.ListAsync(resourceGroupName, name).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the list of linked servers associated with this redis cache (requires
+ /// Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server operation.
+ ///
+ public static RedisLinkedServerWithProperties BeginCreate(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters)
+ {
+ return operations.BeginCreateAsync(resourceGroupName, name, linkedServerName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Adds a linked server to the Redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the Redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// Parameters supplied to the Create Linked server operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginCreateAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ public static void BeginDelete(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName)
+ {
+ operations.BeginDeleteAsync(resourceGroupName, name, linkedServerName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes the linked server from a redis cache (requires Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the redis cache.
+ ///
+ ///
+ /// The name of the linked server that is being added to the Redis cache.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginDeleteAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Gets the list of linked servers associated with this redis cache (requires
+ /// Premium SKU).
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this ILinkedServerOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the list of linked servers associated with this redis cache (requires
+ /// Premium SKU).
+ ///
+ ///
+ /// 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 ILinkedServerOperations 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/RedisCache/RedisCache.Management.Sdk/Generated/Models/AzureEntityResource.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/AzureEntityResource.cs
new file mode 100644
index 000000000000..7870d659ed7d
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/AzureEntityResource.cs
@@ -0,0 +1,62 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Entity Resource
+ ///
+ ///
+ /// The resource model definition for an Azure Resource Manager resource
+ /// with an etag.
+ ///
+ public partial class AzureEntityResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the AzureEntityResource class.
+ ///
+ public AzureEntityResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the AzureEntityResource class.
+ ///
+ /// Fully qualified resource ID for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. E.g.
+ /// "Microsoft.Compute/virtualMachines" or
+ /// "Microsoft.Storage/storageAccounts"
+ /// Resource Etag.
+ public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string))
+ : base(id, name, type)
+ {
+ Etag = etag;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets resource Etag.
+ ///
+ [JsonProperty(PropertyName = "etag")]
+ public string Etag { get; private set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/CheckNameAvailabilityParameters.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/CheckNameAvailabilityParameters.cs
new file mode 100644
index 000000000000..621a9ab8ad8f
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/CheckNameAvailabilityParameters.cs
@@ -0,0 +1,83 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Parameters body to pass for resource name availability check.
+ ///
+ public partial class CheckNameAvailabilityParameters
+ {
+ ///
+ /// Initializes a new instance of the CheckNameAvailabilityParameters
+ /// class.
+ ///
+ public CheckNameAvailabilityParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the CheckNameAvailabilityParameters
+ /// class.
+ ///
+ /// Resource name.
+ /// Resource type. The only legal value of this
+ /// property for checking redis cache name availability is
+ /// 'Microsoft.Cache/redis'.
+ public CheckNameAvailabilityParameters(string name, string type)
+ {
+ Name = name;
+ Type = type;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets resource type. The only legal value of this property
+ /// for checking redis cache name availability is
+ /// 'Microsoft.Cache/redis'.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ if (Type == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Type");
+ }
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/DayOfWeek.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/DayOfWeek.cs
new file mode 100644
index 000000000000..d6aaaf825803
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/DayOfWeek.cs
@@ -0,0 +1,102 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using Newtonsoft.Json.Converters;
+ using System.Runtime;
+ using System.Runtime.Serialization;
+
+ ///
+ /// Defines values for DayOfWeek.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum DayOfWeek
+ {
+ [EnumMember(Value = "Monday")]
+ Monday,
+ [EnumMember(Value = "Tuesday")]
+ Tuesday,
+ [EnumMember(Value = "Wednesday")]
+ Wednesday,
+ [EnumMember(Value = "Thursday")]
+ Thursday,
+ [EnumMember(Value = "Friday")]
+ Friday,
+ [EnumMember(Value = "Saturday")]
+ Saturday,
+ [EnumMember(Value = "Sunday")]
+ Sunday,
+ [EnumMember(Value = "Everyday")]
+ Everyday,
+ [EnumMember(Value = "Weekend")]
+ Weekend
+ }
+ internal static class DayOfWeekEnumExtension
+ {
+ internal static string ToSerializedValue(this DayOfWeek? value)
+ {
+ return value == null ? null : ((DayOfWeek)value).ToSerializedValue();
+ }
+
+ internal static string ToSerializedValue(this DayOfWeek value)
+ {
+ switch( value )
+ {
+ case DayOfWeek.Monday:
+ return "Monday";
+ case DayOfWeek.Tuesday:
+ return "Tuesday";
+ case DayOfWeek.Wednesday:
+ return "Wednesday";
+ case DayOfWeek.Thursday:
+ return "Thursday";
+ case DayOfWeek.Friday:
+ return "Friday";
+ case DayOfWeek.Saturday:
+ return "Saturday";
+ case DayOfWeek.Sunday:
+ return "Sunday";
+ case DayOfWeek.Everyday:
+ return "Everyday";
+ case DayOfWeek.Weekend:
+ return "Weekend";
+ }
+ return null;
+ }
+
+ internal static DayOfWeek? ParseDayOfWeek(this string value)
+ {
+ switch( value )
+ {
+ case "Monday":
+ return DayOfWeek.Monday;
+ case "Tuesday":
+ return DayOfWeek.Tuesday;
+ case "Wednesday":
+ return DayOfWeek.Wednesday;
+ case "Thursday":
+ return DayOfWeek.Thursday;
+ case "Friday":
+ return DayOfWeek.Friday;
+ case "Saturday":
+ return DayOfWeek.Saturday;
+ case "Sunday":
+ return DayOfWeek.Sunday;
+ case "Everyday":
+ return DayOfWeek.Everyday;
+ case "Weekend":
+ return DayOfWeek.Weekend;
+ }
+ return null;
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs
new file mode 100644
index 000000000000..ebd1a28463b2
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs
@@ -0,0 +1,59 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The resource management error additional info.
+ ///
+ public partial class ErrorAdditionalInfo
+ {
+ ///
+ /// Initializes a new instance of the ErrorAdditionalInfo class.
+ ///
+ public ErrorAdditionalInfo()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorAdditionalInfo class.
+ ///
+ /// The additional info type.
+ /// The additional info.
+ public ErrorAdditionalInfo(string type = default(string), object info = default(object))
+ {
+ Type = type;
+ Info = info;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the additional info type.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets the additional info.
+ ///
+ [JsonProperty(PropertyName = "info")]
+ public object Info { get; private set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorDetail.cs
new file mode 100644
index 000000000000..75eae91c2843
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorDetail.cs
@@ -0,0 +1,85 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The error detail.
+ ///
+ public partial class ErrorDetail
+ {
+ ///
+ /// Initializes a new instance of the ErrorDetail class.
+ ///
+ public ErrorDetail()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorDetail class.
+ ///
+ /// The error code.
+ /// The error message.
+ /// The error target.
+ /// The error details.
+ /// The error additional info.
+ public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList))
+ {
+ Code = code;
+ Message = message;
+ Target = target;
+ Details = details;
+ AdditionalInfo = additionalInfo;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the error code.
+ ///
+ [JsonProperty(PropertyName = "code")]
+ public string Code { get; private set; }
+
+ ///
+ /// Gets the error message.
+ ///
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; private set; }
+
+ ///
+ /// Gets the error target.
+ ///
+ [JsonProperty(PropertyName = "target")]
+ public string Target { get; private set; }
+
+ ///
+ /// Gets the error details.
+ ///
+ [JsonProperty(PropertyName = "details")]
+ public IList Details { get; private set; }
+
+ ///
+ /// Gets the error additional info.
+ ///
+ [JsonProperty(PropertyName = "additionalInfo")]
+ public IList AdditionalInfo { get; private set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorResponse.cs
new file mode 100644
index 000000000000..7d2bf5433968
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorResponse.cs
@@ -0,0 +1,56 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Error response
+ ///
+ ///
+ /// Common error response for all Azure Resource Manager APIs to return
+ /// error details for failed operations. (This also follows the OData error
+ /// response format.).
+ ///
+ public partial class ErrorResponse
+ {
+ ///
+ /// Initializes a new instance of the ErrorResponse class.
+ ///
+ public ErrorResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorResponse class.
+ ///
+ /// The error object.
+ public ErrorResponse(ErrorDetail error = default(ErrorDetail))
+ {
+ Error = error;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the error object.
+ ///
+ [JsonProperty(PropertyName = "error")]
+ public ErrorDetail Error { get; set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorResponseException.cs
new file mode 100644
index 000000000000..d6e2c32f0bf4
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ErrorResponseException.cs
@@ -0,0 +1,62 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+
+ ///
+ /// Exception thrown for an invalid response with ErrorResponse
+ /// information.
+ ///
+ public partial class ErrorResponseException : RestException
+ {
+ ///
+ /// Gets information about the associated HTTP request.
+ ///
+ public HttpRequestMessageWrapper Request { get; set; }
+
+ ///
+ /// Gets information about the associated HTTP response.
+ ///
+ public HttpResponseMessageWrapper Response { get; set; }
+
+ ///
+ /// Gets or sets the body object.
+ ///
+ public ErrorResponse Body { get; set; }
+
+ ///
+ /// Initializes a new instance of the ErrorResponseException class.
+ ///
+ public ErrorResponseException()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorResponseException class.
+ ///
+ /// The exception message.
+ public ErrorResponseException(string message)
+ : this(message, null)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorResponseException class.
+ ///
+ /// The exception message.
+ /// Inner exception.
+ public ErrorResponseException(string message, System.Exception innerException)
+ : base(message, innerException)
+ {
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ExportRDBParameters.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ExportRDBParameters.cs
new file mode 100644
index 000000000000..474d41ecd1a2
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ExportRDBParameters.cs
@@ -0,0 +1,97 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Parameters for Redis export operation.
+ ///
+ public partial class ExportRDBParameters
+ {
+ ///
+ /// Initializes a new instance of the ExportRDBParameters class.
+ ///
+ public ExportRDBParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ExportRDBParameters class.
+ ///
+ /// Prefix to use for exported files.
+ /// Container name to export to.
+ /// File format.
+ /// Preferred auth method
+ /// to communicate to storage account used for data archive, specify
+ /// SAS or ManagedIdentity, default value is SAS
+ public ExportRDBParameters(string prefix, string container, string format = default(string), string preferredDataArchiveAuthMethod = default(string))
+ {
+ Format = format;
+ Prefix = prefix;
+ Container = container;
+ PreferredDataArchiveAuthMethod = preferredDataArchiveAuthMethod;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets file format.
+ ///
+ [JsonProperty(PropertyName = "format")]
+ public string Format { get; set; }
+
+ ///
+ /// Gets or sets prefix to use for exported files.
+ ///
+ [JsonProperty(PropertyName = "prefix")]
+ public string Prefix { get; set; }
+
+ ///
+ /// Gets or sets container name to export to.
+ ///
+ [JsonProperty(PropertyName = "container")]
+ public string Container { get; set; }
+
+ ///
+ /// Gets or sets preferred auth method to communicate to storage
+ /// account used for data archive, specify SAS or ManagedIdentity,
+ /// default value is SAS
+ ///
+ [JsonProperty(PropertyName = "preferred-data-archive-auth-method")]
+ public string PreferredDataArchiveAuthMethod { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Prefix == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Prefix");
+ }
+ if (Container == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Container");
+ }
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ImportRDBParameters.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ImportRDBParameters.cs
new file mode 100644
index 000000000000..dad9cabe54ad
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ImportRDBParameters.cs
@@ -0,0 +1,87 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Parameters for Redis import operation.
+ ///
+ public partial class ImportRDBParameters
+ {
+ ///
+ /// Initializes a new instance of the ImportRDBParameters class.
+ ///
+ public ImportRDBParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ImportRDBParameters class.
+ ///
+ /// files to import.
+ /// File format.
+ /// Preferred auth method
+ /// to communicate to storage account used for data archive, specify
+ /// SAS or ManagedIdentity, default value is SAS
+ public ImportRDBParameters(IList files, string format = default(string), string preferredDataArchiveAuthMethod = default(string))
+ {
+ Format = format;
+ Files = files;
+ PreferredDataArchiveAuthMethod = preferredDataArchiveAuthMethod;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets file format.
+ ///
+ [JsonProperty(PropertyName = "format")]
+ public string Format { get; set; }
+
+ ///
+ /// Gets or sets files to import.
+ ///
+ [JsonProperty(PropertyName = "files")]
+ public IList Files { get; set; }
+
+ ///
+ /// Gets or sets preferred auth method to communicate to storage
+ /// account used for data archive, specify SAS or ManagedIdentity,
+ /// default value is SAS
+ ///
+ [JsonProperty(PropertyName = "preferred-data-archive-auth-method")]
+ public string PreferredDataArchiveAuthMethod { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Files == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Files");
+ }
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs
new file mode 100644
index 000000000000..64015c5c2ac0
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs
@@ -0,0 +1,99 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Managed service identity (system assigned and/or user assigned
+ /// identities)
+ ///
+ public partial class ManagedServiceIdentity
+ {
+ ///
+ /// Initializes a new instance of the ManagedServiceIdentity class.
+ ///
+ public ManagedServiceIdentity()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ManagedServiceIdentity class.
+ ///
+ /// Possible values include: 'None',
+ /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned,
+ /// UserAssigned'
+ /// The service principal ID of the system
+ /// assigned identity. This property will only be provided for a system
+ /// assigned identity.
+ /// The tenant ID of the system assigned
+ /// identity. This property will only be provided for a system assigned
+ /// identity.
+ public ManagedServiceIdentity(string type, System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary))
+ {
+ PrincipalId = principalId;
+ TenantId = tenantId;
+ Type = type;
+ UserAssignedIdentities = userAssignedIdentities;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the service principal ID of the system assigned identity. This
+ /// property will only be provided for a system assigned identity.
+ ///
+ [JsonProperty(PropertyName = "principalId")]
+ public System.Guid? PrincipalId { get; private set; }
+
+ ///
+ /// Gets the tenant ID of the system assigned identity. This property
+ /// will only be provided for a system assigned identity.
+ ///
+ [JsonProperty(PropertyName = "tenantId")]
+ public System.Guid? TenantId { get; private set; }
+
+ ///
+ /// Gets or sets possible values include: 'None', 'SystemAssigned',
+ /// 'UserAssigned', 'SystemAssigned, UserAssigned'
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ ///
+ [JsonProperty(PropertyName = "userAssignedIdentities")]
+ public IDictionary UserAssignedIdentities { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Type == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Type");
+ }
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs
new file mode 100644
index 000000000000..7acac33d9c85
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ManagedServiceIdentityType.cs
@@ -0,0 +1,24 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+
+ ///
+ /// Defines values for ManagedServiceIdentityType.
+ ///
+ public static class ManagedServiceIdentityType
+ {
+ public const string None = "None";
+ public const string SystemAssigned = "SystemAssigned";
+ public const string UserAssigned = "UserAssigned";
+ public const string SystemAssignedUserAssigned = "SystemAssigned, UserAssigned";
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Operation.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Operation.cs
new file mode 100644
index 000000000000..fe795a00d7bb
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Operation.cs
@@ -0,0 +1,61 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// REST API operation
+ ///
+ public partial class Operation
+ {
+ ///
+ /// Initializes a new instance of the Operation class.
+ ///
+ public Operation()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Operation class.
+ ///
+ /// Operation name:
+ /// {provider}/{resource}/{operation}
+ /// The object that describes the
+ /// operation.
+ public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay))
+ {
+ Name = name;
+ Display = display;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets operation name: {provider}/{resource}/{operation}
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the object that describes the operation.
+ ///
+ [JsonProperty(PropertyName = "display")]
+ public OperationDisplay Display { get; set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationDisplay.cs
new file mode 100644
index 000000000000..625076452d30
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationDisplay.cs
@@ -0,0 +1,79 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The object that describes the operation.
+ ///
+ public partial class OperationDisplay
+ {
+ ///
+ /// Initializes a new instance of the OperationDisplay class.
+ ///
+ public OperationDisplay()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the OperationDisplay class.
+ ///
+ /// Friendly name of the resource
+ /// provider
+ /// Operation type: read, write, delete,
+ /// listKeys/action, etc.
+ /// Resource type on which the operation is
+ /// performed.
+ /// Friendly name of the operation
+ public OperationDisplay(string provider = default(string), string operation = default(string), string resource = default(string), string description = default(string))
+ {
+ Provider = provider;
+ Operation = operation;
+ Resource = resource;
+ Description = description;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets friendly name of the resource provider
+ ///
+ [JsonProperty(PropertyName = "provider")]
+ public string Provider { get; set; }
+
+ ///
+ /// Gets or sets operation type: read, write, delete, listKeys/action,
+ /// etc.
+ ///
+ [JsonProperty(PropertyName = "operation")]
+ public string Operation { get; set; }
+
+ ///
+ /// Gets or sets resource type on which the operation is performed.
+ ///
+ [JsonProperty(PropertyName = "resource")]
+ public string Resource { get; set; }
+
+ ///
+ /// Gets or sets friendly name of the operation
+ ///
+ [JsonProperty(PropertyName = "description")]
+ public string Description { get; set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationStatus.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationStatus.cs
new file mode 100644
index 000000000000..987b6edea9f2
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationStatus.cs
@@ -0,0 +1,77 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Asynchronous operation status
+ ///
+ public partial class OperationStatus : OperationStatusResult
+ {
+ ///
+ /// Initializes a new instance of the OperationStatus class.
+ ///
+ public OperationStatus()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the OperationStatus class.
+ ///
+ /// Operation status.
+ /// Fully qualified ID for the async
+ /// operation.
+ /// Name of the async operation.
+ /// Percent of the operation that is
+ /// complete.
+ /// The start time of the operation.
+ /// The end time of the operation.
+ /// The operations list.
+ /// If present, details of the operation
+ /// error.
+ /// Additional properties from RP, only when
+ /// operation is successful
+ public OperationStatus(string status, string id = default(string), string name = default(string), double? percentComplete = default(double?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList operations = default(IList), ErrorDetail error = default(ErrorDetail), IDictionary properties = default(IDictionary))
+ : base(status, id, name, percentComplete, startTime, endTime, operations, error)
+ {
+ Properties = properties;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets additional properties from RP, only when operation is
+ /// successful
+ ///
+ [JsonProperty(PropertyName = "properties")]
+ public IDictionary Properties { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public override void Validate()
+ {
+ base.Validate();
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationStatusResult.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationStatusResult.cs
new file mode 100644
index 000000000000..98bdbf5ffe98
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/OperationStatusResult.cs
@@ -0,0 +1,147 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The current status of an async operation.
+ ///
+ public partial class OperationStatusResult
+ {
+ ///
+ /// Initializes a new instance of the OperationStatusResult class.
+ ///
+ public OperationStatusResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the OperationStatusResult class.
+ ///
+ /// Operation status.
+ /// Fully qualified ID for the async
+ /// operation.
+ /// Name of the async operation.
+ /// Percent of the operation that is
+ /// complete.
+ /// The start time of the operation.
+ /// The end time of the operation.
+ /// The operations list.
+ /// If present, details of the operation
+ /// error.
+ public OperationStatusResult(string status, string id = default(string), string name = default(string), double? percentComplete = default(double?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList operations = default(IList), ErrorDetail error = default(ErrorDetail))
+ {
+ Id = id;
+ Name = name;
+ Status = status;
+ PercentComplete = percentComplete;
+ StartTime = startTime;
+ EndTime = endTime;
+ Operations = operations;
+ Error = error;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets fully qualified ID for the async operation.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets name of the async operation.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets operation status.
+ ///
+ [JsonProperty(PropertyName = "status")]
+ public string Status { get; set; }
+
+ ///
+ /// Gets or sets percent of the operation that is complete.
+ ///
+ [JsonProperty(PropertyName = "percentComplete")]
+ public double? PercentComplete { get; set; }
+
+ ///
+ /// Gets or sets the start time of the operation.
+ ///
+ [JsonProperty(PropertyName = "startTime")]
+ public System.DateTime? StartTime { get; set; }
+
+ ///
+ /// Gets or sets the end time of the operation.
+ ///
+ [JsonProperty(PropertyName = "endTime")]
+ public System.DateTime? EndTime { get; set; }
+
+ ///
+ /// Gets or sets the operations list.
+ ///
+ [JsonProperty(PropertyName = "operations")]
+ public IList Operations { get; set; }
+
+ ///
+ /// Gets or sets if present, details of the operation error.
+ ///
+ [JsonProperty(PropertyName = "error")]
+ public ErrorDetail Error { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Status == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Status");
+ }
+ if (PercentComplete != null)
+ {
+ if (PercentComplete > 100)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMaximum, "PercentComplete", 100);
+ }
+ if (PercentComplete < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "PercentComplete", 0);
+ }
+ }
+ if (Operations != null)
+ {
+ foreach (var element in Operations)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Page.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Page.cs
new file mode 100644
index 000000000000..3ca1beacc777
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Page.cs
@@ -0,0 +1,53 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+
+ ///
+ /// Defines a page in Azure responses.
+ ///
+ /// Type of the page content items
+ [JsonObject]
+ public class Page : IPage
+ {
+ ///
+ /// Gets the link to the next page.
+ ///
+ [JsonProperty("nextLink")]
+ public string NextPageLink { get; private set; }
+
+ [JsonProperty("value")]
+ private IList Items{ get; set; }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ public IEnumerator GetEnumerator()
+ {
+ return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator();
+ }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Page1.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Page1.cs
new file mode 100644
index 000000000000..b8acb12689af
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/Page1.cs
@@ -0,0 +1,53 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+
+ ///
+ /// Defines a page in Azure responses.
+ ///
+ /// Type of the page content items
+ [JsonObject]
+ public class Page1 : IPage
+ {
+ ///
+ /// Gets the link to the next page.
+ ///
+ [JsonProperty("")]
+ public string NextPageLink { get; private set; }
+
+ [JsonProperty("value")]
+ private IList Items{ get; set; }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ public IEnumerator GetEnumerator()
+ {
+ return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator();
+ }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpoint.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpoint.cs
new file mode 100644
index 000000000000..a8319943c05b
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpoint.cs
@@ -0,0 +1,51 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The Private Endpoint resource.
+ ///
+ public partial class PrivateEndpoint
+ {
+ ///
+ /// Initializes a new instance of the PrivateEndpoint class.
+ ///
+ public PrivateEndpoint()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PrivateEndpoint class.
+ ///
+ /// The ARM identifier for Private Endpoint
+ public PrivateEndpoint(string id = default(string))
+ {
+ Id = id;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the ARM identifier for Private Endpoint
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs
new file mode 100644
index 000000000000..a6c8bd993f68
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs
@@ -0,0 +1,98 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The Private Endpoint Connection resource.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class PrivateEndpointConnection : Resource
+ {
+ ///
+ /// Initializes a new instance of the PrivateEndpointConnection class.
+ ///
+ public PrivateEndpointConnection()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PrivateEndpointConnection class.
+ ///
+ /// A collection of
+ /// information about the state of the connection between service
+ /// consumer and provider.
+ /// Fully qualified resource ID for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. E.g.
+ /// "Microsoft.Compute/virtualMachines" or
+ /// "Microsoft.Storage/storageAccounts"
+ /// The resource of private end
+ /// point.
+ /// The provisioning state of the
+ /// private endpoint connection resource. Possible values include:
+ /// 'Succeeded', 'Creating', 'Deleting', 'Failed'
+ public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string))
+ : base(id, name, type)
+ {
+ PrivateEndpoint = privateEndpoint;
+ PrivateLinkServiceConnectionState = privateLinkServiceConnectionState;
+ ProvisioningState = provisioningState;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the resource of private end point.
+ ///
+ [JsonProperty(PropertyName = "properties.privateEndpoint")]
+ public PrivateEndpoint PrivateEndpoint { get; set; }
+
+ ///
+ /// Gets or sets a collection of information about the state of the
+ /// connection between service consumer and provider.
+ ///
+ [JsonProperty(PropertyName = "properties.privateLinkServiceConnectionState")]
+ public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; }
+
+ ///
+ /// Gets or sets the provisioning state of the private endpoint
+ /// connection resource. Possible values include: 'Succeeded',
+ /// 'Creating', 'Deleting', 'Failed'
+ ///
+ [JsonProperty(PropertyName = "properties.provisioningState")]
+ public string ProvisioningState { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (PrivateLinkServiceConnectionState == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "PrivateLinkServiceConnectionState");
+ }
+ }
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointConnectionProvisioningState.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointConnectionProvisioningState.cs
new file mode 100644
index 000000000000..20e6c5c1571b
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointConnectionProvisioningState.cs
@@ -0,0 +1,24 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+
+ ///
+ /// Defines values for PrivateEndpointConnectionProvisioningState.
+ ///
+ public static class PrivateEndpointConnectionProvisioningState
+ {
+ public const string Succeeded = "Succeeded";
+ public const string Creating = "Creating";
+ public const string Deleting = "Deleting";
+ public const string Failed = "Failed";
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointServiceConnectionStatus.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointServiceConnectionStatus.cs
new file mode 100644
index 000000000000..b08fdb2490de
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateEndpointServiceConnectionStatus.cs
@@ -0,0 +1,23 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+
+ ///
+ /// Defines values for PrivateEndpointServiceConnectionStatus.
+ ///
+ public static class PrivateEndpointServiceConnectionStatus
+ {
+ public const string Pending = "Pending";
+ public const string Approved = "Approved";
+ public const string Rejected = "Rejected";
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateLinkResource.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateLinkResource.cs
new file mode 100644
index 000000000000..d7671d38d7b7
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateLinkResource.cs
@@ -0,0 +1,81 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A private link resource
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class PrivateLinkResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the PrivateLinkResource class.
+ ///
+ public PrivateLinkResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PrivateLinkResource class.
+ ///
+ /// Fully qualified resource ID for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. E.g.
+ /// "Microsoft.Compute/virtualMachines" or
+ /// "Microsoft.Storage/storageAccounts"
+ /// The private link resource group id.
+ /// The private link resource required
+ /// member names.
+ /// The private link resource Private
+ /// link DNS zone name.
+ public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList))
+ : base(id, name, type)
+ {
+ GroupId = groupId;
+ RequiredMembers = requiredMembers;
+ RequiredZoneNames = requiredZoneNames;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the private link resource group id.
+ ///
+ [JsonProperty(PropertyName = "properties.groupId")]
+ public string GroupId { get; private set; }
+
+ ///
+ /// Gets the private link resource required member names.
+ ///
+ [JsonProperty(PropertyName = "properties.requiredMembers")]
+ public IList RequiredMembers { get; private set; }
+
+ ///
+ /// Gets or sets the private link resource Private link DNS zone name.
+ ///
+ [JsonProperty(PropertyName = "properties.requiredZoneNames")]
+ public IList RequiredZoneNames { get; set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs
new file mode 100644
index 000000000000..6fc87e15d277
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PrivateLinkServiceConnectionState.cs
@@ -0,0 +1,77 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A collection of information about the state of the connection between
+ /// service consumer and provider.
+ ///
+ public partial class PrivateLinkServiceConnectionState
+ {
+ ///
+ /// Initializes a new instance of the PrivateLinkServiceConnectionState
+ /// class.
+ ///
+ public PrivateLinkServiceConnectionState()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the PrivateLinkServiceConnectionState
+ /// class.
+ ///
+ /// Indicates whether the connection has been
+ /// Approved/Rejected/Removed by the owner of the service. Possible
+ /// values include: 'Pending', 'Approved', 'Rejected'
+ /// The reason for approval/rejection of the
+ /// connection.
+ /// A message indicating if changes on
+ /// the service provider require any updates on the consumer.
+ public PrivateLinkServiceConnectionState(string status = default(string), string description = default(string), string actionsRequired = default(string))
+ {
+ Status = status;
+ Description = description;
+ ActionsRequired = actionsRequired;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets indicates whether the connection has been
+ /// Approved/Rejected/Removed by the owner of the service. Possible
+ /// values include: 'Pending', 'Approved', 'Rejected'
+ ///
+ [JsonProperty(PropertyName = "status")]
+ public string Status { get; set; }
+
+ ///
+ /// Gets or sets the reason for approval/rejection of the connection.
+ ///
+ [JsonProperty(PropertyName = "description")]
+ public string Description { get; set; }
+
+ ///
+ /// Gets or sets a message indicating if changes on the service
+ /// provider require any updates on the consumer.
+ ///
+ [JsonProperty(PropertyName = "actionsRequired")]
+ public string ActionsRequired { get; set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ProvisioningState.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ProvisioningState.cs
new file mode 100644
index 000000000000..635aaad09a61
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ProvisioningState.cs
@@ -0,0 +1,32 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+
+ ///
+ /// Defines values for ProvisioningState.
+ ///
+ public static class ProvisioningState
+ {
+ public const string Creating = "Creating";
+ public const string Deleting = "Deleting";
+ public const string Disabled = "Disabled";
+ public const string Failed = "Failed";
+ public const string Linking = "Linking";
+ public const string Provisioning = "Provisioning";
+ public const string RecoveringScaleFailure = "RecoveringScaleFailure";
+ public const string Scaling = "Scaling";
+ public const string Succeeded = "Succeeded";
+ public const string Unlinking = "Unlinking";
+ public const string Unprovisioning = "Unprovisioning";
+ public const string Updating = "Updating";
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ProxyResource.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ProxyResource.cs
new file mode 100644
index 000000000000..609ad08d4363
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/ProxyResource.cs
@@ -0,0 +1,53 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using System.Linq;
+
+ ///
+ /// Proxy Resource
+ ///
+ ///
+ /// The resource model definition for a Azure Resource Manager proxy
+ /// resource. It will not have tags and a location
+ ///
+ public partial class ProxyResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the ProxyResource class.
+ ///
+ public ProxyResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ProxyResource class.
+ ///
+ /// Fully qualified resource ID for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. E.g.
+ /// "Microsoft.Compute/virtualMachines" or
+ /// "Microsoft.Storage/storageAccounts"
+ public ProxyResource(string id = default(string), string name = default(string), string type = default(string))
+ : base(id, name, type)
+ {
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PublicNetworkAccess.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PublicNetworkAccess.cs
new file mode 100644
index 000000000000..7950acce208e
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/PublicNetworkAccess.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+
+ ///
+ /// Defines values for PublicNetworkAccess.
+ ///
+ public static class PublicNetworkAccess
+ {
+ public const string Enabled = "Enabled";
+ public const string Disabled = "Disabled";
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RebootType.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RebootType.cs
new file mode 100644
index 000000000000..e55ca58af5bc
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RebootType.cs
@@ -0,0 +1,23 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+
+ ///
+ /// Defines values for RebootType.
+ ///
+ public static class RebootType
+ {
+ public const string PrimaryNode = "PrimaryNode";
+ public const string SecondaryNode = "SecondaryNode";
+ public const string AllNodes = "AllNodes";
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisAccessKeys.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisAccessKeys.cs
new file mode 100644
index 000000000000..6036c9b22329
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisAccessKeys.cs
@@ -0,0 +1,63 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Redis cache access keys.
+ ///
+ public partial class RedisAccessKeys
+ {
+ ///
+ /// Initializes a new instance of the RedisAccessKeys class.
+ ///
+ public RedisAccessKeys()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RedisAccessKeys class.
+ ///
+ /// The current primary key that clients can
+ /// use to authenticate with Redis cache.
+ /// The current secondary key that clients
+ /// can use to authenticate with Redis cache.
+ public RedisAccessKeys(string primaryKey = default(string), string secondaryKey = default(string))
+ {
+ PrimaryKey = primaryKey;
+ SecondaryKey = secondaryKey;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the current primary key that clients can use to authenticate
+ /// with Redis cache.
+ ///
+ [JsonProperty(PropertyName = "primaryKey")]
+ public string PrimaryKey { get; private set; }
+
+ ///
+ /// Gets the current secondary key that clients can use to authenticate
+ /// with Redis cache.
+ ///
+ [JsonProperty(PropertyName = "secondaryKey")]
+ public string SecondaryKey { get; private set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisCommonPropertiesRedisConfiguration.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisCommonPropertiesRedisConfiguration.cs
new file mode 100644
index 000000000000..ab24614d8029
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisCommonPropertiesRedisConfiguration.cs
@@ -0,0 +1,218 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// All Redis Settings. Few possible keys:
+ /// rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value
+ /// etc.
+ ///
+ public partial class RedisCommonPropertiesRedisConfiguration
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RedisCommonPropertiesRedisConfiguration class.
+ ///
+ public RedisCommonPropertiesRedisConfiguration()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RedisCommonPropertiesRedisConfiguration class.
+ ///
+ /// Unmatched properties from the
+ /// message are deserialized this collection
+ /// Specifies whether the rdb backup is
+ /// enabled
+ /// Specifies the frequency for
+ /// creating rdb backup in minutes. Valid values: (15, 30, 60, 360,
+ /// 720, 1440)
+ /// Specifies the maximum
+ /// number of snapshots for rdb backup
+ /// The storage account
+ /// connection string for storing rdb file
+ /// Specifies whether the aof backup is
+ /// enabled
+ /// First storage account
+ /// connection string
+ /// Second storage account
+ /// connection string
+ /// Value in megabytes
+ /// reserved for fragmentation per shard
+ /// The eviction strategy used when your
+ /// data won't fit within its memory limit.
+ /// Value in megabytes reserved for
+ /// non-cache usage per shard e.g. failover.
+ /// Value in megabytes reserved for
+ /// non-cache usage per shard e.g. failover.
+ /// The max clients config
+ /// Preferred auth method
+ /// to communicate to storage account used for data archive, specify
+ /// SAS or ManagedIdentity, default value is SAS
+ /// Preferred auth
+ /// method to communicate to storage account used for data persistence,
+ /// specify SAS or ManagedIdentity, default value is SAS
+ /// Zonal Configuration
+ /// Specifies whether the authentication
+ /// is disabled. Setting this property is highly discouraged from
+ /// security point of view.
+ public RedisCommonPropertiesRedisConfiguration(IDictionary additionalProperties = default(IDictionary), string rdbBackupEnabled = default(string), string rdbBackupFrequency = default(string), string rdbBackupMaxSnapshotCount = default(string), string rdbStorageConnectionString = default(string), string aofBackupEnabled = default(string), string aofStorageConnectionString0 = default(string), string aofStorageConnectionString1 = default(string), string maxfragmentationmemoryReserved = default(string), string maxmemoryPolicy = default(string), string maxmemoryReserved = default(string), string maxmemoryDelta = default(string), string maxclients = default(string), string preferredDataArchiveAuthMethod = default(string), string preferredDataPersistenceAuthMethod = default(string), string zonalConfiguration = default(string), string authnotrequired = default(string))
+ {
+ AdditionalProperties = additionalProperties;
+ RdbBackupEnabled = rdbBackupEnabled;
+ RdbBackupFrequency = rdbBackupFrequency;
+ RdbBackupMaxSnapshotCount = rdbBackupMaxSnapshotCount;
+ RdbStorageConnectionString = rdbStorageConnectionString;
+ AofBackupEnabled = aofBackupEnabled;
+ AofStorageConnectionString0 = aofStorageConnectionString0;
+ AofStorageConnectionString1 = aofStorageConnectionString1;
+ MaxfragmentationmemoryReserved = maxfragmentationmemoryReserved;
+ MaxmemoryPolicy = maxmemoryPolicy;
+ MaxmemoryReserved = maxmemoryReserved;
+ MaxmemoryDelta = maxmemoryDelta;
+ Maxclients = maxclients;
+ PreferredDataArchiveAuthMethod = preferredDataArchiveAuthMethod;
+ PreferredDataPersistenceAuthMethod = preferredDataPersistenceAuthMethod;
+ ZonalConfiguration = zonalConfiguration;
+ Authnotrequired = authnotrequired;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets unmatched properties from the message are deserialized
+ /// this collection
+ ///
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties { get; set; }
+
+ ///
+ /// Gets or sets specifies whether the rdb backup is enabled
+ ///
+ [JsonProperty(PropertyName = "rdb-backup-enabled")]
+ public string RdbBackupEnabled { get; set; }
+
+ ///
+ /// Gets or sets specifies the frequency for creating rdb backup in
+ /// minutes. Valid values: (15, 30, 60, 360, 720, 1440)
+ ///
+ [JsonProperty(PropertyName = "rdb-backup-frequency")]
+ public string RdbBackupFrequency { get; set; }
+
+ ///
+ /// Gets or sets specifies the maximum number of snapshots for rdb
+ /// backup
+ ///
+ [JsonProperty(PropertyName = "rdb-backup-max-snapshot-count")]
+ public string RdbBackupMaxSnapshotCount { get; set; }
+
+ ///
+ /// Gets or sets the storage account connection string for storing rdb
+ /// file
+ ///
+ [JsonProperty(PropertyName = "rdb-storage-connection-string")]
+ public string RdbStorageConnectionString { get; set; }
+
+ ///
+ /// Gets or sets specifies whether the aof backup is enabled
+ ///
+ [JsonProperty(PropertyName = "aof-backup-enabled")]
+ public string AofBackupEnabled { get; set; }
+
+ ///
+ /// Gets or sets first storage account connection string
+ ///
+ [JsonProperty(PropertyName = "aof-storage-connection-string-0")]
+ public string AofStorageConnectionString0 { get; set; }
+
+ ///
+ /// Gets or sets second storage account connection string
+ ///
+ [JsonProperty(PropertyName = "aof-storage-connection-string-1")]
+ public string AofStorageConnectionString1 { get; set; }
+
+ ///
+ /// Gets or sets value in megabytes reserved for fragmentation per
+ /// shard
+ ///
+ [JsonProperty(PropertyName = "maxfragmentationmemory-reserved")]
+ public string MaxfragmentationmemoryReserved { get; set; }
+
+ ///
+ /// Gets or sets the eviction strategy used when your data won't fit
+ /// within its memory limit.
+ ///
+ [JsonProperty(PropertyName = "maxmemory-policy")]
+ public string MaxmemoryPolicy { get; set; }
+
+ ///
+ /// Gets or sets value in megabytes reserved for non-cache usage per
+ /// shard e.g. failover.
+ ///
+ [JsonProperty(PropertyName = "maxmemory-reserved")]
+ public string MaxmemoryReserved { get; set; }
+
+ ///
+ /// Gets or sets value in megabytes reserved for non-cache usage per
+ /// shard e.g. failover.
+ ///
+ [JsonProperty(PropertyName = "maxmemory-delta")]
+ public string MaxmemoryDelta { get; set; }
+
+ ///
+ /// Gets the max clients config
+ ///
+ [JsonProperty(PropertyName = "maxclients")]
+ public string Maxclients { get; private set; }
+
+ ///
+ /// Gets preferred auth method to communicate to storage account used
+ /// for data archive, specify SAS or ManagedIdentity, default value is
+ /// SAS
+ ///
+ [JsonProperty(PropertyName = "preferred-data-archive-auth-method")]
+ public string PreferredDataArchiveAuthMethod { get; private set; }
+
+ ///
+ /// Gets or sets preferred auth method to communicate to storage
+ /// account used for data persistence, specify SAS or ManagedIdentity,
+ /// default value is SAS
+ ///
+ [JsonProperty(PropertyName = "preferred-data-persistence-auth-method")]
+ public string PreferredDataPersistenceAuthMethod { get; set; }
+
+ ///
+ /// Gets zonal Configuration
+ ///
+ [JsonProperty(PropertyName = "zonal-configuration")]
+ public string ZonalConfiguration { get; private set; }
+
+ ///
+ /// Gets or sets specifies whether the authentication is disabled.
+ /// Setting this property is highly discouraged from security point of
+ /// view.
+ ///
+ [JsonProperty(PropertyName = "authnotrequired")]
+ public string Authnotrequired { get; set; }
+
+ }
+}
diff --git a/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisCreateParameters.cs b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisCreateParameters.cs
new file mode 100644
index 000000000000..7f2d64787429
--- /dev/null
+++ b/src/RedisCache/RedisCache.Management.Sdk/Generated/Models/RedisCreateParameters.cs
@@ -0,0 +1,257 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.RedisCache.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Parameters supplied to the Create Redis operation.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class RedisCreateParameters
+ {
+ ///
+ /// Initializes a new instance of the RedisCreateParameters class.
+ ///
+ public RedisCreateParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RedisCreateParameters class.
+ ///
+ /// The SKU of the Redis cache to deploy.
+ /// The geo-location where the resource
+ /// lives
+ /// All Redis Settings. Few possible
+ /// keys:
+ /// rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value
+ /// etc.
+ /// Redis version. This should be in the
+ /// form 'major[.minor]' (only 'major' is required) or the value
+ /// 'latest' which refers to the latest stable Redis version that is
+ /// available. Supported versions: 4.0, 6.0 (latest). Default value is
+ /// 'latest'.
+ /// Specifies whether the non-ssl Redis
+ /// server port (6379) is enabled.
+ /// The number of replicas to be
+ /// created per primary.
+ /// The number of replicas to be
+ /// created per primary.
+ /// A dictionary of tenant
+ /// settings
+ /// The number of shards to be created on a
+ /// Premium Cluster Cache.
+ /// Optional: requires clients to use a
+ /// specified TLS version (or higher) to connect (e,g, '1.0', '1.1',
+ /// '1.2'). Possible values include: '1.0', '1.1', '1.2'
+ /// Whether or not public endpoint
+ /// access is allowed for this cache. Value is optional but if passed
+ /// in, must be 'Enabled' or 'Disabled'. If 'Disabled', private
+ /// endpoints are the exclusive access method. Default value is
+ /// 'Enabled'. Possible values include: 'Enabled', 'Disabled'
+ /// The full resource ID of a subnet in a
+ /// virtual network to deploy the Redis cache in. Example format:
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
+ /// Static IP address. Optionally, may be
+ /// specified when deploying a Redis cache inside an existing Azure
+ /// Virtual Network; auto assigned by default.
+ /// A list of availability zones denoting where the
+ /// resource needs to come from.
+ /// Resource tags.
+ /// The identity of the resource.
+ public RedisCreateParameters(Sku sku, string location, RedisCommonPropertiesRedisConfiguration redisConfiguration = default(RedisCommonPropertiesRedisConfiguration), string redisVersion = default(string), bool? enableNonSslPort = default(bool?), int? replicasPerMaster = default(int?), int? replicasPerPrimary = default(int?), IDictionary tenantSettings = default(IDictionary), int? shardCount = default(int?), string minimumTlsVersion = default(string), string publicNetworkAccess = default(string), string subnetId = default(string), string staticIP = default(string), IList