< Summary

Class:Microsoft.Azure.Management.Search.PrivateEndpointConnectionsOperations
Assembly:Microsoft.Azure.Management.Search
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\src\Generated\PrivateEndpointConnectionsOperations.cs
Covered lines:4
Uncovered lines:514
Coverable lines:518
Total lines:1156
Line coverage:0.7% (4 of 518)
Covered branches:1
Total branches:314
Branch coverage:0.3% (1 of 314)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
get_Client()-0%100%
UpdateWithHttpMessagesAsync()-0%0%
GetWithHttpMessagesAsync()-0%0%
DeleteWithHttpMessagesAsync()-0%0%
ListByServiceWithHttpMessagesAsync()-0%0%
ListByServiceNextWithHttpMessagesAsync()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\src\Generated\PrivateEndpointConnectionsOperations.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Management.Search
 12{
 13    using Microsoft.Rest;
 14    using Microsoft.Rest.Azure;
 15    using Models;
 16    using Newtonsoft.Json;
 17    using System.Collections;
 18    using System.Collections.Generic;
 19    using System.Linq;
 20    using System.Net;
 21    using System.Net.Http;
 22    using System.Threading;
 23    using System.Threading.Tasks;
 24
 25    /// <summary>
 26    /// PrivateEndpointConnectionsOperations operations.
 27    /// </summary>
 28    internal partial class PrivateEndpointConnectionsOperations : IServiceOperations<SearchManagementClient>, IPrivateEn
 29    {
 30        /// <summary>
 31        /// Initializes a new instance of the PrivateEndpointConnectionsOperations class.
 32        /// </summary>
 33        /// <param name='client'>
 34        /// Reference to the service client.
 35        /// </param>
 36        /// <exception cref="System.ArgumentNullException">
 37        /// Thrown when a required parameter is null
 38        /// </exception>
 120439        internal PrivateEndpointConnectionsOperations(SearchManagementClient client)
 40        {
 120441            if (client == null)
 42            {
 043                throw new System.ArgumentNullException("client");
 44            }
 120445            Client = client;
 120446        }
 47
 48        /// <summary>
 49        /// Gets a reference to the SearchManagementClient
 50        /// </summary>
 051        public SearchManagementClient Client { get; private set; }
 52
 53        /// <summary>
 54        /// Updates a Private Endpoint connection to the Search service in the given
 55        /// resource group.
 56        /// <see href="https://aka.ms/search-manage" />
 57        /// </summary>
 58        /// <param name='resourceGroupName'>
 59        /// The name of the resource group within the current subscription. You can
 60        /// obtain this value from the Azure Resource Manager API or the portal.
 61        /// </param>
 62        /// <param name='searchServiceName'>
 63        /// The name of the Azure Cognitive Search service associated with the
 64        /// specified resource group.
 65        /// </param>
 66        /// <param name='privateEndpointConnectionName'>
 67        /// The name of the private endpoint connection to the Azure Cognitive Search
 68        /// service with the specified resource group.
 69        /// </param>
 70        /// <param name='privateEndpointConnection'>
 71        /// The definition of the private endpoint connection to update.
 72        /// </param>
 73        /// <param name='searchManagementRequestOptions'>
 74        /// Additional parameters for the operation
 75        /// </param>
 76        /// <param name='customHeaders'>
 77        /// Headers that will be added to request.
 78        /// </param>
 79        /// <param name='cancellationToken'>
 80        /// The cancellation token.
 81        /// </param>
 82        /// <exception cref="CloudException">
 83        /// Thrown when the operation returned an invalid status code
 84        /// </exception>
 85        /// <exception cref="SerializationException">
 86        /// Thrown when unable to deserialize the response
 87        /// </exception>
 88        /// <exception cref="ValidationException">
 89        /// Thrown when a required parameter is null
 90        /// </exception>
 91        /// <exception cref="System.ArgumentNullException">
 92        /// Thrown when a required parameter is null
 93        /// </exception>
 94        /// <return>
 95        /// A response object containing the response body and response headers.
 96        /// </return>
 97        public async Task<AzureOperationResponse<PrivateEndpointConnection>> UpdateWithHttpMessagesAsync(string resource
 98        {
 099            if (resourceGroupName == null)
 100            {
 0101                throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
 102            }
 0103            if (searchServiceName == null)
 104            {
 0105                throw new ValidationException(ValidationRules.CannotBeNull, "searchServiceName");
 106            }
 0107            if (privateEndpointConnectionName == null)
 108            {
 0109                throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName");
 110            }
 0111            if (privateEndpointConnection == null)
 112            {
 0113                throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnection");
 114            }
 0115            if (Client.ApiVersion == null)
 116            {
 0117                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
 118            }
 0119            if (Client.SubscriptionId == null)
 120            {
 0121                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
 122            }
 0123            System.Guid? clientRequestId = default(System.Guid?);
 0124            if (searchManagementRequestOptions != null)
 125            {
 0126                clientRequestId = searchManagementRequestOptions.ClientRequestId;
 127            }
 128            // Tracing
 0129            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 0130            string _invocationId = null;
 0131            if (_shouldTrace)
 132            {
 0133                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0134                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0135                tracingParameters.Add("resourceGroupName", resourceGroupName);
 0136                tracingParameters.Add("searchServiceName", searchServiceName);
 0137                tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName);
 0138                tracingParameters.Add("privateEndpointConnection", privateEndpointConnection);
 0139                tracingParameters.Add("clientRequestId", clientRequestId);
 0140                tracingParameters.Add("cancellationToken", cancellationToken);
 0141                ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
 142            }
 143            // Construct URL
 0144            var _baseUrl = Client.BaseUri.AbsoluteUri;
 0145            var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{su
 0146            _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
 0147            _url = _url.Replace("{searchServiceName}", System.Uri.EscapeDataString(searchServiceName));
 0148            _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnection
 0149            _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
 0150            List<string> _queryParameters = new List<string>();
 0151            if (Client.ApiVersion != null)
 152            {
 0153                _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
 154            }
 0155            if (_queryParameters.Count > 0)
 156            {
 0157                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 158            }
 159            // Create HTTP transport objects
 0160            var _httpRequest = new HttpRequestMessage();
 0161            HttpResponseMessage _httpResponse = null;
 0162            _httpRequest.Method = new HttpMethod("PUT");
 0163            _httpRequest.RequestUri = new System.Uri(_url);
 164            // Set Headers
 0165            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 166            {
 0167                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 168            }
 0169            if (Client.AcceptLanguage != null)
 170            {
 0171                if (_httpRequest.Headers.Contains("accept-language"))
 172                {
 0173                    _httpRequest.Headers.Remove("accept-language");
 174                }
 0175                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 176            }
 0177            if (clientRequestId != null)
 178            {
 0179                if (_httpRequest.Headers.Contains("x-ms-client-request-id"))
 180                {
 0181                    _httpRequest.Headers.Remove("x-ms-client-request-id");
 182                }
 0183                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Rest.Serialization.SafeJsonConver
 184            }
 185
 186
 0187            if (customHeaders != null)
 188            {
 0189                foreach(var _header in customHeaders)
 190                {
 0191                    if (_httpRequest.Headers.Contains(_header.Key))
 192                    {
 0193                        _httpRequest.Headers.Remove(_header.Key);
 194                    }
 0195                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 196                }
 197            }
 198
 199            // Serialize Request
 0200            string _requestContent = null;
 0201            if(privateEndpointConnection != null)
 202            {
 0203                _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointConnection, Client.S
 0204                _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
 0205                _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("applicatio
 206            }
 207            // Set Credentials
 0208            if (Client.Credentials != null)
 209            {
 0210                cancellationToken.ThrowIfCancellationRequested();
 0211                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 212            }
 213            // Send Request
 0214            if (_shouldTrace)
 215            {
 0216                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 217            }
 0218            cancellationToken.ThrowIfCancellationRequested();
 0219            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 0220            if (_shouldTrace)
 221            {
 0222                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 223            }
 0224            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 0225            cancellationToken.ThrowIfCancellationRequested();
 0226            string _responseContent = null;
 0227            if ((int)_statusCode != 200)
 228            {
 0229                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode
 230                try
 231                {
 0232                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0233                    CloudError _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseC
 0234                    if (_errorBody != null)
 235                    {
 0236                        ex = new CloudException(_errorBody.Message);
 0237                        ex.Body = _errorBody;
 238                    }
 0239                }
 0240                catch (JsonException)
 241                {
 242                    // Ignore the exception
 0243                }
 0244                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0245                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0246                if (_httpResponse.Headers.Contains("x-ms-request-id"))
 247                {
 0248                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 249                }
 0250                if (_shouldTrace)
 251                {
 0252                    ServiceClientTracing.Error(_invocationId, ex);
 253                }
 0254                _httpRequest.Dispose();
 0255                if (_httpResponse != null)
 256                {
 0257                    _httpResponse.Dispose();
 258                }
 0259                throw ex;
 260            }
 261            // Create Result
 0262            var _result = new AzureOperationResponse<PrivateEndpointConnection>();
 0263            _result.Request = _httpRequest;
 0264            _result.Response = _httpResponse;
 0265            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 266            {
 0267                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 268            }
 269            // Deserialize Response
 0270            if ((int)_statusCode == 200)
 271            {
 0272                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 273                try
 274                {
 0275                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<PrivateEndpointConnection>(_resp
 0276                }
 0277                catch (JsonException ex)
 278                {
 0279                    _httpRequest.Dispose();
 0280                    if (_httpResponse != null)
 281                    {
 0282                        _httpResponse.Dispose();
 283                    }
 0284                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 285                }
 286            }
 0287            if (_shouldTrace)
 288            {
 0289                ServiceClientTracing.Exit(_invocationId, _result);
 290            }
 0291            return _result;
 0292        }
 293
 294        /// <summary>
 295        /// Gets the details of the private endpoint connection to the Search service
 296        /// in the given resource group.
 297        /// <see href="https://aka.ms/search-manage" />
 298        /// </summary>
 299        /// <param name='resourceGroupName'>
 300        /// The name of the resource group within the current subscription. You can
 301        /// obtain this value from the Azure Resource Manager API or the portal.
 302        /// </param>
 303        /// <param name='searchServiceName'>
 304        /// The name of the Azure Cognitive Search service associated with the
 305        /// specified resource group.
 306        /// </param>
 307        /// <param name='privateEndpointConnectionName'>
 308        /// The name of the private endpoint connection to the Azure Cognitive Search
 309        /// service with the specified resource group.
 310        /// </param>
 311        /// <param name='searchManagementRequestOptions'>
 312        /// Additional parameters for the operation
 313        /// </param>
 314        /// <param name='customHeaders'>
 315        /// Headers that will be added to request.
 316        /// </param>
 317        /// <param name='cancellationToken'>
 318        /// The cancellation token.
 319        /// </param>
 320        /// <exception cref="CloudException">
 321        /// Thrown when the operation returned an invalid status code
 322        /// </exception>
 323        /// <exception cref="SerializationException">
 324        /// Thrown when unable to deserialize the response
 325        /// </exception>
 326        /// <exception cref="ValidationException">
 327        /// Thrown when a required parameter is null
 328        /// </exception>
 329        /// <exception cref="System.ArgumentNullException">
 330        /// Thrown when a required parameter is null
 331        /// </exception>
 332        /// <return>
 333        /// A response object containing the response body and response headers.
 334        /// </return>
 335        public async Task<AzureOperationResponse<PrivateEndpointConnection>> GetWithHttpMessagesAsync(string resourceGro
 336        {
 0337            if (resourceGroupName == null)
 338            {
 0339                throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
 340            }
 0341            if (searchServiceName == null)
 342            {
 0343                throw new ValidationException(ValidationRules.CannotBeNull, "searchServiceName");
 344            }
 0345            if (privateEndpointConnectionName == null)
 346            {
 0347                throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName");
 348            }
 0349            if (Client.ApiVersion == null)
 350            {
 0351                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
 352            }
 0353            if (Client.SubscriptionId == null)
 354            {
 0355                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
 356            }
 0357            System.Guid? clientRequestId = default(System.Guid?);
 0358            if (searchManagementRequestOptions != null)
 359            {
 0360                clientRequestId = searchManagementRequestOptions.ClientRequestId;
 361            }
 362            // Tracing
 0363            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 0364            string _invocationId = null;
 0365            if (_shouldTrace)
 366            {
 0367                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0368                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0369                tracingParameters.Add("resourceGroupName", resourceGroupName);
 0370                tracingParameters.Add("searchServiceName", searchServiceName);
 0371                tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName);
 0372                tracingParameters.Add("clientRequestId", clientRequestId);
 0373                tracingParameters.Add("cancellationToken", cancellationToken);
 0374                ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
 375            }
 376            // Construct URL
 0377            var _baseUrl = Client.BaseUri.AbsoluteUri;
 0378            var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{su
 0379            _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
 0380            _url = _url.Replace("{searchServiceName}", System.Uri.EscapeDataString(searchServiceName));
 0381            _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnection
 0382            _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
 0383            List<string> _queryParameters = new List<string>();
 0384            if (Client.ApiVersion != null)
 385            {
 0386                _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
 387            }
 0388            if (_queryParameters.Count > 0)
 389            {
 0390                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 391            }
 392            // Create HTTP transport objects
 0393            var _httpRequest = new HttpRequestMessage();
 0394            HttpResponseMessage _httpResponse = null;
 0395            _httpRequest.Method = new HttpMethod("GET");
 0396            _httpRequest.RequestUri = new System.Uri(_url);
 397            // Set Headers
 0398            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 399            {
 0400                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 401            }
 0402            if (Client.AcceptLanguage != null)
 403            {
 0404                if (_httpRequest.Headers.Contains("accept-language"))
 405                {
 0406                    _httpRequest.Headers.Remove("accept-language");
 407                }
 0408                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 409            }
 0410            if (clientRequestId != null)
 411            {
 0412                if (_httpRequest.Headers.Contains("x-ms-client-request-id"))
 413                {
 0414                    _httpRequest.Headers.Remove("x-ms-client-request-id");
 415                }
 0416                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Rest.Serialization.SafeJsonConver
 417            }
 418
 419
 0420            if (customHeaders != null)
 421            {
 0422                foreach(var _header in customHeaders)
 423                {
 0424                    if (_httpRequest.Headers.Contains(_header.Key))
 425                    {
 0426                        _httpRequest.Headers.Remove(_header.Key);
 427                    }
 0428                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 429                }
 430            }
 431
 432            // Serialize Request
 0433            string _requestContent = null;
 434            // Set Credentials
 0435            if (Client.Credentials != null)
 436            {
 0437                cancellationToken.ThrowIfCancellationRequested();
 0438                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 439            }
 440            // Send Request
 0441            if (_shouldTrace)
 442            {
 0443                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 444            }
 0445            cancellationToken.ThrowIfCancellationRequested();
 0446            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 0447            if (_shouldTrace)
 448            {
 0449                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 450            }
 0451            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 0452            cancellationToken.ThrowIfCancellationRequested();
 0453            string _responseContent = null;
 0454            if ((int)_statusCode != 200)
 455            {
 0456                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode
 457                try
 458                {
 0459                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0460                    CloudError _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseC
 0461                    if (_errorBody != null)
 462                    {
 0463                        ex = new CloudException(_errorBody.Message);
 0464                        ex.Body = _errorBody;
 465                    }
 0466                }
 0467                catch (JsonException)
 468                {
 469                    // Ignore the exception
 0470                }
 0471                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0472                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0473                if (_httpResponse.Headers.Contains("x-ms-request-id"))
 474                {
 0475                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 476                }
 0477                if (_shouldTrace)
 478                {
 0479                    ServiceClientTracing.Error(_invocationId, ex);
 480                }
 0481                _httpRequest.Dispose();
 0482                if (_httpResponse != null)
 483                {
 0484                    _httpResponse.Dispose();
 485                }
 0486                throw ex;
 487            }
 488            // Create Result
 0489            var _result = new AzureOperationResponse<PrivateEndpointConnection>();
 0490            _result.Request = _httpRequest;
 0491            _result.Response = _httpResponse;
 0492            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 493            {
 0494                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 495            }
 496            // Deserialize Response
 0497            if ((int)_statusCode == 200)
 498            {
 0499                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 500                try
 501                {
 0502                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<PrivateEndpointConnection>(_resp
 0503                }
 0504                catch (JsonException ex)
 505                {
 0506                    _httpRequest.Dispose();
 0507                    if (_httpResponse != null)
 508                    {
 0509                        _httpResponse.Dispose();
 510                    }
 0511                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 512                }
 513            }
 0514            if (_shouldTrace)
 515            {
 0516                ServiceClientTracing.Exit(_invocationId, _result);
 517            }
 0518            return _result;
 0519        }
 520
 521        /// <summary>
 522        /// Disconnects the private endpoint connection and deletes it from the Search
 523        /// service.
 524        /// <see href="https://aka.ms/search-manage" />
 525        /// </summary>
 526        /// <param name='resourceGroupName'>
 527        /// The name of the resource group within the current subscription. You can
 528        /// obtain this value from the Azure Resource Manager API or the portal.
 529        /// </param>
 530        /// <param name='searchServiceName'>
 531        /// The name of the Azure Cognitive Search service associated with the
 532        /// specified resource group.
 533        /// </param>
 534        /// <param name='privateEndpointConnectionName'>
 535        /// The name of the private endpoint connection to the Azure Cognitive Search
 536        /// service with the specified resource group.
 537        /// </param>
 538        /// <param name='searchManagementRequestOptions'>
 539        /// Additional parameters for the operation
 540        /// </param>
 541        /// <param name='customHeaders'>
 542        /// Headers that will be added to request.
 543        /// </param>
 544        /// <param name='cancellationToken'>
 545        /// The cancellation token.
 546        /// </param>
 547        /// <exception cref="CloudException">
 548        /// Thrown when the operation returned an invalid status code
 549        /// </exception>
 550        /// <exception cref="SerializationException">
 551        /// Thrown when unable to deserialize the response
 552        /// </exception>
 553        /// <exception cref="ValidationException">
 554        /// Thrown when a required parameter is null
 555        /// </exception>
 556        /// <exception cref="System.ArgumentNullException">
 557        /// Thrown when a required parameter is null
 558        /// </exception>
 559        /// <return>
 560        /// A response object containing the response body and response headers.
 561        /// </return>
 562        public async Task<AzureOperationResponse<PrivateEndpointConnection>> DeleteWithHttpMessagesAsync(string resource
 563        {
 0564            if (resourceGroupName == null)
 565            {
 0566                throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
 567            }
 0568            if (searchServiceName == null)
 569            {
 0570                throw new ValidationException(ValidationRules.CannotBeNull, "searchServiceName");
 571            }
 0572            if (privateEndpointConnectionName == null)
 573            {
 0574                throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName");
 575            }
 0576            if (Client.ApiVersion == null)
 577            {
 0578                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
 579            }
 0580            if (Client.SubscriptionId == null)
 581            {
 0582                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
 583            }
 0584            System.Guid? clientRequestId = default(System.Guid?);
 0585            if (searchManagementRequestOptions != null)
 586            {
 0587                clientRequestId = searchManagementRequestOptions.ClientRequestId;
 588            }
 589            // Tracing
 0590            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 0591            string _invocationId = null;
 0592            if (_shouldTrace)
 593            {
 0594                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0595                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0596                tracingParameters.Add("resourceGroupName", resourceGroupName);
 0597                tracingParameters.Add("searchServiceName", searchServiceName);
 0598                tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName);
 0599                tracingParameters.Add("clientRequestId", clientRequestId);
 0600                tracingParameters.Add("cancellationToken", cancellationToken);
 0601                ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
 602            }
 603            // Construct URL
 0604            var _baseUrl = Client.BaseUri.AbsoluteUri;
 0605            var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{su
 0606            _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
 0607            _url = _url.Replace("{searchServiceName}", System.Uri.EscapeDataString(searchServiceName));
 0608            _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnection
 0609            _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
 0610            List<string> _queryParameters = new List<string>();
 0611            if (Client.ApiVersion != null)
 612            {
 0613                _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
 614            }
 0615            if (_queryParameters.Count > 0)
 616            {
 0617                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 618            }
 619            // Create HTTP transport objects
 0620            var _httpRequest = new HttpRequestMessage();
 0621            HttpResponseMessage _httpResponse = null;
 0622            _httpRequest.Method = new HttpMethod("DELETE");
 0623            _httpRequest.RequestUri = new System.Uri(_url);
 624            // Set Headers
 0625            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 626            {
 0627                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 628            }
 0629            if (Client.AcceptLanguage != null)
 630            {
 0631                if (_httpRequest.Headers.Contains("accept-language"))
 632                {
 0633                    _httpRequest.Headers.Remove("accept-language");
 634                }
 0635                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 636            }
 0637            if (clientRequestId != null)
 638            {
 0639                if (_httpRequest.Headers.Contains("x-ms-client-request-id"))
 640                {
 0641                    _httpRequest.Headers.Remove("x-ms-client-request-id");
 642                }
 0643                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Rest.Serialization.SafeJsonConver
 644            }
 645
 646
 0647            if (customHeaders != null)
 648            {
 0649                foreach(var _header in customHeaders)
 650                {
 0651                    if (_httpRequest.Headers.Contains(_header.Key))
 652                    {
 0653                        _httpRequest.Headers.Remove(_header.Key);
 654                    }
 0655                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 656                }
 657            }
 658
 659            // Serialize Request
 0660            string _requestContent = null;
 661            // Set Credentials
 0662            if (Client.Credentials != null)
 663            {
 0664                cancellationToken.ThrowIfCancellationRequested();
 0665                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 666            }
 667            // Send Request
 0668            if (_shouldTrace)
 669            {
 0670                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 671            }
 0672            cancellationToken.ThrowIfCancellationRequested();
 0673            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 0674            if (_shouldTrace)
 675            {
 0676                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 677            }
 0678            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 0679            cancellationToken.ThrowIfCancellationRequested();
 0680            string _responseContent = null;
 0681            if ((int)_statusCode != 200 && (int)_statusCode != 404)
 682            {
 0683                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode
 684                try
 685                {
 0686                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0687                    CloudError _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseC
 0688                    if (_errorBody != null)
 689                    {
 0690                        ex = new CloudException(_errorBody.Message);
 0691                        ex.Body = _errorBody;
 692                    }
 0693                }
 0694                catch (JsonException)
 695                {
 696                    // Ignore the exception
 0697                }
 0698                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0699                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0700                if (_httpResponse.Headers.Contains("x-ms-request-id"))
 701                {
 0702                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 703                }
 0704                if (_shouldTrace)
 705                {
 0706                    ServiceClientTracing.Error(_invocationId, ex);
 707                }
 0708                _httpRequest.Dispose();
 0709                if (_httpResponse != null)
 710                {
 0711                    _httpResponse.Dispose();
 712                }
 0713                throw ex;
 714            }
 715            // Create Result
 0716            var _result = new AzureOperationResponse<PrivateEndpointConnection>();
 0717            _result.Request = _httpRequest;
 0718            _result.Response = _httpResponse;
 0719            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 720            {
 0721                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 722            }
 723            // Deserialize Response
 0724            if ((int)_statusCode == 200)
 725            {
 0726                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 727                try
 728                {
 0729                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<PrivateEndpointConnection>(_resp
 0730                }
 0731                catch (JsonException ex)
 732                {
 0733                    _httpRequest.Dispose();
 0734                    if (_httpResponse != null)
 735                    {
 0736                        _httpResponse.Dispose();
 737                    }
 0738                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 739                }
 740            }
 0741            if (_shouldTrace)
 742            {
 0743                ServiceClientTracing.Exit(_invocationId, _result);
 744            }
 0745            return _result;
 0746        }
 747
 748        /// <summary>
 749        /// Gets a list of all private endpoint connections in the given service.
 750        /// <see href="https://aka.ms/search-manage" />
 751        /// </summary>
 752        /// <param name='resourceGroupName'>
 753        /// The name of the resource group within the current subscription. You can
 754        /// obtain this value from the Azure Resource Manager API or the portal.
 755        /// </param>
 756        /// <param name='searchServiceName'>
 757        /// The name of the Azure Cognitive Search service associated with the
 758        /// specified resource group.
 759        /// </param>
 760        /// <param name='searchManagementRequestOptions'>
 761        /// Additional parameters for the operation
 762        /// </param>
 763        /// <param name='customHeaders'>
 764        /// Headers that will be added to request.
 765        /// </param>
 766        /// <param name='cancellationToken'>
 767        /// The cancellation token.
 768        /// </param>
 769        /// <exception cref="CloudException">
 770        /// Thrown when the operation returned an invalid status code
 771        /// </exception>
 772        /// <exception cref="SerializationException">
 773        /// Thrown when unable to deserialize the response
 774        /// </exception>
 775        /// <exception cref="ValidationException">
 776        /// Thrown when a required parameter is null
 777        /// </exception>
 778        /// <exception cref="System.ArgumentNullException">
 779        /// Thrown when a required parameter is null
 780        /// </exception>
 781        /// <return>
 782        /// A response object containing the response body and response headers.
 783        /// </return>
 784        public async Task<AzureOperationResponse<IPage<PrivateEndpointConnection>>> ListByServiceWithHttpMessagesAsync(s
 785        {
 0786            if (Client.ApiVersion == null)
 787            {
 0788                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
 789            }
 0790            if (Client.SubscriptionId == null)
 791            {
 0792                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
 793            }
 0794            if (resourceGroupName == null)
 795            {
 0796                throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
 797            }
 0798            if (searchServiceName == null)
 799            {
 0800                throw new ValidationException(ValidationRules.CannotBeNull, "searchServiceName");
 801            }
 0802            System.Guid? clientRequestId = default(System.Guid?);
 0803            if (searchManagementRequestOptions != null)
 804            {
 0805                clientRequestId = searchManagementRequestOptions.ClientRequestId;
 806            }
 807            // Tracing
 0808            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 0809            string _invocationId = null;
 0810            if (_shouldTrace)
 811            {
 0812                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0813                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0814                tracingParameters.Add("resourceGroupName", resourceGroupName);
 0815                tracingParameters.Add("searchServiceName", searchServiceName);
 0816                tracingParameters.Add("clientRequestId", clientRequestId);
 0817                tracingParameters.Add("cancellationToken", cancellationToken);
 0818                ServiceClientTracing.Enter(_invocationId, this, "ListByService", tracingParameters);
 819            }
 820            // Construct URL
 0821            var _baseUrl = Client.BaseUri.AbsoluteUri;
 0822            var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{su
 0823            _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
 0824            _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
 0825            _url = _url.Replace("{searchServiceName}", System.Uri.EscapeDataString(searchServiceName));
 0826            List<string> _queryParameters = new List<string>();
 0827            if (Client.ApiVersion != null)
 828            {
 0829                _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
 830            }
 0831            if (_queryParameters.Count > 0)
 832            {
 0833                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 834            }
 835            // Create HTTP transport objects
 0836            var _httpRequest = new HttpRequestMessage();
 0837            HttpResponseMessage _httpResponse = null;
 0838            _httpRequest.Method = new HttpMethod("GET");
 0839            _httpRequest.RequestUri = new System.Uri(_url);
 840            // Set Headers
 0841            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 842            {
 0843                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 844            }
 0845            if (Client.AcceptLanguage != null)
 846            {
 0847                if (_httpRequest.Headers.Contains("accept-language"))
 848                {
 0849                    _httpRequest.Headers.Remove("accept-language");
 850                }
 0851                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 852            }
 0853            if (clientRequestId != null)
 854            {
 0855                if (_httpRequest.Headers.Contains("x-ms-client-request-id"))
 856                {
 0857                    _httpRequest.Headers.Remove("x-ms-client-request-id");
 858                }
 0859                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Rest.Serialization.SafeJsonConver
 860            }
 861
 862
 0863            if (customHeaders != null)
 864            {
 0865                foreach(var _header in customHeaders)
 866                {
 0867                    if (_httpRequest.Headers.Contains(_header.Key))
 868                    {
 0869                        _httpRequest.Headers.Remove(_header.Key);
 870                    }
 0871                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 872                }
 873            }
 874
 875            // Serialize Request
 0876            string _requestContent = null;
 877            // Set Credentials
 0878            if (Client.Credentials != null)
 879            {
 0880                cancellationToken.ThrowIfCancellationRequested();
 0881                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 882            }
 883            // Send Request
 0884            if (_shouldTrace)
 885            {
 0886                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 887            }
 0888            cancellationToken.ThrowIfCancellationRequested();
 0889            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 0890            if (_shouldTrace)
 891            {
 0892                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 893            }
 0894            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 0895            cancellationToken.ThrowIfCancellationRequested();
 0896            string _responseContent = null;
 0897            if ((int)_statusCode != 200)
 898            {
 0899                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode
 900                try
 901                {
 0902                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0903                    CloudError _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseC
 0904                    if (_errorBody != null)
 905                    {
 0906                        ex = new CloudException(_errorBody.Message);
 0907                        ex.Body = _errorBody;
 908                    }
 0909                }
 0910                catch (JsonException)
 911                {
 912                    // Ignore the exception
 0913                }
 0914                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0915                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0916                if (_httpResponse.Headers.Contains("x-ms-request-id"))
 917                {
 0918                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 919                }
 0920                if (_shouldTrace)
 921                {
 0922                    ServiceClientTracing.Error(_invocationId, ex);
 923                }
 0924                _httpRequest.Dispose();
 0925                if (_httpResponse != null)
 926                {
 0927                    _httpResponse.Dispose();
 928                }
 0929                throw ex;
 930            }
 931            // Create Result
 0932            var _result = new AzureOperationResponse<IPage<PrivateEndpointConnection>>();
 0933            _result.Request = _httpRequest;
 0934            _result.Response = _httpResponse;
 0935            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 936            {
 0937                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 938            }
 939            // Deserialize Response
 0940            if ((int)_statusCode == 200)
 941            {
 0942                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 943                try
 944                {
 0945                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page1<PrivateEndpointConnection>
 0946                }
 0947                catch (JsonException ex)
 948                {
 0949                    _httpRequest.Dispose();
 0950                    if (_httpResponse != null)
 951                    {
 0952                        _httpResponse.Dispose();
 953                    }
 0954                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 955                }
 956            }
 0957            if (_shouldTrace)
 958            {
 0959                ServiceClientTracing.Exit(_invocationId, _result);
 960            }
 0961            return _result;
 0962        }
 963
 964        /// <summary>
 965        /// Gets a list of all private endpoint connections in the given service.
 966        /// <see href="https://aka.ms/search-manage" />
 967        /// </summary>
 968        /// <param name='nextPageLink'>
 969        /// The NextLink from the previous successful call to List operation.
 970        /// </param>
 971        /// <param name='searchManagementRequestOptions'>
 972        /// Additional parameters for the operation
 973        /// </param>
 974        /// <param name='customHeaders'>
 975        /// Headers that will be added to request.
 976        /// </param>
 977        /// <param name='cancellationToken'>
 978        /// The cancellation token.
 979        /// </param>
 980        /// <exception cref="CloudException">
 981        /// Thrown when the operation returned an invalid status code
 982        /// </exception>
 983        /// <exception cref="SerializationException">
 984        /// Thrown when unable to deserialize the response
 985        /// </exception>
 986        /// <exception cref="ValidationException">
 987        /// Thrown when a required parameter is null
 988        /// </exception>
 989        /// <exception cref="System.ArgumentNullException">
 990        /// Thrown when a required parameter is null
 991        /// </exception>
 992        /// <return>
 993        /// A response object containing the response body and response headers.
 994        /// </return>
 995        public async Task<AzureOperationResponse<IPage<PrivateEndpointConnection>>> ListByServiceNextWithHttpMessagesAsy
 996        {
 0997            if (nextPageLink == null)
 998            {
 0999                throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
 1000            }
 01001            System.Guid? clientRequestId = default(System.Guid?);
 01002            if (searchManagementRequestOptions != null)
 1003            {
 01004                clientRequestId = searchManagementRequestOptions.ClientRequestId;
 1005            }
 1006            // Tracing
 01007            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 01008            string _invocationId = null;
 01009            if (_shouldTrace)
 1010            {
 01011                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 01012                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 01013                tracingParameters.Add("nextPageLink", nextPageLink);
 01014                tracingParameters.Add("clientRequestId", clientRequestId);
 01015                tracingParameters.Add("cancellationToken", cancellationToken);
 01016                ServiceClientTracing.Enter(_invocationId, this, "ListByServiceNext", tracingParameters);
 1017            }
 1018            // Construct URL
 01019            string _url = "{nextLink}";
 01020            _url = _url.Replace("{nextLink}", nextPageLink);
 01021            List<string> _queryParameters = new List<string>();
 01022            if (_queryParameters.Count > 0)
 1023            {
 01024                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 1025            }
 1026            // Create HTTP transport objects
 01027            var _httpRequest = new HttpRequestMessage();
 01028            HttpResponseMessage _httpResponse = null;
 01029            _httpRequest.Method = new HttpMethod("GET");
 01030            _httpRequest.RequestUri = new System.Uri(_url);
 1031            // Set Headers
 01032            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 1033            {
 01034                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 1035            }
 01036            if (Client.AcceptLanguage != null)
 1037            {
 01038                if (_httpRequest.Headers.Contains("accept-language"))
 1039                {
 01040                    _httpRequest.Headers.Remove("accept-language");
 1041                }
 01042                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 1043            }
 01044            if (clientRequestId != null)
 1045            {
 01046                if (_httpRequest.Headers.Contains("x-ms-client-request-id"))
 1047                {
 01048                    _httpRequest.Headers.Remove("x-ms-client-request-id");
 1049                }
 01050                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Rest.Serialization.SafeJsonConver
 1051            }
 1052
 1053
 01054            if (customHeaders != null)
 1055            {
 01056                foreach(var _header in customHeaders)
 1057                {
 01058                    if (_httpRequest.Headers.Contains(_header.Key))
 1059                    {
 01060                        _httpRequest.Headers.Remove(_header.Key);
 1061                    }
 01062                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 1063                }
 1064            }
 1065
 1066            // Serialize Request
 01067            string _requestContent = null;
 1068            // Set Credentials
 01069            if (Client.Credentials != null)
 1070            {
 01071                cancellationToken.ThrowIfCancellationRequested();
 01072                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 1073            }
 1074            // Send Request
 01075            if (_shouldTrace)
 1076            {
 01077                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 1078            }
 01079            cancellationToken.ThrowIfCancellationRequested();
 01080            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 01081            if (_shouldTrace)
 1082            {
 01083                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 1084            }
 01085            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 01086            cancellationToken.ThrowIfCancellationRequested();
 01087            string _responseContent = null;
 01088            if ((int)_statusCode != 200)
 1089            {
 01090                var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode
 1091                try
 1092                {
 01093                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 01094                    CloudError _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseC
 01095                    if (_errorBody != null)
 1096                    {
 01097                        ex = new CloudException(_errorBody.Message);
 01098                        ex.Body = _errorBody;
 1099                    }
 01100                }
 01101                catch (JsonException)
 1102                {
 1103                    // Ignore the exception
 01104                }
 01105                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 01106                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 01107                if (_httpResponse.Headers.Contains("x-ms-request-id"))
 1108                {
 01109                    ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 1110                }
 01111                if (_shouldTrace)
 1112                {
 01113                    ServiceClientTracing.Error(_invocationId, ex);
 1114                }
 01115                _httpRequest.Dispose();
 01116                if (_httpResponse != null)
 1117                {
 01118                    _httpResponse.Dispose();
 1119                }
 01120                throw ex;
 1121            }
 1122            // Create Result
 01123            var _result = new AzureOperationResponse<IPage<PrivateEndpointConnection>>();
 01124            _result.Request = _httpRequest;
 01125            _result.Response = _httpResponse;
 01126            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 1127            {
 01128                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 1129            }
 1130            // Deserialize Response
 01131            if ((int)_statusCode == 200)
 1132            {
 01133                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 1134                try
 1135                {
 01136                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page1<PrivateEndpointConnection>
 01137                }
 01138                catch (JsonException ex)
 1139                {
 01140                    _httpRequest.Dispose();
 01141                    if (_httpResponse != null)
 1142                    {
 01143                        _httpResponse.Dispose();
 1144                    }
 01145                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 1146                }
 1147            }
 01148            if (_shouldTrace)
 1149            {
 01150                ServiceClientTracing.Exit(_invocationId, _result);
 1151            }
 01152            return _result;
 01153        }
 1154
 1155    }
 1156}