diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/ControllerOperations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/ControllerOperations.cs
new file mode 100644
index 000000000000..26aba4ee54ed
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/ControllerOperations.cs
@@ -0,0 +1,1046 @@
+//
+// 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.DelegatedNetwork
+{
+ 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;
+
+ ///
+ /// ControllerOperations operations.
+ ///
+ internal partial class ControllerOperations : IServiceOperations, IControllerOperations
+ {
+ ///
+ /// Initializes a new instance of the ControllerOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ControllerOperations(DNCClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DNCClient
+ ///
+ public DNCClient Client { get; private set; }
+
+ ///
+ /// Gets details about the specified dnc controller.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// 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> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ 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("resourceName", resourceName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetDetails", 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.DelegatedNetwork/controller/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _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;
+ }
+
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, resourceName, controllerParameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Deletes the DNC controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Update dnc controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// 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> PatchWithHttpMessagesAsync(string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ 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 (controllerParameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "controllerParameters");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("resourceName", resourceName);
+ tracingParameters.Add("controllerParameters", controllerParameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Patch", 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.DelegatedNetwork/controller/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _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("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(controllerParameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(controllerParameters, 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;
+ }
+
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// 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 resourceName, ControllerTypeParameters controllerParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ 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 (controllerParameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "controllerParameters");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("resourceName", resourceName);
+ tracingParameters.Add("controllerParameters", controllerParameters);
+ 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.DelegatedNetwork/controller/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _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(controllerParameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(controllerParameters, 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 DNC controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ 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("resourceName", resourceName);
+ 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.DelegatedNetwork/controller/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _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 && (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;
+ }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/ControllerOperationsExtensions.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/ControllerOperationsExtensions.cs
new file mode 100644
index 000000000000..bdd52e7e27a6
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/ControllerOperationsExtensions.cs
@@ -0,0 +1,313 @@
+//
+// 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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for ControllerOperations.
+ ///
+ public static partial class ControllerOperationsExtensions
+ {
+ ///
+ /// Gets details about the specified dnc controller.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ public static DelegatedController GetDetails(this IControllerOperations operations, string resourceGroupName, string resourceName)
+ {
+ return operations.GetDetailsAsync(resourceGroupName, resourceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets details about the specified dnc controller.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetDetailsAsync(this IControllerOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ public static DelegatedController Create(this IControllerOperations operations, string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters)
+ {
+ return operations.CreateAsync(resourceGroupName, resourceName, controllerParameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateAsync(this IControllerOperations operations, string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, controllerParameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes the DNC controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ public static void Delete(this IControllerOperations operations, string resourceGroupName, string resourceName)
+ {
+ operations.DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes the DNC controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IControllerOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Update dnc controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ public static DelegatedController Patch(this IControllerOperations operations, string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters)
+ {
+ return operations.PatchAsync(resourceGroupName, resourceName, controllerParameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update dnc controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task PatchAsync(this IControllerOperations operations, string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PatchWithHttpMessagesAsync(resourceGroupName, resourceName, controllerParameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ public static DelegatedController BeginCreate(this IControllerOperations operations, string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters)
+ {
+ return operations.BeginCreateAsync(resourceGroupName, resourceName, controllerParameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginCreateAsync(this IControllerOperations operations, string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, resourceName, controllerParameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes the DNC controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ public static void BeginDelete(this IControllerOperations operations, string resourceGroupName, string resourceName)
+ {
+ operations.BeginDeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes the DNC controller
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginDeleteAsync(this IControllerOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DNCClient.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DNCClient.cs
new file mode 100644
index 000000000000..95e993fe8ad2
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DNCClient.cs
@@ -0,0 +1,379 @@
+//
+// 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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Microsoft.Rest.Serialization;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+
+ ///
+ /// DNC web api provides way to create, get and delete dnc controller
+ ///
+ public partial class DNCClient : ServiceClient, IDNCClient, IAzureClient
+ {
+ ///
+ /// The base URI of the service.
+ ///
+ public System.Uri BaseUri { get; set; }
+
+ ///
+ /// Gets or sets json serialization settings.
+ ///
+ public JsonSerializerSettings SerializationSettings { get; private set; }
+
+ ///
+ /// Gets or sets json deserialization settings.
+ ///
+ public JsonSerializerSettings DeserializationSettings { get; private set; }
+
+ ///
+ /// Credentials needed for the client to connect to Azure.
+ ///
+ public ServiceClientCredentials Credentials { get; private set; }
+
+ ///
+ /// A unique identifier for a Microsoft Azure subscription. The subscription ID
+ /// forms part of the URI for every service call.
+ ///
+ public string SubscriptionId { get; set; }
+
+ ///
+ /// The client API version.
+ ///
+ public string ApiVersion { get; private set; }
+
+ ///
+ /// The preferred language for the response.
+ ///
+ public string AcceptLanguage { get; set; }
+
+ ///
+ /// The retry timeout in seconds for Long Running Operations. Default value is
+ /// 30.
+ ///
+ public int? LongRunningOperationRetryTimeout { get; set; }
+
+ ///
+ /// Whether a unique x-ms-client-request-id should be generated. When set to
+ /// true a unique x-ms-client-request-id value is generated and included in
+ /// each request. Default is true.
+ ///
+ public bool? GenerateClientRequestId { get; set; }
+
+ ///
+ /// Gets the IControllerOperations.
+ ///
+ public virtual IControllerOperations Controller { get; private set; }
+
+ ///
+ /// Gets the IDelegatedSubnetServiceOperations.
+ ///
+ public virtual IDelegatedSubnetServiceOperations DelegatedSubnetService { get; private set; }
+
+ ///
+ /// Gets the IDelegatedNetworkOperations.
+ ///
+ public virtual IDelegatedNetworkOperations DelegatedNetwork { get; private set; }
+
+ ///
+ /// Gets the IOperations.
+ ///
+ public virtual IOperations Operations { get; private set; }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling DNCClient.Dispose(). False: will not dispose provided httpClient
+ protected DNCClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected DNCClient(params DelegatingHandler[] handlers) : base(handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected DNCClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ protected DNCClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ BaseUri = baseUri;
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ protected DNCClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ BaseUri = baseUri;
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DNCClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling DNCClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DNCClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DNCClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DNCClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the DNCClient class.
+ ///
+ ///
+ /// Optional. The base URI of the service.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public DNCClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ if (credentials == null)
+ {
+ throw new System.ArgumentNullException("credentials");
+ }
+ BaseUri = baseUri;
+ Credentials = credentials;
+ if (Credentials != null)
+ {
+ Credentials.InitializeServiceClient(this);
+ }
+ }
+
+ ///
+ /// An optional partial-method to perform custom initialization.
+ ///
+ partial void CustomInitialize();
+ ///
+ /// Initializes client properties.
+ ///
+ private void Initialize()
+ {
+ Controller = new ControllerOperations(this);
+ DelegatedSubnetService = new DelegatedSubnetServiceOperations(this);
+ DelegatedNetwork = new DelegatedNetworkOperations(this);
+ Operations = new Operations(this);
+ BaseUri = new System.Uri("https://management.azure.com");
+ ApiVersion = "2020-08-08-preview";
+ AcceptLanguage = "en-US";
+ LongRunningOperationRetryTimeout = 30;
+ GenerateClientRequestId = true;
+ SerializationSettings = new JsonSerializerSettings
+ {
+ Formatting = Newtonsoft.Json.Formatting.Indented,
+ DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
+ DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
+ NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
+ ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
+ {
+ new Iso8601TimeSpanConverter()
+ }
+ };
+ SerializationSettings.Converters.Add(new TransformationJsonConverter());
+ DeserializationSettings = new JsonSerializerSettings
+ {
+ DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
+ DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
+ NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
+ ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
+ ContractResolver = new ReadOnlyJsonContractResolver(),
+ Converters = new List
+ {
+ new Iso8601TimeSpanConverter()
+ }
+ };
+ CustomInitialize();
+ DeserializationSettings.Converters.Add(new TransformationJsonConverter());
+ DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
+ }
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedNetworkOperations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedNetworkOperations.cs
new file mode 100644
index 000000000000..e68efc8b504c
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedNetworkOperations.cs
@@ -0,0 +1,426 @@
+//
+// 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.DelegatedNetwork
+{
+ 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;
+
+ ///
+ /// DelegatedNetworkOperations operations.
+ ///
+ internal partial class DelegatedNetworkOperations : IServiceOperations, IDelegatedNetworkOperations
+ {
+ ///
+ /// Initializes a new instance of the DelegatedNetworkOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal DelegatedNetworkOperations(DNCClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DNCClient
+ ///
+ public DNCClient Client { get; private set; }
+
+ ///
+ /// Get all the delegatedController resources in a subscription.
+ ///
+ ///
+ /// 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> ListBySubscriptionWithHttpMessagesAsync(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");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/delegatedControllers").ToString();
+ _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;
+ }
+
+ ///
+ /// Get all the delegatedController resources in a resource group.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// 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> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, 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 (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.DelegatedNetwork/delegatedControllers").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("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/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedNetworkOperationsExtensions.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedNetworkOperationsExtensions.cs
new file mode 100644
index 000000000000..77248f8b39af
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedNetworkOperationsExtensions.cs
@@ -0,0 +1,91 @@
+//
+// 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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for DelegatedNetworkOperations.
+ ///
+ public static partial class DelegatedNetworkOperationsExtensions
+ {
+ ///
+ /// Get all the delegatedController resources in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static DelegatedControllers ListBySubscription(this IDelegatedNetworkOperations operations)
+ {
+ return operations.ListBySubscriptionAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get all the delegatedController resources in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListBySubscriptionAsync(this IDelegatedNetworkOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get all the delegatedController resources in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ public static DelegatedControllers ListByResourceGroup(this IDelegatedNetworkOperations operations, string resourceGroupName)
+ {
+ return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get all the delegatedController resources in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListByResourceGroupAsync(this IDelegatedNetworkOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedSubnetServiceOperations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedSubnetServiceOperations.cs
new file mode 100644
index 000000000000..6dc475d08cbb
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedSubnetServiceOperations.cs
@@ -0,0 +1,1670 @@
+//
+// 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.DelegatedNetwork
+{
+ 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;
+
+ ///
+ /// DelegatedSubnetServiceOperations operations.
+ ///
+ internal partial class DelegatedSubnetServiceOperations : IServiceOperations, IDelegatedSubnetServiceOperations
+ {
+ ///
+ /// Initializes a new instance of the DelegatedSubnetServiceOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal DelegatedSubnetServiceOperations(DNCClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DNCClient
+ ///
+ public DNCClient Client { get; private set; }
+
+ ///
+ /// Gets details about the specified dnc DelegatedSubnet Link.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// 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> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ if (vnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "vnetName");
+ }
+ if (vnetName != null)
+ {
+ if (vnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "vnetName", 90);
+ }
+ if (vnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "vnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(vnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "vnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (subnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subnetName");
+ }
+ if (subnetName != null)
+ {
+ if (subnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "subnetName", 90);
+ }
+ if (subnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "subnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(subnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "subnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ 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("resourceName", resourceName);
+ tracingParameters.Add("vnetName", vnetName);
+ tracingParameters.Add("subnetName", subnetName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetDetails", 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.Network/virtualNetworks/{vnetName}/subnets/{subnetName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName));
+ _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName));
+ _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;
+ }
+
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> PutDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginPutDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> PatchDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginPatchDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task DeleteDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get all the DelegatedSubnets resources in a subscription.
+ ///
+ ///
+ /// 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> ListBySubscriptionWithHttpMessagesAsync(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");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DelegatedNetwork/delegatedSubnetInstances").ToString();
+ _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;
+ }
+
+ ///
+ /// Get all the DelegatedSubnets resources in a resource group.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// 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> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, 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 (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.DelegatedNetwork/delegatedSubnetInstances").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("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;
+ }
+
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// 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> BeginPutDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ if (vnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "vnetName");
+ }
+ if (vnetName != null)
+ {
+ if (vnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "vnetName", 90);
+ }
+ if (vnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "vnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(vnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "vnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (subnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subnetName");
+ }
+ if (subnetName != null)
+ {
+ if (subnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "subnetName", 90);
+ }
+ if (subnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "subnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(subnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "subnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ 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 (delegatedSubnetParameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "delegatedSubnetParameters");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("resourceName", resourceName);
+ tracingParameters.Add("vnetName", vnetName);
+ tracingParameters.Add("subnetName", subnetName);
+ tracingParameters.Add("delegatedSubnetParameters", delegatedSubnetParameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginPutDetails", 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.Network/virtualNetworks/{vnetName}/subnets/{subnetName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName));
+ _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName));
+ _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(delegatedSubnetParameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(delegatedSubnetParameters, 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;
+ }
+
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// 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> BeginPatchDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ if (vnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "vnetName");
+ }
+ if (vnetName != null)
+ {
+ if (vnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "vnetName", 90);
+ }
+ if (vnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "vnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(vnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "vnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (subnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subnetName");
+ }
+ if (subnetName != null)
+ {
+ if (subnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "subnetName", 90);
+ }
+ if (subnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "subnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(subnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "subnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ 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 (delegatedSubnetParameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "delegatedSubnetParameters");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("resourceName", resourceName);
+ tracingParameters.Add("vnetName", vnetName);
+ tracingParameters.Add("subnetName", subnetName);
+ tracingParameters.Add("delegatedSubnetParameters", delegatedSubnetParameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginPatchDetails", 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.Network/virtualNetworks/{vnetName}/subnets/{subnetName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName));
+ _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName));
+ _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("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(delegatedSubnetParameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(delegatedSubnetParameters, 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;
+ }
+
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// 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 BeginDeleteDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (resourceName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceName");
+ }
+ if (resourceName != null)
+ {
+ if (resourceName.Length > 63)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63);
+ }
+ if (resourceName.Length < 3)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceName", 3);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-z][a-z0-9]*$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-z][a-z0-9]*$");
+ }
+ }
+ if (vnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "vnetName");
+ }
+ if (vnetName != null)
+ {
+ if (vnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "vnetName", 90);
+ }
+ if (vnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "vnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(vnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "vnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ if (subnetName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "subnetName");
+ }
+ if (subnetName != null)
+ {
+ if (subnetName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "subnetName", 90);
+ }
+ if (subnetName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "subnetName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(subnetName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "subnetName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ 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("resourceName", resourceName);
+ tracingParameters.Add("vnetName", vnetName);
+ tracingParameters.Add("subnetName", subnetName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteDetails", 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.Network/virtualNetworks/{vnetName}/subnets/{subnetName}/providers/Microsoft.DelegatedNetwork/delegatedSubnets/{resourceName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName));
+ _url = _url.Replace("{vnetName}", System.Uri.EscapeDataString(vnetName));
+ _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName));
+ _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 && (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;
+ }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedSubnetServiceOperationsExtensions.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedSubnetServiceOperationsExtensions.cs
new file mode 100644
index 000000000000..5fd7f4723838
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/DelegatedSubnetServiceOperationsExtensions.cs
@@ -0,0 +1,543 @@
+//
+// 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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for DelegatedSubnetServiceOperations.
+ ///
+ public static partial class DelegatedSubnetServiceOperationsExtensions
+ {
+ ///
+ /// Gets details about the specified dnc DelegatedSubnet Link.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ public static DelegatedSubnet GetDetails(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName)
+ {
+ return operations.GetDetailsAsync(resourceGroupName, resourceName, vnetName, subnetName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets details about the specified dnc DelegatedSubnet Link.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetDetailsAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ public static DelegatedSubnet PutDetails(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters)
+ {
+ return operations.PutDetailsAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task PutDetailsAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PutDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ public static DelegatedSubnet PatchDetails(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters)
+ {
+ return operations.PatchDetailsAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task PatchDetailsAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.PatchDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ public static void DeleteDetails(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName)
+ {
+ operations.DeleteDetailsAsync(resourceGroupName, resourceName, vnetName, subnetName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteDetailsAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Get all the DelegatedSubnets resources in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static DelegatedSubnetList ListBySubscription(this IDelegatedSubnetServiceOperations operations)
+ {
+ return operations.ListBySubscriptionAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get all the DelegatedSubnets resources in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListBySubscriptionAsync(this IDelegatedSubnetServiceOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get all the DelegatedSubnets resources in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ public static DelegatedSubnetList ListByResourceGroup(this IDelegatedSubnetServiceOperations operations, string resourceGroupName)
+ {
+ return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get all the DelegatedSubnets resources in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task ListByResourceGroupAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ public static DelegatedSubnet BeginPutDetails(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters)
+ {
+ return operations.BeginPutDetailsAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginPutDetailsAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginPutDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ public static DelegatedSubnet BeginPatchDetails(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters)
+ {
+ return operations.BeginPatchDetailsAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginPatchDetailsAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginPatchDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, delegatedSubnetParameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ public static void BeginDeleteDetails(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName)
+ {
+ operations.BeginDeleteDetailsAsync(resourceGroupName, resourceName, vnetName, subnetName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given DelegatedNetwork
+ /// resource is part. This name must be at least 1 character in length, and no
+ /// more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and a
+ /// maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1 character in
+ /// length, and no more than 90.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginDeleteDetailsAsync(this IDelegatedSubnetServiceOperations operations, string resourceGroupName, string resourceName, string vnetName, string subnetName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.BeginDeleteDetailsWithHttpMessagesAsync(resourceGroupName, resourceName, vnetName, subnetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IControllerOperations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IControllerOperations.cs
new file mode 100644
index 000000000000..c70a43fc33a8
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IControllerOperations.cs
@@ -0,0 +1,198 @@
+//
+// 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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ControllerOperations operations.
+ ///
+ public partial interface IControllerOperations
+ {
+ ///
+ /// Gets details about the specified dnc controller.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// 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> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// 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 resourceName, ControllerTypeParameters controllerParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the DNC controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update dnc controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// 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> PatchWithHttpMessagesAsync(string resourceGroupName, string resourceName, ControllerTypeParameters controllerParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create a dnc controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// controller type parameters
+ ///
+ ///
+ /// 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 resourceName, ControllerTypeParameters controllerParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes the DNC controller
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// 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 resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDNCClient.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDNCClient.cs
new file mode 100644
index 000000000000..ad8be4ab7e87
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDNCClient.cs
@@ -0,0 +1,94 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+
+ ///
+ /// DNC web api provides way to create, get and delete dnc controller
+ ///
+ public partial interface IDNCClient : 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; }
+
+ ///
+ /// A unique identifier for a Microsoft Azure subscription. The
+ /// subscription ID forms part of the URI for every service call.
+ ///
+ string SubscriptionId { get; set; }
+
+ ///
+ /// The 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 IControllerOperations.
+ ///
+ IControllerOperations Controller { get; }
+
+ ///
+ /// Gets the IDelegatedSubnetServiceOperations.
+ ///
+ IDelegatedSubnetServiceOperations DelegatedSubnetService { get; }
+
+ ///
+ /// Gets the IDelegatedNetworkOperations.
+ ///
+ IDelegatedNetworkOperations DelegatedNetwork { get; }
+
+ ///
+ /// Gets the IOperations.
+ ///
+ IOperations Operations { get; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDelegatedNetworkOperations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDelegatedNetworkOperations.cs
new file mode 100644
index 000000000000..fbf5b28175ef
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDelegatedNetworkOperations.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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// DelegatedNetworkOperations operations.
+ ///
+ public partial interface IDelegatedNetworkOperations
+ {
+ ///
+ /// Get all the delegatedController resources in a 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));
+ ///
+ /// Get all the delegatedController resources in a resource group.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// 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));
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDelegatedSubnetServiceOperations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDelegatedSubnetServiceOperations.cs
new file mode 100644
index 000000000000..bbba7c1d91ea
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IDelegatedSubnetServiceOperations.cs
@@ -0,0 +1,328 @@
+//
+// 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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// DelegatedSubnetServiceOperations operations.
+ ///
+ public partial interface IDelegatedSubnetServiceOperations
+ {
+ ///
+ /// Gets details about the specified dnc DelegatedSubnet Link.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// 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> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// 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> PutDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// 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> PatchDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// 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 DeleteDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get all the DelegatedSubnets resources in a 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));
+ ///
+ /// Get all the DelegatedSubnets resources in a resource group.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// 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));
+ ///
+ /// Put delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// 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> BeginPutDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Patch delegated subnet resource
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// Delegated subnet details.
+ ///
+ ///
+ /// 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> BeginPatchDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, DelegatedSubnetParameters delegatedSubnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete dnc DelegatedSubnet.
+ ///
+ ///
+ /// The name of the Azure Resource group of which a given
+ /// DelegatedNetwork resource is part. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the resource. It must be a minimum of 3 characters, and
+ /// a maximum of 63.
+ ///
+ ///
+ /// The name of the virtual network. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// The name of the delegated subnet. This name must be at least 1
+ /// character in length, and no more than 90.
+ ///
+ ///
+ /// 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 BeginDeleteDetailsWithHttpMessagesAsync(string resourceGroupName, string resourceName, string vnetName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IOperations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/IOperations.cs
new file mode 100644
index 000000000000..61c339088eb6
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/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.DelegatedNetwork
+{
+ 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 DelegatedNetwork service REST API
+ /// operations.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all of the available DelegatedNetwork service REST API
+ /// operations.
+ ///
+ ///
+ /// 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/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerResource.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerResource.cs
new file mode 100644
index 000000000000..0aa463c1551b
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerResource.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.DelegatedNetwork.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Represents an instance of an DNC controller resource.
+ ///
+ public partial class ControllerResource : IResource
+ {
+ ///
+ /// Initializes a new instance of the ControllerResource class.
+ ///
+ public ControllerResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ControllerResource class.
+ ///
+ /// An identifier that represents the DNC controller
+ /// resource.
+ /// The name of the DNC controller resource.
+ /// The type of the DNC controller
+ /// resource.(Microsoft.DelegatedNetwork/controller)
+ /// Location of the DNC controller
+ /// resource.
+ public ControllerResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ Location = location;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets an identifier that represents the DNC controller resource.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets the name of the DNC controller resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the type of the DNC controller
+ /// resource.(Microsoft.DelegatedNetwork/controller)
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets location of the DNC controller resource.
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerState.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerState.cs
new file mode 100644
index 000000000000..04fb6193b419
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerState.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.DelegatedNetwork.Models
+{
+
+ ///
+ /// Defines values for ControllerState.
+ ///
+ public static class ControllerState
+ {
+ public const string Deleting = "Deleting";
+ public const string Succeeded = "Succeeded";
+ public const string Failed = "Failed";
+ public const string Provisioning = "Provisioning";
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerTypeParameters.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerTypeParameters.cs
new file mode 100644
index 000000000000..0236ca56c782
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ControllerTypeParameters.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.DelegatedNetwork.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Details of controller type.
+ ///
+ public partial class ControllerTypeParameters
+ {
+ ///
+ /// Initializes a new instance of the ControllerTypeParameters class.
+ ///
+ public ControllerTypeParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ControllerTypeParameters class.
+ ///
+ /// Type of Delegated controller.
+ /// properties of kubernetes
+ /// clusters
+ public ControllerTypeParameters(string controllerType = default(string), IList kubernetesProperties = default(IList))
+ {
+ ControllerType = controllerType;
+ KubernetesProperties = kubernetesProperties;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets type of Delegated controller.
+ ///
+ [JsonProperty(PropertyName = "controllerType")]
+ public string ControllerType { get; set; }
+
+ ///
+ /// Gets or sets properties of kubernetes clusters
+ ///
+ [JsonProperty(PropertyName = "kubernetesProperties")]
+ public IList KubernetesProperties { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedController.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedController.cs
new file mode 100644
index 000000000000..8c63fcc4ed50
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedController.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.DelegatedNetwork.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Represents an instance of a DNC controller.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class DelegatedController : ControllerResource
+ {
+ ///
+ /// Initializes a new instance of the DelegatedController class.
+ ///
+ public DelegatedController()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DelegatedController class.
+ ///
+ /// An identifier that represents the DNC controller
+ /// resource.
+ /// The name of the DNC controller resource.
+ /// The type of the DNC controller
+ /// resource.(Microsoft.DelegatedNetwork/controller)
+ /// Location of the DNC controller
+ /// resource.
+ /// The current state of dnc controller resource.
+ /// Possible values include: 'Deleting', 'Succeeded', 'Failed',
+ /// 'Provisioning'
+ /// Type of dnc
+ /// controller.
+ /// Gets or sets resource GUID property of
+ /// the controller resource.
+ /// Get controller AAD ID.
+ /// Dnc Endpoint url.
+ public DelegatedController(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string state = default(string), string delegatedControllerType = default(string), string resourceGuid = default(string), string dncAppID = default(string), string dncEndpoint = default(string))
+ : base(id, name, type, location)
+ {
+ State = state;
+ DelegatedControllerType = delegatedControllerType;
+ ResourceGuid = resourceGuid;
+ DncAppID = dncAppID;
+ DncEndpoint = dncEndpoint;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the current state of dnc controller resource. Possible values
+ /// include: 'Deleting', 'Succeeded', 'Failed', 'Provisioning'
+ ///
+ [JsonProperty(PropertyName = "properties.state")]
+ public string State { get; private set; }
+
+ ///
+ /// Gets or sets type of dnc controller.
+ ///
+ [JsonProperty(PropertyName = "properties.type")]
+ public string DelegatedControllerType { get; set; }
+
+ ///
+ /// Gets or sets resource GUID property of the controller resource.
+ ///
+ [JsonProperty(PropertyName = "properties.resourceGuid")]
+ public string ResourceGuid { get; set; }
+
+ ///
+ /// Gets or sets get controller AAD ID.
+ ///
+ [JsonProperty(PropertyName = "properties.dncAppID")]
+ public string DncAppID { get; set; }
+
+ ///
+ /// Gets or sets dnc Endpoint url.
+ ///
+ [JsonProperty(PropertyName = "properties.dncEndpoint")]
+ public string DncEndpoint { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedControllers.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedControllers.cs
new file mode 100644
index 000000000000..79cbf4a38691
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedControllers.cs
@@ -0,0 +1,68 @@
+//
+// 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.DelegatedNetwork.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// An array of Delegated controller resources.
+ ///
+ public partial class DelegatedControllers
+ {
+ ///
+ /// Initializes a new instance of the DelegatedControllers class.
+ ///
+ public DelegatedControllers()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DelegatedControllers class.
+ ///
+ /// An array of Delegated controller
+ /// resources.
+ public DelegatedControllers(IList value)
+ {
+ Value = value;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets an array of Delegated controller resources.
+ ///
+ [JsonProperty(PropertyName = "value")]
+ public IList Value { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Value == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Value");
+ }
+ }
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnet.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnet.cs
new file mode 100644
index 000000000000..72ddd7c9e7a1
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnet.cs
@@ -0,0 +1,66 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.DelegatedNetwork.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Delegated subnet details
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class DelegatedSubnet : DelegatedSubnetResource
+ {
+ ///
+ /// Initializes a new instance of the DelegatedSubnet class.
+ ///
+ public DelegatedSubnet()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DelegatedSubnet class.
+ ///
+ /// An identifier that represents the DelegatedSubnet
+ /// resource.
+ /// The name of the DelegatedSubnet
+ /// resource.
+ /// The type of the DelegatedSubnet
+ /// resource.(Microsoft.DelegatedNetwork/delegatedSubnet)
+ /// Location of the DelegatedSubnet
+ /// resource.
+ /// The current state of delegated subnet resource.
+ /// Possible values include: 'Deleting', 'Succeeded', 'Failed',
+ /// 'Provisioning'
+ public DelegatedSubnet(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string state = default(string))
+ : base(id, name, type, location)
+ {
+ State = state;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the current state of delegated subnet resource. Possible
+ /// values include: 'Deleting', 'Succeeded', 'Failed', 'Provisioning'
+ ///
+ [JsonProperty(PropertyName = "properties.state")]
+ public string State { get; private set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetList.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetList.cs
new file mode 100644
index 000000000000..ea02c1c8dff6
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetList.cs
@@ -0,0 +1,68 @@
+//
+// 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.DelegatedNetwork.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// An array of Delegated subnets resources.
+ ///
+ public partial class DelegatedSubnetList
+ {
+ ///
+ /// Initializes a new instance of the DelegatedSubnetList class.
+ ///
+ public DelegatedSubnetList()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DelegatedSubnetList class.
+ ///
+ /// An array of Delegated subnets
+ /// resources.
+ public DelegatedSubnetList(IList value)
+ {
+ Value = value;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets an array of Delegated subnets resources.
+ ///
+ [JsonProperty(PropertyName = "value")]
+ public IList Value { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Value == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Value");
+ }
+ }
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetParameters.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetParameters.cs
new file mode 100644
index 000000000000..b779a5292b38
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetParameters.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.DelegatedNetwork.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// DelegatedSubnet Parameters
+ ///
+ public partial class DelegatedSubnetParameters
+ {
+ ///
+ /// Initializes a new instance of the DelegatedSubnetParameters class.
+ ///
+ public DelegatedSubnetParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DelegatedSubnetParameters class.
+ ///
+ /// Delegated Network Controller ID
+ public DelegatedSubnetParameters(string controllerID = default(string))
+ {
+ ControllerID = controllerID;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets delegated Network Controller ID
+ ///
+ [JsonProperty(PropertyName = "controllerID")]
+ public string ControllerID { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetResource.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetResource.cs
new file mode 100644
index 000000000000..4ab3608d2f27
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetResource.cs
@@ -0,0 +1,82 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.DelegatedNetwork.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Represents an instance of a DelegatedSubnet resource.
+ ///
+ public partial class DelegatedSubnetResource : IResource
+ {
+ ///
+ /// Initializes a new instance of the DelegatedSubnetResource class.
+ ///
+ public DelegatedSubnetResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DelegatedSubnetResource class.
+ ///
+ /// An identifier that represents the DelegatedSubnet
+ /// resource.
+ /// The name of the DelegatedSubnet
+ /// resource.
+ /// The type of the DelegatedSubnet
+ /// resource.(Microsoft.DelegatedNetwork/delegatedSubnet)
+ /// Location of the DelegatedSubnet
+ /// resource.
+ public DelegatedSubnetResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ Location = location;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets an identifier that represents the DelegatedSubnet resource.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets the name of the DelegatedSubnet resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the type of the DelegatedSubnet
+ /// resource.(Microsoft.DelegatedNetwork/delegatedSubnet)
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets location of the DelegatedSubnet resource.
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetState.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetState.cs
new file mode 100644
index 000000000000..0e3302cd39a3
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/DelegatedSubnetState.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.DelegatedNetwork.Models
+{
+
+ ///
+ /// Defines values for DelegatedSubnetState.
+ ///
+ public static class DelegatedSubnetState
+ {
+ public const string Deleting = "Deleting";
+ public const string Succeeded = "Succeeded";
+ public const string Failed = "Failed";
+ public const string Provisioning = "Provisioning";
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorDefinition.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorDefinition.cs
new file mode 100644
index 000000000000..d5077d70b212
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorDefinition.cs
@@ -0,0 +1,71 @@
+//
+// 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.DelegatedNetwork.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Error definition.
+ ///
+ public partial class ErrorDefinition
+ {
+ ///
+ /// Initializes a new instance of the ErrorDefinition class.
+ ///
+ public ErrorDefinition()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorDefinition class.
+ ///
+ /// Service specific error code which serves as the
+ /// substatus for the HTTP error code.
+ /// Description of the error.
+ /// Internal error details.
+ public ErrorDefinition(string code = default(string), string message = default(string), IList details = default(IList))
+ {
+ Code = code;
+ Message = message;
+ Details = details;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets service specific error code which serves as the substatus for
+ /// the HTTP error code.
+ ///
+ [JsonProperty(PropertyName = "code")]
+ public string Code { get; private set; }
+
+ ///
+ /// Gets description of the error.
+ ///
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; private set; }
+
+ ///
+ /// Gets internal error details.
+ ///
+ [JsonProperty(PropertyName = "details")]
+ public IList Details { get; private set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorResponse.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorResponse.cs
new file mode 100644
index 000000000000..3c5a04fd45d8
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorResponse.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.DelegatedNetwork.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Error response.
+ ///
+ public partial class ErrorResponse
+ {
+ ///
+ /// Initializes a new instance of the ErrorResponse class.
+ ///
+ public ErrorResponse()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ErrorResponse class.
+ ///
+ /// Error description
+ public ErrorResponse(ErrorDefinition error = default(ErrorDefinition))
+ {
+ Error = error;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets error description
+ ///
+ [JsonProperty(PropertyName = "error")]
+ public ErrorDefinition Error { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorResponseException.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/ErrorResponseException.cs
new file mode 100644
index 000000000000..63da62060918
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/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.DelegatedNetwork.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/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/KubernetesProperties.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/KubernetesProperties.cs
new file mode 100644
index 000000000000..736ea5cfbe0b
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/KubernetesProperties.cs
@@ -0,0 +1,76 @@
+//
+// 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.DelegatedNetwork.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Properties of kubernetes cluster
+ ///
+ public partial class KubernetesProperties
+ {
+ ///
+ /// Initializes a new instance of the KubernetesProperties class.
+ ///
+ public KubernetesProperties()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the KubernetesProperties class.
+ ///
+ /// AAD ID used with apiserver
+ /// TenantID of server App ID
+ /// RootCA certificate of kubernetes
+ /// cluster
+ /// APIServer url
+ public KubernetesProperties(string serverAppID = default(string), string serverTenantID = default(string), string clusterRootCA = default(string), string apiServerEndpoint = default(string))
+ {
+ ServerAppID = serverAppID;
+ ServerTenantID = serverTenantID;
+ ClusterRootCA = clusterRootCA;
+ ApiServerEndpoint = apiServerEndpoint;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets AAD ID used with apiserver
+ ///
+ [JsonProperty(PropertyName = "serverAppID")]
+ public string ServerAppID { get; set; }
+
+ ///
+ /// Gets or sets tenantID of server App ID
+ ///
+ [JsonProperty(PropertyName = "serverTenantID")]
+ public string ServerTenantID { get; set; }
+
+ ///
+ /// Gets or sets rootCA certificate of kubernetes cluster
+ ///
+ [JsonProperty(PropertyName = "clusterRootCA")]
+ public string ClusterRootCA { get; set; }
+
+ ///
+ /// Gets or sets aPIServer url
+ ///
+ [JsonProperty(PropertyName = "apiServerEndpoint")]
+ public string ApiServerEndpoint { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/Operation.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/Operation.cs
new file mode 100644
index 000000000000..07e9a1ab8d16
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/Operation.cs
@@ -0,0 +1,86 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.DelegatedNetwork.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Microsoft.DelegatedNetwork REST API operation definition
+ ///
+ 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}.
+ /// Origin of the operation
+ /// Gets or sets a value indicating whether
+ /// the operation is a data action or not.
+ /// Operation properties display
+ /// Properties of the operation
+ public Operation(string name = default(string), string origin = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay), object properties = default(object))
+ {
+ Name = name;
+ Origin = origin;
+ IsDataAction = isDataAction;
+ Display = display;
+ Properties = properties;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets operation name: {provider}/{resource}/{operation}.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets or sets origin of the operation
+ ///
+ [JsonProperty(PropertyName = "origin")]
+ public string Origin { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the operation is a data
+ /// action or not.
+ ///
+ [JsonProperty(PropertyName = "isDataAction")]
+ public bool? IsDataAction { get; set; }
+
+ ///
+ /// Gets or sets operation properties display
+ ///
+ [JsonProperty(PropertyName = "display")]
+ public OperationDisplay Display { get; set; }
+
+ ///
+ /// Gets or sets properties of the operation
+ ///
+ [JsonProperty(PropertyName = "properties")]
+ public object Properties { get; set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/OperationDisplay.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/OperationDisplay.cs
new file mode 100644
index 000000000000..113ce0f7ef99
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/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.DelegatedNetwork.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The object that represents 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.
+ ///
+ /// Service provider:
+ /// Microsoft.DelegatedNetwork.
+ /// Resource on which the operation is
+ /// performed: controller, etc.
+ /// Operation type: create, get, delete,
+ /// etc.
+ /// Friendly description for the
+ /// operation,
+ public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string))
+ {
+ Provider = provider;
+ Resource = resource;
+ Operation = operation;
+ Description = description;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets service provider: Microsoft.DelegatedNetwork.
+ ///
+ [JsonProperty(PropertyName = "provider")]
+ public string Provider { get; private set; }
+
+ ///
+ /// Gets resource on which the operation is performed: controller, etc.
+ ///
+ [JsonProperty(PropertyName = "resource")]
+ public string Resource { get; private set; }
+
+ ///
+ /// Gets operation type: create, get, delete, etc.
+ ///
+ [JsonProperty(PropertyName = "operation")]
+ public string Operation { get; private set; }
+
+ ///
+ /// Gets friendly description for the operation,
+ ///
+ [JsonProperty(PropertyName = "description")]
+ public string Description { get; private set; }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/Page.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Models/Page.cs
new file mode 100644
index 000000000000..407b28dfcc68
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/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.DelegatedNetwork.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/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Operations.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Operations.cs
new file mode 100644
index 000000000000..38b8712efd4e
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/Operations.cs
@@ -0,0 +1,390 @@
+//
+// 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.DelegatedNetwork
+{
+ 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;
+
+ ///
+ /// Operations operations.
+ ///
+ internal partial class Operations : IServiceOperations, IOperations
+ {
+ ///
+ /// Initializes a new instance of the Operations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal Operations(DNCClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DNCClient
+ ///
+ public DNCClient Client { get; private set; }
+
+ ///
+ /// Lists all of the available DelegatedNetwork service REST API operations.
+ ///
+ ///
+ /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("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("/") ? "" : "/")), "providers/Microsoft.DelegatedNetwork/operations").ToString();
+ 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;
+ }
+
+ ///
+ /// Lists all of the available DelegatedNetwork service REST API operations.
+ ///
+ ///
+ /// 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/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/OperationsExtensions.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/OperationsExtensions.cs
new file mode 100644
index 000000000000..fa6c5d260c86
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/OperationsExtensions.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.DelegatedNetwork
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for Operations.
+ ///
+ public static partial class OperationsExtensions
+ {
+ ///
+ /// Lists all of the available DelegatedNetwork service REST API operations.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IPage List(this IOperations operations)
+ {
+ return operations.ListAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all of the available DelegatedNetwork service REST API operations.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all of the available DelegatedNetwork service REST API operations.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all of the available DelegatedNetwork service REST API operations.
+ ///
+ ///
+ /// 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 IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/SdkInfo_DNC.cs b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/SdkInfo_DNC.cs
new file mode 100644
index 000000000000..b154c5bfdfa1
--- /dev/null
+++ b/sdk/DelegatedNetwork/Microsoft.Azure.Management.DelegatedNetwork/src/Generated/SdkInfo_DNC.cs
@@ -0,0 +1,31 @@
+
+//
+// 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.DelegatedNetwork
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ internal static partial class SdkInfo
+ {
+ public static IEnumerable> ApiInfo_DNC
+ {
+ get
+ {
+ return new Tuple[]
+ {
+ new Tuple("DelegatedNetwork", "Controller", "2020-08-08-preview"),
+ new Tuple("DelegatedNetwork", "DelegatedNetwork", "2020-08-08-preview"),
+ new Tuple("DelegatedNetwork", "DelegatedSubnetService", "2020-08-08-preview"),
+ new Tuple("DelegatedNetwork", "Operations", "2020-08-08-preview"),
+ new Tuple("Network", "DelegatedSubnetService", "2020-08-08-preview"),
+ }.AsEnumerable();
+ }
+ }
+ }
+}