diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/EndpointsOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/EndpointsOperations.cs
new file mode 100644
index 000000000000..fe79300f0a04
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/EndpointsOperations.cs
@@ -0,0 +1,1040 @@
+//
+// 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.TrafficManager
+{
+ 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;
+
+ ///
+ /// EndpointsOperations operations.
+ ///
+ internal partial class EndpointsOperations : IServiceOperations, IEndpointsOperations
+ {
+ ///
+ /// Initializes a new instance of the EndpointsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal EndpointsOperations(TrafficManagerManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the TrafficManagerManagementClient
+ ///
+ public TrafficManagerManagementClient Client { get; private set; }
+
+ ///
+ /// Update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be updated. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the Update 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (endpointType == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointType");
+ }
+ if (endpointName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("endpointType", endpointType);
+ tracingParameters.Add("endpointName", endpointName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", 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/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _url = _url.Replace("{endpointType}", System.Uri.EscapeDataString(endpointType));
+ _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName));
+ _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(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint. Only AzureEndpoints,
+ /// ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointType, string endpointName, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (endpointType == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointType");
+ }
+ if (endpointName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("endpointType", endpointType);
+ tracingParameters.Add("endpointName", endpointName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _url = _url.Replace("{endpointType}", System.Uri.EscapeDataString(endpointType));
+ _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName));
+ _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be created or updated. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be created or updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the CreateOrUpdate
+ /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (endpointType == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointType");
+ }
+ if (endpointName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("endpointType", endpointType);
+ tracingParameters.Add("endpointName", endpointName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _url = _url.Replace("{endpointType}", System.Uri.EscapeDataString(endpointType));
+ _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // 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 a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be deleted. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be deleted.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointType, string endpointName, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (endpointType == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointType");
+ }
+ if (endpointName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "endpointName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("endpointType", endpointType);
+ tracingParameters.Add("endpointName", endpointName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _url = _url.Replace("{endpointType}", System.Uri.EscapeDataString(endpointType));
+ _url = _url.Replace("{endpointName}", System.Uri.EscapeDataString(endpointName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/EndpointsOperationsExtensions.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/EndpointsOperationsExtensions.cs
new file mode 100644
index 000000000000..ae179665b5d6
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/EndpointsOperationsExtensions.cs
@@ -0,0 +1,252 @@
+//
+// 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.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for EndpointsOperations.
+ ///
+ public static partial class EndpointsOperationsExtensions
+ {
+ ///
+ /// Update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be updated. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the Update operation.
+ ///
+ public static Endpoint Update(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters)
+ {
+ return operations.UpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be updated. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the Update operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint. Only AzureEndpoints,
+ /// ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint.
+ ///
+ public static Endpoint Get(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName)
+ {
+ return operations.GetAsync(resourceGroupName, profileName, endpointType, endpointName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint. Only AzureEndpoints,
+ /// ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be created or updated. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be created or updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the CreateOrUpdate
+ /// operation.
+ ///
+ public static Endpoint CreateOrUpdate(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be created or updated. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be created or updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the CreateOrUpdate
+ /// operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be deleted. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be deleted.
+ ///
+ public static void Delete(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName)
+ {
+ operations.DeleteAsync(resourceGroupName, profileName, endpointType, endpointName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes a Traffic Manager endpoint.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be deleted. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be deleted.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/GeographicHierarchiesOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/GeographicHierarchiesOperations.cs
new file mode 100644
index 000000000000..37bea0e40ec7
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/GeographicHierarchiesOperations.cs
@@ -0,0 +1,235 @@
+//
+// 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.TrafficManager
+{
+ 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;
+
+ ///
+ /// GeographicHierarchiesOperations operations.
+ ///
+ internal partial class GeographicHierarchiesOperations : IServiceOperations, IGeographicHierarchiesOperations
+ {
+ ///
+ /// Initializes a new instance of the GeographicHierarchiesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal GeographicHierarchiesOperations(TrafficManagerManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the TrafficManagerManagementClient
+ ///
+ public TrafficManagerManagementClient Client { get; private set; }
+
+ ///
+ /// Gets the default Geographic Hierarchy used by the Geographic traffic
+ /// routing method.
+ ///
+ ///
+ /// 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> GetDefaultWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // 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, "GetDefault", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Network/trafficManagerGeographicHierarchies/default").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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/GeographicHierarchiesOperationsExtensions.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/GeographicHierarchiesOperationsExtensions.cs
new file mode 100644
index 000000000000..8114d1450db4
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/GeographicHierarchiesOperationsExtensions.cs
@@ -0,0 +1,55 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for GeographicHierarchiesOperations.
+ ///
+ public static partial class GeographicHierarchiesOperationsExtensions
+ {
+ ///
+ /// Gets the default Geographic Hierarchy used by the Geographic traffic
+ /// routing method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static TrafficManagerGeographicHierarchy GetDefault(this IGeographicHierarchiesOperations operations)
+ {
+ return operations.GetDefaultAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets the default Geographic Hierarchy used by the Geographic traffic
+ /// routing method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetDefaultAsync(this IGeographicHierarchiesOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetDefaultWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/HeatMapOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/HeatMapOperations.cs
new file mode 100644
index 000000000000..2bcf4ed00696
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/HeatMapOperations.cs
@@ -0,0 +1,318 @@
+//
+// 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.TrafficManager
+{
+ 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;
+
+ ///
+ /// HeatMapOperations operations.
+ ///
+ internal partial class HeatMapOperations : IServiceOperations, IHeatMapOperations
+ {
+ ///
+ /// Initializes a new instance of the HeatMapOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal HeatMapOperations(TrafficManagerManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the TrafficManagerManagementClient
+ ///
+ public TrafficManagerManagementClient Client { get; private set; }
+
+ ///
+ /// Gets latest heatmap for Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The top left latitude,longitude pair of the rectangular viewport to query
+ /// for.
+ ///
+ ///
+ /// The bottom right latitude,longitude pair of the rectangular viewport to
+ /// query for.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string profileName, IList topLeft = default(IList), IList botRight = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (topLeft != null)
+ {
+ if (topLeft.Count > 2)
+ {
+ throw new ValidationException(ValidationRules.MaxItems, "topLeft", 2);
+ }
+ if (topLeft.Count < 2)
+ {
+ throw new ValidationException(ValidationRules.MinItems, "topLeft", 2);
+ }
+ }
+ if (botRight != null)
+ {
+ if (botRight.Count > 2)
+ {
+ throw new ValidationException(ValidationRules.MaxItems, "botRight", 2);
+ }
+ if (botRight.Count < 2)
+ {
+ throw new ValidationException(ValidationRules.MinItems, "botRight", 2);
+ }
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ string heatMapType = "default";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("heatMapType", heatMapType);
+ tracingParameters.Add("topLeft", topLeft);
+ tracingParameters.Add("botRight", botRight);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/{heatMapType}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _url = _url.Replace("{heatMapType}", System.Uri.EscapeDataString(heatMapType));
+ List _queryParameters = new List();
+ if (topLeft != null)
+ {
+ _queryParameters.Add(string.Format("topLeft={0}", System.Uri.EscapeDataString(string.Join(",", topLeft))));
+ }
+ if (botRight != null)
+ {
+ _queryParameters.Add(string.Format("botRight={0}", System.Uri.EscapeDataString(string.Join(",", botRight))));
+ }
+ 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/HeatMapOperationsExtensions.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/HeatMapOperationsExtensions.cs
new file mode 100644
index 000000000000..3ddfdc7371b8
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/HeatMapOperationsExtensions.cs
@@ -0,0 +1,83 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for HeatMapOperations.
+ ///
+ public static partial class HeatMapOperationsExtensions
+ {
+ ///
+ /// Gets latest heatmap for Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The top left latitude,longitude pair of the rectangular viewport to query
+ /// for.
+ ///
+ ///
+ /// The bottom right latitude,longitude pair of the rectangular viewport to
+ /// query for.
+ ///
+ public static HeatMapModel Get(this IHeatMapOperations operations, string resourceGroupName, string profileName, IList topLeft = default(IList), IList botRight = default(IList))
+ {
+ return operations.GetAsync(resourceGroupName, profileName, topLeft, botRight).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets latest heatmap for Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The top left latitude,longitude pair of the rectangular viewport to query
+ /// for.
+ ///
+ ///
+ /// The bottom right latitude,longitude pair of the rectangular viewport to
+ /// query for.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IHeatMapOperations operations, string resourceGroupName, string profileName, IList topLeft = default(IList), IList botRight = default(IList), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, profileName, topLeft, botRight, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IEndpointsOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IEndpointsOperations.cs
new file mode 100644
index 000000000000..df598080522c
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IEndpointsOperations.cs
@@ -0,0 +1,163 @@
+//
+// 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.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// EndpointsOperations operations.
+ ///
+ public partial interface IEndpointsOperations
+ {
+ ///
+ /// Update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be updated. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed
+ /// here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the Update
+ /// operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint. Only AzureEndpoints,
+ /// ExternalEndpoints and NestedEndpoints are allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointType, string endpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or update a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be created or updated.
+ /// Only AzureEndpoints, ExternalEndpoints and NestedEndpoints are
+ /// allowed here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be created or updated.
+ ///
+ ///
+ /// The Traffic Manager endpoint parameters supplied to the
+ /// CreateOrUpdate 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a Traffic Manager endpoint.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The type of the Traffic Manager endpoint to be deleted. Only
+ /// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed
+ /// here.
+ ///
+ ///
+ /// The name of the Traffic Manager endpoint to be deleted.
+ ///
+ ///
+ /// 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 profileName, string endpointType, string endpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IGeographicHierarchiesOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IGeographicHierarchiesOperations.cs
new file mode 100644
index 000000000000..cff406a92f71
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IGeographicHierarchiesOperations.cs
@@ -0,0 +1,47 @@
+//
+// 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.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// GeographicHierarchiesOperations operations.
+ ///
+ public partial interface IGeographicHierarchiesOperations
+ {
+ ///
+ /// Gets the default Geographic Hierarchy used by the Geographic
+ /// traffic routing method.
+ ///
+ ///
+ /// 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> GetDefaultWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IHeatMapOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IHeatMapOperations.cs
new file mode 100644
index 000000000000..79e63a3c18d1
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IHeatMapOperations.cs
@@ -0,0 +1,60 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// HeatMapOperations operations.
+ ///
+ public partial interface IHeatMapOperations
+ {
+ ///
+ /// Gets latest heatmap for Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The top left latitude,longitude pair of the rectangular viewport to
+ /// query for.
+ ///
+ ///
+ /// The bottom right latitude,longitude pair of the rectangular
+ /// viewport to query for.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string profileName, IList topLeft = default(IList), IList botRight = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IProfilesOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IProfilesOperations.cs
new file mode 100644
index 000000000000..42220fe1e879
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/IProfilesOperations.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.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ProfilesOperations operations.
+ ///
+ public partial interface IProfilesOperations
+ {
+ ///
+ /// Checks the availability of a Traffic Manager Relative DNS name.
+ ///
+ ///
+ /// The name of the resource.
+ ///
+ ///
+ /// The type of the resource.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CheckTrafficManagerRelativeDnsNameAvailabilityWithHttpMessagesAsync(string name = default(string), string type = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all Traffic Manager profiles within a resource group.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// 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));
+ ///
+ /// Lists all Traffic Manager profiles within 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));
+ ///
+ /// Gets a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string profileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or update a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the
+ /// CreateOrUpdate 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, Profile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile to be deleted.
+ ///
+ ///
+ /// 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 profileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the Update
+ /// operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, Profile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ITrafficManagerManagementClient.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ITrafficManagerManagementClient.cs
new file mode 100644
index 000000000000..05f15baaed5d
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ITrafficManagerManagementClient.cs
@@ -0,0 +1,97 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+
+ ///
+ ///
+ public partial interface ITrafficManagerManagementClient : 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; }
+
+ ///
+ /// The ID of the target subscription.
+ ///
+ string SubscriptionId { get; set; }
+
+ ///
+ /// The API version to use for this operation.
+ ///
+ 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 IEndpointsOperations.
+ ///
+ IEndpointsOperations Endpoints { get; }
+
+ ///
+ /// Gets the IProfilesOperations.
+ ///
+ IProfilesOperations Profiles { get; }
+
+ ///
+ /// Gets the IGeographicHierarchiesOperations.
+ ///
+ IGeographicHierarchiesOperations GeographicHierarchies { get; }
+
+ ///
+ /// Gets the IHeatMapOperations.
+ ///
+ IHeatMapOperations HeatMap { get; }
+
+ ///
+ /// Gets the ITrafficManagerUserMetricsKeysOperations.
+ ///
+ ITrafficManagerUserMetricsKeysOperations TrafficManagerUserMetricsKeys { get; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ITrafficManagerUserMetricsKeysOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ITrafficManagerUserMetricsKeysOperations.cs
new file mode 100644
index 000000000000..04d53a2054f5
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ITrafficManagerUserMetricsKeysOperations.cs
@@ -0,0 +1,84 @@
+//
+// 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.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// TrafficManagerUserMetricsKeysOperations operations.
+ ///
+ public partial interface ITrafficManagerUserMetricsKeysOperations
+ {
+ ///
+ /// Get the subscription-level key used for Real User Metrics
+ /// collection.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Create or update a subscription-level key used for Real User
+ /// Metrics collection.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateOrUpdateWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete a subscription-level key used for Real User Metrics
+ /// collection.
+ ///
+ ///
+ /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/AllowedEndpointRecordType.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/AllowedEndpointRecordType.cs
new file mode 100644
index 000000000000..8ed96234b9dc
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/AllowedEndpointRecordType.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.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for AllowedEndpointRecordType.
+ ///
+ public static class AllowedEndpointRecordType
+ {
+ public const string DomainName = "DomainName";
+ public const string IPv4Address = "IPv4Address";
+ public const string IPv6Address = "IPv6Address";
+ public const string Any = "Any";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/AlwaysServe.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/AlwaysServe.cs
new file mode 100644
index 000000000000..bddb6f2f51bc
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/AlwaysServe.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for AlwaysServe.
+ ///
+ public static class AlwaysServe
+ {
+ public const string Enabled = "Enabled";
+ public const string Disabled = "Disabled";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.cs
new file mode 100644
index 000000000000..1b4923bfa673
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/CheckTrafficManagerRelativeDnsNameAvailabilityParameters.cs
@@ -0,0 +1,61 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Parameters supplied to check Traffic Manager name operation.
+ ///
+ public partial class CheckTrafficManagerRelativeDnsNameAvailabilityParameters
+ {
+ ///
+ /// Initializes a new instance of the
+ /// CheckTrafficManagerRelativeDnsNameAvailabilityParameters class.
+ ///
+ public CheckTrafficManagerRelativeDnsNameAvailabilityParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// CheckTrafficManagerRelativeDnsNameAvailabilityParameters class.
+ ///
+ /// The name of the resource.
+ /// The type of the resource.
+ public CheckTrafficManagerRelativeDnsNameAvailabilityParameters(string name = default(string), string type = default(string))
+ {
+ Name = name;
+ Type = type;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the type of the resource.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/DeleteOperationResult.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/DeleteOperationResult.cs
new file mode 100644
index 000000000000..969d3bb44d7a
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/DeleteOperationResult.cs
@@ -0,0 +1,52 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The result of the request or operation.
+ ///
+ public partial class DeleteOperationResult
+ {
+ ///
+ /// Initializes a new instance of the DeleteOperationResult class.
+ ///
+ public DeleteOperationResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DeleteOperationResult class.
+ ///
+ /// The result of the operation or
+ /// request.
+ public DeleteOperationResult(bool? operationResult = default(bool?))
+ {
+ OperationResult = operationResult;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the result of the operation or request.
+ ///
+ [JsonProperty(PropertyName = "boolean")]
+ public bool? OperationResult { get; private set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/DnsConfig.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/DnsConfig.cs
new file mode 100644
index 000000000000..de09bce16b96
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/DnsConfig.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.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Class containing DNS settings in a Traffic Manager profile.
+ ///
+ public partial class DnsConfig
+ {
+ ///
+ /// Initializes a new instance of the DnsConfig class.
+ ///
+ public DnsConfig()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DnsConfig class.
+ ///
+ /// The relative DNS name provided by this
+ /// Traffic Manager profile. This value is combined with the DNS domain
+ /// name used by Azure Traffic Manager to form the fully-qualified
+ /// domain name (FQDN) of the profile.
+ /// The fully-qualified domain name (FQDN) of the
+ /// Traffic Manager profile. This is formed from the concatenation of
+ /// the RelativeName with the DNS domain used by Azure Traffic
+ /// Manager.
+ /// The DNS Time-To-Live (TTL), in seconds. This
+ /// informs the local DNS resolvers and DNS clients how long to cache
+ /// DNS responses provided by this Traffic Manager profile.
+ public DnsConfig(string relativeName = default(string), string fqdn = default(string), long? ttl = default(long?))
+ {
+ RelativeName = relativeName;
+ Fqdn = fqdn;
+ Ttl = ttl;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the relative DNS name provided by this Traffic Manager
+ /// profile. This value is combined with the DNS domain name used by
+ /// Azure Traffic Manager to form the fully-qualified domain name
+ /// (FQDN) of the profile.
+ ///
+ [JsonProperty(PropertyName = "relativeName")]
+ public string RelativeName { get; set; }
+
+ ///
+ /// Gets the fully-qualified domain name (FQDN) of the Traffic Manager
+ /// profile. This is formed from the concatenation of the RelativeName
+ /// with the DNS domain used by Azure Traffic Manager.
+ ///
+ [JsonProperty(PropertyName = "fqdn")]
+ public string Fqdn { get; private set; }
+
+ ///
+ /// Gets or sets the DNS Time-To-Live (TTL), in seconds. This informs
+ /// the local DNS resolvers and DNS clients how long to cache DNS
+ /// responses provided by this Traffic Manager profile.
+ ///
+ [JsonProperty(PropertyName = "ttl")]
+ public long? Ttl { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Endpoint.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Endpoint.cs
new file mode 100644
index 000000000000..02489dfa1f0c
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Endpoint.cs
@@ -0,0 +1,233 @@
+//
+// 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.TrafficManager.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Class representing a Traffic Manager endpoint.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class Endpoint : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the Endpoint class.
+ ///
+ public Endpoint()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Endpoint class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ /// The Azure Resource URI of the of the
+ /// endpoint. Not applicable to endpoints of type
+ /// 'ExternalEndpoints'.
+ /// The fully-qualified DNS name or IP address of
+ /// the endpoint. Traffic Manager returns this value in DNS responses
+ /// to direct traffic to this endpoint.
+ /// The status of the endpoint. If the
+ /// endpoint is Enabled, it is probed for endpoint health and is
+ /// included in the traffic routing method. Possible values include:
+ /// 'Enabled', 'Disabled'
+ /// The weight of this endpoint when using the
+ /// 'Weighted' traffic routing method. Possible values are from 1 to
+ /// 1000.
+ /// The priority of this endpoint when using the
+ /// 'Priority' traffic routing method. Possible values are from 1 to
+ /// 1000, lower values represent higher priority. This is an optional
+ /// parameter. If specified, it must be specified on all endpoints,
+ /// and no two endpoints can share the same priority value.
+ /// Specifies the location of the
+ /// external or nested endpoints when using the 'Performance' traffic
+ /// routing method.
+ /// The monitoring status of the
+ /// endpoint. Possible values include: 'CheckingEndpoint', 'Online',
+ /// 'Degraded', 'Disabled', 'Inactive', 'Stopped'
+ /// The minimum number of endpoints
+ /// that must be available in the child profile in order for the parent
+ /// profile to be considered available. Only applicable to endpoint of
+ /// type 'NestedEndpoints'.
+ /// The minimum number of IPv4 (DNS
+ /// record type A) endpoints that must be available in the child
+ /// profile in order for the parent profile to be considered available.
+ /// Only applicable to endpoint of type 'NestedEndpoints'.
+ /// The minimum number of IPv6 (DNS
+ /// record type AAAA) endpoints that must be available in the child
+ /// profile in order for the parent profile to be considered available.
+ /// Only applicable to endpoint of type 'NestedEndpoints'.
+ /// The list of countries/regions mapped to
+ /// this endpoint when using the 'Geographic' traffic routing method.
+ /// Please consult Traffic Manager Geographic documentation for a full
+ /// list of accepted values.
+ /// The list of subnets, IP addresses, and/or
+ /// address ranges mapped to this endpoint when using the 'Subnet'
+ /// traffic routing method. An empty list will match all ranges not
+ /// covered by other endpoints.
+ /// List of custom headers.
+ /// If Always Serve is enabled, probing for
+ /// endpoint health will be disabled and endpoints will be included in
+ /// the traffic routing method. Possible values include: 'Enabled',
+ /// 'Disabled'
+ public Endpoint(string id = default(string), string name = default(string), string type = default(string), string targetResourceId = default(string), string target = default(string), string endpointStatus = default(string), long? weight = default(long?), long? priority = default(long?), string endpointLocation = default(string), string endpointMonitorStatus = default(string), long? minChildEndpoints = default(long?), long? minChildEndpointsIPv4 = default(long?), long? minChildEndpointsIPv6 = default(long?), IList geoMapping = default(IList), IList subnets = default(IList), IList customHeaders = default(IList), string alwaysServe = default(string))
+ : base(id, name, type)
+ {
+ TargetResourceId = targetResourceId;
+ Target = target;
+ EndpointStatus = endpointStatus;
+ Weight = weight;
+ Priority = priority;
+ EndpointLocation = endpointLocation;
+ EndpointMonitorStatus = endpointMonitorStatus;
+ MinChildEndpoints = minChildEndpoints;
+ MinChildEndpointsIPv4 = minChildEndpointsIPv4;
+ MinChildEndpointsIPv6 = minChildEndpointsIPv6;
+ GeoMapping = geoMapping;
+ Subnets = subnets;
+ CustomHeaders = customHeaders;
+ AlwaysServe = alwaysServe;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the Azure Resource URI of the of the endpoint. Not
+ /// applicable to endpoints of type 'ExternalEndpoints'.
+ ///
+ [JsonProperty(PropertyName = "properties.targetResourceId")]
+ public string TargetResourceId { get; set; }
+
+ ///
+ /// Gets or sets the fully-qualified DNS name or IP address of the
+ /// endpoint. Traffic Manager returns this value in DNS responses to
+ /// direct traffic to this endpoint.
+ ///
+ [JsonProperty(PropertyName = "properties.target")]
+ public string Target { get; set; }
+
+ ///
+ /// Gets or sets the status of the endpoint. If the endpoint is
+ /// Enabled, it is probed for endpoint health and is included in the
+ /// traffic routing method. Possible values include: 'Enabled',
+ /// 'Disabled'
+ ///
+ [JsonProperty(PropertyName = "properties.endpointStatus")]
+ public string EndpointStatus { get; set; }
+
+ ///
+ /// Gets or sets the weight of this endpoint when using the 'Weighted'
+ /// traffic routing method. Possible values are from 1 to 1000.
+ ///
+ [JsonProperty(PropertyName = "properties.weight")]
+ public long? Weight { get; set; }
+
+ ///
+ /// Gets or sets the priority of this endpoint when using the
+ /// 'Priority' traffic routing method. Possible values are from 1 to
+ /// 1000, lower values represent higher priority. This is an optional
+ /// parameter. If specified, it must be specified on all endpoints,
+ /// and no two endpoints can share the same priority value.
+ ///
+ [JsonProperty(PropertyName = "properties.priority")]
+ public long? Priority { get; set; }
+
+ ///
+ /// Gets or sets specifies the location of the external or nested
+ /// endpoints when using the 'Performance' traffic routing method.
+ ///
+ [JsonProperty(PropertyName = "properties.endpointLocation")]
+ public string EndpointLocation { get; set; }
+
+ ///
+ /// Gets or sets the monitoring status of the endpoint. Possible values
+ /// include: 'CheckingEndpoint', 'Online', 'Degraded', 'Disabled',
+ /// 'Inactive', 'Stopped'
+ ///
+ [JsonProperty(PropertyName = "properties.endpointMonitorStatus")]
+ public string EndpointMonitorStatus { get; set; }
+
+ ///
+ /// Gets or sets the minimum number of endpoints that must be available
+ /// in the child profile in order for the parent profile to be
+ /// considered available. Only applicable to endpoint of type
+ /// 'NestedEndpoints'.
+ ///
+ [JsonProperty(PropertyName = "properties.minChildEndpoints")]
+ public long? MinChildEndpoints { get; set; }
+
+ ///
+ /// Gets or sets the minimum number of IPv4 (DNS record type A)
+ /// endpoints that must be available in the child profile in order for
+ /// the parent profile to be considered available. Only applicable to
+ /// endpoint of type 'NestedEndpoints'.
+ ///
+ [JsonProperty(PropertyName = "properties.minChildEndpointsIPv4")]
+ public long? MinChildEndpointsIPv4 { get; set; }
+
+ ///
+ /// Gets or sets the minimum number of IPv6 (DNS record type AAAA)
+ /// endpoints that must be available in the child profile in order for
+ /// the parent profile to be considered available. Only applicable to
+ /// endpoint of type 'NestedEndpoints'.
+ ///
+ [JsonProperty(PropertyName = "properties.minChildEndpointsIPv6")]
+ public long? MinChildEndpointsIPv6 { get; set; }
+
+ ///
+ /// Gets or sets the list of countries/regions mapped to this endpoint
+ /// when using the 'Geographic' traffic routing method. Please consult
+ /// Traffic Manager Geographic documentation for a full list of
+ /// accepted values.
+ ///
+ [JsonProperty(PropertyName = "properties.geoMapping")]
+ public IList GeoMapping { get; set; }
+
+ ///
+ /// Gets or sets the list of subnets, IP addresses, and/or address
+ /// ranges mapped to this endpoint when using the 'Subnet' traffic
+ /// routing method. An empty list will match all ranges not covered by
+ /// other endpoints.
+ ///
+ [JsonProperty(PropertyName = "properties.subnets")]
+ public IList Subnets { get; set; }
+
+ ///
+ /// Gets or sets list of custom headers.
+ ///
+ [JsonProperty(PropertyName = "properties.customHeaders")]
+ public IList CustomHeaders { get; set; }
+
+ ///
+ /// Gets or sets if Always Serve is enabled, probing for endpoint
+ /// health will be disabled and endpoints will be included in the
+ /// traffic routing method. Possible values include: 'Enabled',
+ /// 'Disabled'
+ ///
+ [JsonProperty(PropertyName = "properties.alwaysServe")]
+ public string AlwaysServe { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointMonitorStatus.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointMonitorStatus.cs
new file mode 100644
index 000000000000..336959093668
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointMonitorStatus.cs
@@ -0,0 +1,26 @@
+//
+// 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.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for EndpointMonitorStatus.
+ ///
+ public static class EndpointMonitorStatus
+ {
+ public const string CheckingEndpoint = "CheckingEndpoint";
+ public const string Online = "Online";
+ public const string Degraded = "Degraded";
+ public const string Disabled = "Disabled";
+ public const string Inactive = "Inactive";
+ public const string Stopped = "Stopped";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointPropertiesCustomHeadersItem.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointPropertiesCustomHeadersItem.cs
new file mode 100644
index 000000000000..975ed8009c4d
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointPropertiesCustomHeadersItem.cs
@@ -0,0 +1,61 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Custom header name and value.
+ ///
+ public partial class EndpointPropertiesCustomHeadersItem
+ {
+ ///
+ /// Initializes a new instance of the
+ /// EndpointPropertiesCustomHeadersItem class.
+ ///
+ public EndpointPropertiesCustomHeadersItem()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// EndpointPropertiesCustomHeadersItem class.
+ ///
+ /// Header name.
+ /// Header value.
+ public EndpointPropertiesCustomHeadersItem(string name = default(string), string value = default(string))
+ {
+ Name = name;
+ Value = value;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets header name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets header value.
+ ///
+ [JsonProperty(PropertyName = "value")]
+ public string Value { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointPropertiesSubnetsItem.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointPropertiesSubnetsItem.cs
new file mode 100644
index 000000000000..bbee6cd131b4
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointPropertiesSubnetsItem.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.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Subnet first address, scope, and/or last address.
+ ///
+ public partial class EndpointPropertiesSubnetsItem
+ {
+ ///
+ /// Initializes a new instance of the EndpointPropertiesSubnetsItem
+ /// class.
+ ///
+ public EndpointPropertiesSubnetsItem()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the EndpointPropertiesSubnetsItem
+ /// class.
+ ///
+ /// First address in the subnet.
+ /// Last address in the subnet.
+ /// Block size (number of leading bits in the
+ /// subnet mask).
+ public EndpointPropertiesSubnetsItem(string first = default(string), string last = default(string), int? scope = default(int?))
+ {
+ First = first;
+ Last = last;
+ Scope = scope;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets first address in the subnet.
+ ///
+ [JsonProperty(PropertyName = "first")]
+ public string First { get; set; }
+
+ ///
+ /// Gets or sets last address in the subnet.
+ ///
+ [JsonProperty(PropertyName = "last")]
+ public string Last { get; set; }
+
+ ///
+ /// Gets or sets block size (number of leading bits in the subnet
+ /// mask).
+ ///
+ [JsonProperty(PropertyName = "scope")]
+ public int? Scope { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointStatus.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointStatus.cs
new file mode 100644
index 000000000000..984703a0ae60
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/EndpointStatus.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for EndpointStatus.
+ ///
+ public static class EndpointStatus
+ {
+ public const string Enabled = "Enabled";
+ public const string Disabled = "Disabled";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/HeatMapEndpoint.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/HeatMapEndpoint.cs
new file mode 100644
index 000000000000..b07e8cdf0149
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/HeatMapEndpoint.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.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Class which is a sparse representation of a Traffic Manager endpoint.
+ ///
+ public partial class HeatMapEndpoint
+ {
+ ///
+ /// Initializes a new instance of the HeatMapEndpoint class.
+ ///
+ public HeatMapEndpoint()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the HeatMapEndpoint class.
+ ///
+ /// The ARM Resource ID of this Traffic
+ /// Manager endpoint.
+ /// A number uniquely identifying this
+ /// endpoint in query experiences.
+ public HeatMapEndpoint(string resourceId = default(string), int? endpointId = default(int?))
+ {
+ ResourceId = resourceId;
+ EndpointId = endpointId;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the ARM Resource ID of this Traffic Manager endpoint.
+ ///
+ [JsonProperty(PropertyName = "resourceId")]
+ public string ResourceId { get; set; }
+
+ ///
+ /// Gets or sets a number uniquely identifying this endpoint in query
+ /// experiences.
+ ///
+ [JsonProperty(PropertyName = "endpointId")]
+ public int? EndpointId { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/HeatMapModel.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/HeatMapModel.cs
new file mode 100644
index 000000000000..5b52875f3908
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/HeatMapModel.cs
@@ -0,0 +1,93 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Class representing a Traffic Manager HeatMap.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class HeatMapModel : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the HeatMapModel class.
+ ///
+ public HeatMapModel()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the HeatMapModel class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ /// The beginning of the time window for this
+ /// HeatMap, inclusive.
+ /// The ending of the time window for this
+ /// HeatMap, exclusive.
+ /// The endpoints used in this HeatMap
+ /// calculation.
+ /// The traffic flows produced in this
+ /// HeatMap calculation.
+ public HeatMapModel(string id = default(string), string name = default(string), string type = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList endpoints = default(IList), IList trafficFlows = default(IList))
+ : base(id, name, type)
+ {
+ StartTime = startTime;
+ EndTime = endTime;
+ Endpoints = endpoints;
+ TrafficFlows = trafficFlows;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the beginning of the time window for this HeatMap,
+ /// inclusive.
+ ///
+ [JsonProperty(PropertyName = "properties.startTime")]
+ public System.DateTime? StartTime { get; set; }
+
+ ///
+ /// Gets or sets the ending of the time window for this HeatMap,
+ /// exclusive.
+ ///
+ [JsonProperty(PropertyName = "properties.endTime")]
+ public System.DateTime? EndTime { get; set; }
+
+ ///
+ /// Gets or sets the endpoints used in this HeatMap calculation.
+ ///
+ [JsonProperty(PropertyName = "properties.endpoints")]
+ public IList Endpoints { get; set; }
+
+ ///
+ /// Gets or sets the traffic flows produced in this HeatMap
+ /// calculation.
+ ///
+ [JsonProperty(PropertyName = "properties.trafficFlows")]
+ public IList TrafficFlows { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfig.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfig.cs
new file mode 100644
index 000000000000..f6e139df83f3
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfig.cs
@@ -0,0 +1,143 @@
+//
+// 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.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Class containing endpoint monitoring settings in a Traffic Manager
+ /// profile.
+ ///
+ public partial class MonitorConfig
+ {
+ ///
+ /// Initializes a new instance of the MonitorConfig class.
+ ///
+ public MonitorConfig()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the MonitorConfig class.
+ ///
+ /// The profile-level monitoring
+ /// status of the Traffic Manager profile. Possible values include:
+ /// 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled',
+ /// 'Inactive'
+ /// The protocol (HTTP, HTTPS or TCP) used to
+ /// probe for endpoint health. Possible values include: 'HTTP',
+ /// 'HTTPS', 'TCP'
+ /// The TCP port used to probe for endpoint
+ /// health.
+ /// The path relative to the endpoint domain name
+ /// used to probe for endpoint health.
+ /// The monitor interval for endpoints
+ /// in this profile. This is the interval at which Traffic Manager will
+ /// check the health of each endpoint in this profile.
+ /// The monitor timeout for endpoints in
+ /// this profile. This is the time that Traffic Manager allows
+ /// endpoints in this profile to response to the health check.
+ /// The number of consecutive
+ /// failed health check that Traffic Manager tolerates before declaring
+ /// an endpoint in this profile Degraded after the next failed health
+ /// check.
+ /// List of custom headers.
+ /// List of expected status code
+ /// ranges.
+ public MonitorConfig(string profileMonitorStatus = default(string), string protocol = default(string), long? port = default(long?), string path = default(string), long? intervalInSeconds = default(long?), long? timeoutInSeconds = default(long?), long? toleratedNumberOfFailures = default(long?), IList customHeaders = default(IList), IList expectedStatusCodeRanges = default(IList))
+ {
+ ProfileMonitorStatus = profileMonitorStatus;
+ Protocol = protocol;
+ Port = port;
+ Path = path;
+ IntervalInSeconds = intervalInSeconds;
+ TimeoutInSeconds = timeoutInSeconds;
+ ToleratedNumberOfFailures = toleratedNumberOfFailures;
+ CustomHeaders = customHeaders;
+ ExpectedStatusCodeRanges = expectedStatusCodeRanges;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the profile-level monitoring status of the Traffic
+ /// Manager profile. Possible values include: 'CheckingEndpoints',
+ /// 'Online', 'Degraded', 'Disabled', 'Inactive'
+ ///
+ [JsonProperty(PropertyName = "profileMonitorStatus")]
+ public string ProfileMonitorStatus { get; set; }
+
+ ///
+ /// Gets or sets the protocol (HTTP, HTTPS or TCP) used to probe for
+ /// endpoint health. Possible values include: 'HTTP', 'HTTPS', 'TCP'
+ ///
+ [JsonProperty(PropertyName = "protocol")]
+ public string Protocol { get; set; }
+
+ ///
+ /// Gets or sets the TCP port used to probe for endpoint health.
+ ///
+ [JsonProperty(PropertyName = "port")]
+ public long? Port { get; set; }
+
+ ///
+ /// Gets or sets the path relative to the endpoint domain name used to
+ /// probe for endpoint health.
+ ///
+ [JsonProperty(PropertyName = "path")]
+ public string Path { get; set; }
+
+ ///
+ /// Gets or sets the monitor interval for endpoints in this profile.
+ /// This is the interval at which Traffic Manager will check the health
+ /// of each endpoint in this profile.
+ ///
+ [JsonProperty(PropertyName = "intervalInSeconds")]
+ public long? IntervalInSeconds { get; set; }
+
+ ///
+ /// Gets or sets the monitor timeout for endpoints in this profile.
+ /// This is the time that Traffic Manager allows endpoints in this
+ /// profile to response to the health check.
+ ///
+ [JsonProperty(PropertyName = "timeoutInSeconds")]
+ public long? TimeoutInSeconds { get; set; }
+
+ ///
+ /// Gets or sets the number of consecutive failed health check that
+ /// Traffic Manager tolerates before declaring an endpoint in this
+ /// profile Degraded after the next failed health check.
+ ///
+ [JsonProperty(PropertyName = "toleratedNumberOfFailures")]
+ public long? ToleratedNumberOfFailures { get; set; }
+
+ ///
+ /// Gets or sets list of custom headers.
+ ///
+ [JsonProperty(PropertyName = "customHeaders")]
+ public IList CustomHeaders { get; set; }
+
+ ///
+ /// Gets or sets list of expected status code ranges.
+ ///
+ [JsonProperty(PropertyName = "expectedStatusCodeRanges")]
+ public IList ExpectedStatusCodeRanges { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfigCustomHeadersItem.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfigCustomHeadersItem.cs
new file mode 100644
index 000000000000..e312216bb872
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfigCustomHeadersItem.cs
@@ -0,0 +1,61 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Custom header name and value.
+ ///
+ public partial class MonitorConfigCustomHeadersItem
+ {
+ ///
+ /// Initializes a new instance of the MonitorConfigCustomHeadersItem
+ /// class.
+ ///
+ public MonitorConfigCustomHeadersItem()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the MonitorConfigCustomHeadersItem
+ /// class.
+ ///
+ /// Header name.
+ /// Header value.
+ public MonitorConfigCustomHeadersItem(string name = default(string), string value = default(string))
+ {
+ Name = name;
+ Value = value;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets header name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets header value.
+ ///
+ [JsonProperty(PropertyName = "value")]
+ public string Value { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfigExpectedStatusCodeRangesItem.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfigExpectedStatusCodeRangesItem.cs
new file mode 100644
index 000000000000..bc7e238d4319
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorConfigExpectedStatusCodeRangesItem.cs
@@ -0,0 +1,61 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Min and max value of a status code range.
+ ///
+ public partial class MonitorConfigExpectedStatusCodeRangesItem
+ {
+ ///
+ /// Initializes a new instance of the
+ /// MonitorConfigExpectedStatusCodeRangesItem class.
+ ///
+ public MonitorConfigExpectedStatusCodeRangesItem()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// MonitorConfigExpectedStatusCodeRangesItem class.
+ ///
+ /// Min status code.
+ /// Max status code.
+ public MonitorConfigExpectedStatusCodeRangesItem(int? min = default(int?), int? max = default(int?))
+ {
+ Min = min;
+ Max = max;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets min status code.
+ ///
+ [JsonProperty(PropertyName = "min")]
+ public int? Min { get; set; }
+
+ ///
+ /// Gets or sets max status code.
+ ///
+ [JsonProperty(PropertyName = "max")]
+ public int? Max { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorProtocol.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorProtocol.cs
new file mode 100644
index 000000000000..451f02c78e79
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/MonitorProtocol.cs
@@ -0,0 +1,23 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for MonitorProtocol.
+ ///
+ public static class MonitorProtocol
+ {
+ public const string HTTP = "HTTP";
+ public const string HTTPS = "HTTPS";
+ public const string TCP = "TCP";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Page.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Page.cs
new file mode 100644
index 000000000000..af159a6a332b
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Page.cs
@@ -0,0 +1,53 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.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("")]
+ public string NextPageLink { get; private set; }
+
+ [JsonProperty("value")]
+ private IList Items{ get; set; }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ public IEnumerator GetEnumerator()
+ {
+ return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator();
+ }
+
+ ///
+ /// Returns an enumerator that iterates through the collection.
+ ///
+ /// A an enumerator that can be used to iterate through the collection.
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Profile.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Profile.cs
new file mode 100644
index 000000000000..2cbbef6f1f74
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Profile.cs
@@ -0,0 +1,143 @@
+//
+// 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.TrafficManager.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Class representing a Traffic Manager profile.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class Profile : TrackedResource
+ {
+ ///
+ /// Initializes a new instance of the Profile class.
+ ///
+ public Profile()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Profile class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ /// Resource tags.
+ /// The Azure Region where the resource
+ /// lives
+ /// The status of the Traffic Manager
+ /// profile. Possible values include: 'Enabled', 'Disabled'
+ /// The traffic routing method of
+ /// the Traffic Manager profile. Possible values include:
+ /// 'Performance', 'Priority', 'Weighted', 'Geographic', 'MultiValue',
+ /// 'Subnet'
+ /// The DNS settings of the Traffic Manager
+ /// profile.
+ /// The endpoint monitoring settings of the
+ /// Traffic Manager profile.
+ /// The list of endpoints in the Traffic
+ /// Manager profile.
+ /// Indicates whether Traffic
+ /// View is 'Enabled' or 'Disabled' for the Traffic Manager profile.
+ /// Null, indicates 'Disabled'. Enabling this feature will increase the
+ /// cost of the Traffic Manage profile. Possible values include:
+ /// 'Enabled', 'Disabled'
+ /// The list of allowed
+ /// endpoint record types.
+ /// Maximum number of endpoints to be returned
+ /// for MultiValue routing type.
+ public Profile(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string profileStatus = default(string), string trafficRoutingMethod = default(string), DnsConfig dnsConfig = default(DnsConfig), MonitorConfig monitorConfig = default(MonitorConfig), IList endpoints = default(IList), string trafficViewEnrollmentStatus = default(string), IList allowedEndpointRecordTypes = default(IList), long? maxReturn = default(long?))
+ : base(id, name, type, tags, location)
+ {
+ ProfileStatus = profileStatus;
+ TrafficRoutingMethod = trafficRoutingMethod;
+ DnsConfig = dnsConfig;
+ MonitorConfig = monitorConfig;
+ Endpoints = endpoints;
+ TrafficViewEnrollmentStatus = trafficViewEnrollmentStatus;
+ AllowedEndpointRecordTypes = allowedEndpointRecordTypes;
+ MaxReturn = maxReturn;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the status of the Traffic Manager profile. Possible
+ /// values include: 'Enabled', 'Disabled'
+ ///
+ [JsonProperty(PropertyName = "properties.profileStatus")]
+ public string ProfileStatus { get; set; }
+
+ ///
+ /// Gets or sets the traffic routing method of the Traffic Manager
+ /// profile. Possible values include: 'Performance', 'Priority',
+ /// 'Weighted', 'Geographic', 'MultiValue', 'Subnet'
+ ///
+ [JsonProperty(PropertyName = "properties.trafficRoutingMethod")]
+ public string TrafficRoutingMethod { get; set; }
+
+ ///
+ /// Gets or sets the DNS settings of the Traffic Manager profile.
+ ///
+ [JsonProperty(PropertyName = "properties.dnsConfig")]
+ public DnsConfig DnsConfig { get; set; }
+
+ ///
+ /// Gets or sets the endpoint monitoring settings of the Traffic
+ /// Manager profile.
+ ///
+ [JsonProperty(PropertyName = "properties.monitorConfig")]
+ public MonitorConfig MonitorConfig { get; set; }
+
+ ///
+ /// Gets or sets the list of endpoints in the Traffic Manager profile.
+ ///
+ [JsonProperty(PropertyName = "properties.endpoints")]
+ public IList Endpoints { get; set; }
+
+ ///
+ /// Gets or sets indicates whether Traffic View is 'Enabled' or
+ /// 'Disabled' for the Traffic Manager profile. Null, indicates
+ /// 'Disabled'. Enabling this feature will increase the cost of the
+ /// Traffic Manage profile. Possible values include: 'Enabled',
+ /// 'Disabled'
+ ///
+ [JsonProperty(PropertyName = "properties.trafficViewEnrollmentStatus")]
+ public string TrafficViewEnrollmentStatus { get; set; }
+
+ ///
+ /// Gets or sets the list of allowed endpoint record types.
+ ///
+ [JsonProperty(PropertyName = "properties.allowedEndpointRecordTypes")]
+ public IList AllowedEndpointRecordTypes { get; set; }
+
+ ///
+ /// Gets or sets maximum number of endpoints to be returned for
+ /// MultiValue routing type.
+ ///
+ [JsonProperty(PropertyName = "properties.maxReturn")]
+ public long? MaxReturn { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProfileMonitorStatus.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProfileMonitorStatus.cs
new file mode 100644
index 000000000000..a21d88124827
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProfileMonitorStatus.cs
@@ -0,0 +1,25 @@
+//
+// 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.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for ProfileMonitorStatus.
+ ///
+ public static class ProfileMonitorStatus
+ {
+ public const string CheckingEndpoints = "CheckingEndpoints";
+ public const string Online = "Online";
+ public const string Degraded = "Degraded";
+ public const string Disabled = "Disabled";
+ public const string Inactive = "Inactive";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProfileStatus.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProfileStatus.cs
new file mode 100644
index 000000000000..0f7c464d73a8
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProfileStatus.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for ProfileStatus.
+ ///
+ public static class ProfileStatus
+ {
+ public const string Enabled = "Enabled";
+ public const string Disabled = "Disabled";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProxyResource.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProxyResource.cs
new file mode 100644
index 000000000000..3bc78225bf24
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/ProxyResource.cs
@@ -0,0 +1,49 @@
+//
+// 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.TrafficManager.Models
+{
+ using System.Linq;
+
+ ///
+ /// The resource model definition for a ARM proxy resource. It will have
+ /// everything other than required location and tags
+ ///
+ public partial class ProxyResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the ProxyResource class.
+ ///
+ public ProxyResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ProxyResource class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ public ProxyResource(string id = default(string), string name = default(string), string type = default(string))
+ : base(id, name, type)
+ {
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/QueryExperience.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/QueryExperience.cs
new file mode 100644
index 000000000000..c346241fcb40
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/QueryExperience.cs
@@ -0,0 +1,83 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Class representing a Traffic Manager HeatMap query experience
+ /// properties.
+ ///
+ public partial class QueryExperience
+ {
+ ///
+ /// Initializes a new instance of the QueryExperience class.
+ ///
+ public QueryExperience()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the QueryExperience class.
+ ///
+ /// The id of the endpoint from the
+ /// 'endpoints' array which these queries were routed to.
+ /// The number of queries originating from
+ /// this location.
+ /// The latency experienced by queries
+ /// originating from this location.
+ public QueryExperience(int endpointId, int queryCount, double? latency = default(double?))
+ {
+ EndpointId = endpointId;
+ QueryCount = queryCount;
+ Latency = latency;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the id of the endpoint from the 'endpoints' array
+ /// which these queries were routed to.
+ ///
+ [JsonProperty(PropertyName = "endpointId")]
+ public int EndpointId { get; set; }
+
+ ///
+ /// Gets or sets the number of queries originating from this location.
+ ///
+ [JsonProperty(PropertyName = "queryCount")]
+ public int QueryCount { get; set; }
+
+ ///
+ /// Gets or sets the latency experienced by queries originating from
+ /// this location.
+ ///
+ [JsonProperty(PropertyName = "latency")]
+ public double? Latency { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ //Nothing to validate
+ }
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Region.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Region.cs
new file mode 100644
index 000000000000..a1d29b4e8ab7
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Region.cs
@@ -0,0 +1,72 @@
+//
+// 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.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Class representing a region in the Geographic hierarchy used with the
+ /// Geographic traffic routing method.
+ ///
+ public partial class Region
+ {
+ ///
+ /// Initializes a new instance of the Region class.
+ ///
+ public Region()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Region class.
+ ///
+ /// The code of the region
+ /// The name of the region
+ /// The list of Regions grouped under this Region
+ /// in the Geographic Hierarchy.
+ public Region(string code = default(string), string name = default(string), IList regions = default(IList))
+ {
+ Code = code;
+ Name = name;
+ Regions = regions;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the code of the region
+ ///
+ [JsonProperty(PropertyName = "code")]
+ public string Code { get; set; }
+
+ ///
+ /// Gets or sets the name of the region
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the list of Regions grouped under this Region in the
+ /// Geographic Hierarchy.
+ ///
+ [JsonProperty(PropertyName = "regions")]
+ public IList Regions { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Resource.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Resource.cs
new file mode 100644
index 000000000000..0ebe8a3577ac
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/Resource.cs
@@ -0,0 +1,73 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The core properties of ARM resources
+ ///
+ public partial class Resource : IResource
+ {
+ ///
+ /// Initializes a new instance of the Resource class.
+ ///
+ public Resource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Resource class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ public Resource(string id = default(string), string name = default(string), string type = default(string))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets the name of the resource
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrackedResource.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrackedResource.cs
new file mode 100644
index 000000000000..22283a01397b
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrackedResource.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.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The resource model definition for a ARM tracked top level resource
+ ///
+ public partial class TrackedResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the TrackedResource class.
+ ///
+ public TrackedResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the TrackedResource class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ /// Resource tags.
+ /// The Azure Region where the resource
+ /// lives
+ public TrackedResource(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string))
+ : base(id, name, type)
+ {
+ Tags = tags;
+ Location = location;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource tags.
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets or sets the Azure Region where the resource lives
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficFlow.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficFlow.cs
new file mode 100644
index 000000000000..5687c84a4744
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficFlow.cs
@@ -0,0 +1,85 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Class representing a Traffic Manager HeatMap traffic flow properties.
+ ///
+ public partial class TrafficFlow
+ {
+ ///
+ /// Initializes a new instance of the TrafficFlow class.
+ ///
+ public TrafficFlow()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the TrafficFlow class.
+ ///
+ /// The IP address that this query experience
+ /// originated from.
+ /// The approximate latitude that these queries
+ /// originated from.
+ /// The approximate longitude that these
+ /// queries originated from.
+ /// The query experiences produced in
+ /// this HeatMap calculation.
+ public TrafficFlow(string sourceIp = default(string), double? latitude = default(double?), double? longitude = default(double?), IList queryExperiences = default(IList))
+ {
+ SourceIp = sourceIp;
+ Latitude = latitude;
+ Longitude = longitude;
+ QueryExperiences = queryExperiences;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the IP address that this query experience originated
+ /// from.
+ ///
+ [JsonProperty(PropertyName = "sourceIp")]
+ public string SourceIp { get; set; }
+
+ ///
+ /// Gets or sets the approximate latitude that these queries originated
+ /// from.
+ ///
+ [JsonProperty(PropertyName = "latitude")]
+ public double? Latitude { get; set; }
+
+ ///
+ /// Gets or sets the approximate longitude that these queries
+ /// originated from.
+ ///
+ [JsonProperty(PropertyName = "longitude")]
+ public double? Longitude { get; set; }
+
+ ///
+ /// Gets or sets the query experiences produced in this HeatMap
+ /// calculation.
+ ///
+ [JsonProperty(PropertyName = "queryExperiences")]
+ public IList QueryExperiences { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficManagerGeographicHierarchy.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficManagerGeographicHierarchy.cs
new file mode 100644
index 000000000000..8f7104eab659
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficManagerGeographicHierarchy.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.TrafficManager.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Class representing the Geographic hierarchy used with the Geographic
+ /// traffic routing method.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class TrafficManagerGeographicHierarchy : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the TrafficManagerGeographicHierarchy
+ /// class.
+ ///
+ public TrafficManagerGeographicHierarchy()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the TrafficManagerGeographicHierarchy
+ /// class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ /// The region at the root of the
+ /// hierarchy from all the regions in the hierarchy can be
+ /// retrieved.
+ public TrafficManagerGeographicHierarchy(string id = default(string), string name = default(string), string type = default(string), Region geographicHierarchy = default(Region))
+ : base(id, name, type)
+ {
+ GeographicHierarchy = geographicHierarchy;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the region at the root of the hierarchy from all the
+ /// regions in the hierarchy can be retrieved.
+ ///
+ [JsonProperty(PropertyName = "properties.geographicHierarchy")]
+ public Region GeographicHierarchy { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficManagerNameAvailability.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficManagerNameAvailability.cs
new file mode 100644
index 000000000000..bc02445211fc
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficManagerNameAvailability.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.TrafficManager.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Class representing a Traffic Manager Name Availability response.
+ ///
+ public partial class TrafficManagerNameAvailability
+ {
+ ///
+ /// Initializes a new instance of the TrafficManagerNameAvailability
+ /// class.
+ ///
+ public TrafficManagerNameAvailability()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the TrafficManagerNameAvailability
+ /// class.
+ ///
+ /// The relative name.
+ /// Traffic Manager profile resource type.
+ /// Describes whether the relative name is
+ /// available or not.
+ /// The reason why the name is not available, when
+ /// applicable.
+ /// Descriptive message that explains why the
+ /// name is not available, when applicable.
+ public TrafficManagerNameAvailability(string name = default(string), string type = default(string), bool? nameAvailable = default(bool?), string reason = default(string), string message = default(string))
+ {
+ Name = name;
+ Type = type;
+ NameAvailable = nameAvailable;
+ Reason = reason;
+ Message = message;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the relative name.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets traffic Manager profile resource type.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; set; }
+
+ ///
+ /// Gets or sets describes whether the relative name is available or
+ /// not.
+ ///
+ [JsonProperty(PropertyName = "nameAvailable")]
+ public bool? NameAvailable { get; set; }
+
+ ///
+ /// Gets or sets the reason why the name is not available, when
+ /// applicable.
+ ///
+ [JsonProperty(PropertyName = "reason")]
+ public string Reason { get; set; }
+
+ ///
+ /// Gets or sets descriptive message that explains why the name is not
+ /// available, when applicable.
+ ///
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficRoutingMethod.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficRoutingMethod.cs
new file mode 100644
index 000000000000..91646feacdc6
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficRoutingMethod.cs
@@ -0,0 +1,26 @@
+//
+// 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.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for TrafficRoutingMethod.
+ ///
+ public static class TrafficRoutingMethod
+ {
+ public const string Performance = "Performance";
+ public const string Priority = "Priority";
+ public const string Weighted = "Weighted";
+ public const string Geographic = "Geographic";
+ public const string MultiValue = "MultiValue";
+ public const string Subnet = "Subnet";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficViewEnrollmentStatus.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficViewEnrollmentStatus.cs
new file mode 100644
index 000000000000..ac9a0dcf0361
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/TrafficViewEnrollmentStatus.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+
+ ///
+ /// Defines values for TrafficViewEnrollmentStatus.
+ ///
+ public static class TrafficViewEnrollmentStatus
+ {
+ public const string Enabled = "Enabled";
+ public const string Disabled = "Disabled";
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/UserMetricsModel.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/UserMetricsModel.cs
new file mode 100644
index 000000000000..2cd84f3ad69a
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/Models/UserMetricsModel.cs
@@ -0,0 +1,61 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.TrafficManager.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Class representing Traffic Manager User Metrics.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class UserMetricsModel : ProxyResource
+ {
+ ///
+ /// Initializes a new instance of the UserMetricsModel class.
+ ///
+ public UserMetricsModel()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the UserMetricsModel class.
+ ///
+ /// Fully qualified resource Id for the resource. Ex -
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
+ /// The name of the resource
+ /// The type of the resource. Ex-
+ /// Microsoft.Network/trafficManagerProfiles.
+ /// The key returned by the User Metrics
+ /// operation.
+ public UserMetricsModel(string id = default(string), string name = default(string), string type = default(string), string key = default(string))
+ : base(id, name, type)
+ {
+ Key = key;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the key returned by the User Metrics operation.
+ ///
+ [JsonProperty(PropertyName = "properties.key")]
+ public string Key { get; set; }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ProfilesOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ProfilesOperations.cs
new file mode 100644
index 000000000000..53bedbb20bc0
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ProfilesOperations.cs
@@ -0,0 +1,1567 @@
+//
+// 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.TrafficManager
+{
+ 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;
+
+ ///
+ /// ProfilesOperations operations.
+ ///
+ internal partial class ProfilesOperations : IServiceOperations, IProfilesOperations
+ {
+ ///
+ /// Initializes a new instance of the ProfilesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ProfilesOperations(TrafficManagerManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the TrafficManagerManagementClient
+ ///
+ public TrafficManagerManagementClient Client { get; private set; }
+
+ ///
+ /// Checks the availability of a Traffic Manager Relative DNS name.
+ ///
+ ///
+ /// The name of the resource.
+ ///
+ ///
+ /// The type of the resource.
+ ///
+ ///
+ /// 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> CheckTrafficManagerRelativeDnsNameAvailabilityWithHttpMessagesAsync(string name = default(string), string type = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ CheckTrafficManagerRelativeDnsNameAvailabilityParameters parameters = new CheckTrafficManagerRelativeDnsNameAvailabilityParameters();
+ if (name != null || type != null)
+ {
+ parameters.Name = name;
+ parameters.Type = type;
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CheckTrafficManagerRelativeDnsNameAvailability", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Network/checkTrafficManagerNameAvailability").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("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists all Traffic Manager profiles within a resource group.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// 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 (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 (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // 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.Network/trafficmanagerprofiles").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists all Traffic Manager profiles within 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.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // 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.Network/trafficmanagerprofiles").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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Gets a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string profileName, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or update a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the CreateOrUpdate
+ /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, Profile parameters, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // 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 a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile to be deleted.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string profileName, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Update a Traffic Manager profile.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the Update 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string profileName, Profile parameters, 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 (profileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "profileName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("profileName", profileName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", 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/trafficmanagerprofiles/{profileName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{profileName}", System.Uri.EscapeDataString(profileName));
+ _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(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ProfilesOperationsExtensions.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ProfilesOperationsExtensions.cs
new file mode 100644
index 000000000000..7fdf218e1ca1
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/ProfilesOperationsExtensions.cs
@@ -0,0 +1,300 @@
+//
+// 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.TrafficManager
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for ProfilesOperations.
+ ///
+ public static partial class ProfilesOperationsExtensions
+ {
+ ///
+ /// Checks the availability of a Traffic Manager Relative DNS name.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource.
+ ///
+ ///
+ /// The type of the resource.
+ ///
+ public static TrafficManagerNameAvailability CheckTrafficManagerRelativeDnsNameAvailability(this IProfilesOperations operations, string name = default(string), string type = default(string))
+ {
+ return operations.CheckTrafficManagerRelativeDnsNameAvailabilityAsync(name, type).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Checks the availability of a Traffic Manager Relative DNS name.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource.
+ ///
+ ///
+ /// The type of the resource.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CheckTrafficManagerRelativeDnsNameAvailabilityAsync(this IProfilesOperations operations, string name = default(string), string type = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CheckTrafficManagerRelativeDnsNameAvailabilityWithHttpMessagesAsync(name, type, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all Traffic Manager profiles within a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ public static IEnumerable ListByResourceGroup(this IProfilesOperations operations, string resourceGroupName)
+ {
+ return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all Traffic Manager profiles within a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByResourceGroupAsync(this IProfilesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all Traffic Manager profiles within a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IEnumerable ListBySubscription(this IProfilesOperations operations)
+ {
+ return operations.ListBySubscriptionAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all Traffic Manager profiles within a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListBySubscriptionAsync(this IProfilesOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Gets a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ public static Profile Get(this IProfilesOperations operations, string resourceGroupName, string profileName)
+ {
+ return operations.GetAsync(resourceGroupName, profileName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Gets a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IProfilesOperations operations, string resourceGroupName, string profileName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, profileName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or update a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the CreateOrUpdate
+ /// operation.
+ ///
+ public static Profile CreateOrUpdate(this IProfilesOperations operations, string resourceGroupName, string profileName, Profile parameters)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, profileName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or update a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the CreateOrUpdate
+ /// operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IProfilesOperations operations, string resourceGroupName, string profileName, Profile parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, profileName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Deletes a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile to be deleted.
+ ///
+ public static void Delete(this IProfilesOperations operations, string resourceGroupName, string profileName)
+ {
+ operations.DeleteAsync(resourceGroupName, profileName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Deletes a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile to be deleted.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IProfilesOperations operations, string resourceGroupName, string profileName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, profileName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Update a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the Update operation.
+ ///
+ public static Profile Update(this IProfilesOperations operations, string resourceGroupName, string profileName, Profile parameters)
+ {
+ return operations.UpdateAsync(resourceGroupName, profileName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update a Traffic Manager profile.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the Traffic Manager profile.
+ ///
+ ///
+ /// The Traffic Manager profile parameters supplied to the Update operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IProfilesOperations operations, string resourceGroupName, string profileName, Profile parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, profileName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/SdkInfo_TrafficManagerManagementClient.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/SdkInfo_TrafficManagerManagementClient.cs
new file mode 100644
index 000000000000..17c5386ff76e
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/SdkInfo_TrafficManagerManagementClient.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.TrafficManager
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ internal static partial class SdkInfo
+ {
+ public static IEnumerable> ApiInfo_TrafficManagerManagementClient
+ {
+ get
+ {
+ return new Tuple[]
+ {
+ new Tuple("Network", "Endpoints", "2022-04-01-preview"),
+ new Tuple("Network", "GeographicHierarchies", "2022-04-01-preview"),
+ new Tuple("Network", "HeatMap", "2022-04-01-preview"),
+ new Tuple("Network", "Profiles", "2022-04-01-preview"),
+ new Tuple("Network", "TrafficManagerUserMetricsKeys", "2022-04-01-preview"),
+ }.AsEnumerable();
+ }
+ }
+ }
+}
diff --git a/src/TrafficManager/TrafficManager.Management.Sdk/Generated/TrafficManagerManagementClient.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/TrafficManagerManagementClient.cs
new file mode 100644
index 000000000000..972b2ae76355
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/TrafficManagerManagementClient.cs
@@ -0,0 +1,381 @@
+//
+// 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.TrafficManager
+{
+ 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;
+
+ public partial class TrafficManagerManagementClient : ServiceClient, ITrafficManagerManagementClient, 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; }
+
+ ///
+ /// The ID of the target subscription.
+ ///
+ public string SubscriptionId { get; set; }
+
+ ///
+ /// The API version to use for this operation.
+ ///
+ 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 IEndpointsOperations.
+ ///
+ public virtual IEndpointsOperations Endpoints { get; private set; }
+
+ ///
+ /// Gets the IProfilesOperations.
+ ///
+ public virtual IProfilesOperations Profiles { get; private set; }
+
+ ///
+ /// Gets the IGeographicHierarchiesOperations.
+ ///
+ public virtual IGeographicHierarchiesOperations GeographicHierarchies { get; private set; }
+
+ ///
+ /// Gets the IHeatMapOperations.
+ ///
+ public virtual IHeatMapOperations HeatMap { get; private set; }
+
+ ///
+ /// Gets the ITrafficManagerUserMetricsKeysOperations.
+ ///
+ public virtual ITrafficManagerUserMetricsKeysOperations TrafficManagerUserMetricsKeys { get; private set; }
+
+ ///
+ /// Initializes a new instance of the TrafficManagerManagementClient class.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling TrafficManagerManagementClient.Dispose(). False: will not dispose provided httpClient
+ protected TrafficManagerManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the TrafficManagerManagementClient class.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected TrafficManagerManagementClient(params DelegatingHandler[] handlers) : base(handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the TrafficManagerManagementClient class.
+ ///
+ ///
+ /// Optional. The http client handler used to handle http transport.
+ ///
+ ///
+ /// Optional. The delegating handlers to add to the http client pipeline.
+ ///
+ protected TrafficManagerManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
+ {
+ Initialize();
+ }
+
+ ///
+ /// Initializes a new instance of the TrafficManagerManagementClient 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 TrafficManagerManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
+ {
+ if (baseUri == null)
+ {
+ throw new System.ArgumentNullException("baseUri");
+ }
+ BaseUri = baseUri;
+ }
+
+ ///
+ /// Initializes a new instance of the TrafficManagerManagementClient 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 TrafficManagerManagementClient(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 TrafficManagerManagementClient 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 TrafficManagerManagementClient(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 TrafficManagerManagementClient class.
+ ///
+ ///
+ /// Required. Credentials needed for the client to connect to Azure.
+ ///
+ ///
+ /// HttpClient to be used
+ ///
+ ///
+ /// True: will dispose the provided httpClient on calling TrafficManagerManagementClient.Dispose(). False: will not dispose provided httpClient
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ public TrafficManagerManagementClient(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 TrafficManagerManagementClient 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 TrafficManagerManagementClient(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 TrafficManagerManagementClient 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 TrafficManagerManagementClient(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 TrafficManagerManagementClient 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 TrafficManagerManagementClient(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()
+ {
+ Endpoints = new EndpointsOperations(this);
+ Profiles = new ProfilesOperations(this);
+ GeographicHierarchies = new GeographicHierarchiesOperations(this);
+ HeatMap = new HeatMapOperations(this);
+ TrafficManagerUserMetricsKeys = new TrafficManagerUserMetricsKeysOperations(this);
+ BaseUri = new System.Uri("https://management.azure.com");
+ ApiVersion = "2022-04-01-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/src/TrafficManager/TrafficManager.Management.Sdk/Generated/TrafficManagerUserMetricsKeysOperations.cs b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/TrafficManagerUserMetricsKeysOperations.cs
new file mode 100644
index 000000000000..d051f5cb6acf
--- /dev/null
+++ b/src/TrafficManager/TrafficManager.Management.Sdk/Generated/TrafficManagerUserMetricsKeysOperations.cs
@@ -0,0 +1,610 @@
+//
+// 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.TrafficManager
+{
+ 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;
+
+ ///
+ /// TrafficManagerUserMetricsKeysOperations operations.
+ ///
+ internal partial class TrafficManagerUserMetricsKeysOperations : IServiceOperations, ITrafficManagerUserMetricsKeysOperations
+ {
+ ///
+ /// Initializes a new instance of the TrafficManagerUserMetricsKeysOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal TrafficManagerUserMetricsKeysOperations(TrafficManagerManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the TrafficManagerManagementClient
+ ///
+ public TrafficManagerManagementClient Client { get; private set; }
+
+ ///
+ /// Get the subscription-level key used for Real User Metrics collection.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // 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, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default").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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or update a subscription-level key used for Real User Metrics
+ /// collection.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // 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, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default").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("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;
+ // 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 != 201)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 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 a subscription-level key used for Real User Metrics collection.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary