< Summary

Class:Microsoft.Azure.ContainerRegistry.ManifestsOperations
Assembly:Microsoft.Azure.ContainerRegistry
File(s):C:\Git\azure-sdk-for-net\sdk\containerregistry\Microsoft.Azure.ContainerRegistry\src\Generated\ManifestsOperations.cs
Covered lines:291
Uncovered lines:242
Coverable lines:533
Total lines:1179
Line coverage:54.5% (291 of 533)
Covered branches:148
Total branches:310
Branch coverage:47.7% (148 of 310)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
get_Client()-100%100%
GetWithHttpMessagesAsync()-54.95%50%
CreateWithHttpMessagesAsync()-54%48.21%
DeleteWithHttpMessagesAsync()-55.84%47.83%
GetListWithHttpMessagesAsync()-51.65%46.3%
GetAttributesWithHttpMessagesAsync()-53.49%46%
UpdateAttributesWithHttpMessagesAsync()-56.1%47.92%

File(s)

C:\Git\azure-sdk-for-net\sdk\containerregistry\Microsoft.Azure.ContainerRegistry\src\Generated\ManifestsOperations.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.ContainerRegistry
 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    /// ManifestsOperations operations.
 27    /// </summary>
 28    internal partial class ManifestsOperations : IServiceOperations<AzureContainerRegistryClient>, IManifestsOperations
 29    {
 30        /// <summary>
 31        /// Initializes a new instance of the ManifestsOperations 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>
 6039        internal ManifestsOperations(AzureContainerRegistryClient client)
 40        {
 6041            if (client == null)
 42            {
 043                throw new System.ArgumentNullException("client");
 44            }
 6045            Client = client;
 6046        }
 47
 48        /// <summary>
 49        /// Gets a reference to the AzureContainerRegistryClient
 50        /// </summary>
 37051        public AzureContainerRegistryClient Client { get; private set; }
 52
 53        /// <summary>
 54        /// Get the manifest identified by `name` and `reference` where `reference` can
 55        /// be a tag or digest.
 56        /// </summary>
 57        /// <param name='name'>
 58        /// Name of the image (including the namespace)
 59        /// </param>
 60        /// <param name='reference'>
 61        /// A tag or a digest, pointing to a specific image
 62        /// </param>
 63        /// <param name='accept'>
 64        /// Accept header string delimited by comma. For example,
 65        /// application/vnd.docker.distribution.manifest.v2+json
 66        /// </param>
 67        /// <param name='customHeaders'>
 68        /// Headers that will be added to request.
 69        /// </param>
 70        /// <param name='cancellationToken'>
 71        /// The cancellation token.
 72        /// </param>
 73        /// <exception cref="AcrErrorsException">
 74        /// Thrown when the operation returned an invalid status code
 75        /// </exception>
 76        /// <exception cref="SerializationException">
 77        /// Thrown when unable to deserialize the response
 78        /// </exception>
 79        /// <exception cref="ValidationException">
 80        /// Thrown when a required parameter is null
 81        /// </exception>
 82        /// <exception cref="System.ArgumentNullException">
 83        /// Thrown when a required parameter is null
 84        /// </exception>
 85        /// <return>
 86        /// A response object containing the response body and response headers.
 87        /// </return>
 88        public async Task<AzureOperationResponse<ManifestWrapper>> GetWithHttpMessagesAsync(string name, string referenc
 89        {
 1290            if (Client.LoginUri == null)
 91            {
 092                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.LoginUri");
 93            }
 1294            if (name == null)
 95            {
 096                throw new ValidationException(ValidationRules.CannotBeNull, "name");
 97            }
 1298            if (reference == null)
 99            {
 0100                throw new ValidationException(ValidationRules.CannotBeNull, "reference");
 101            }
 102            // Tracing
 12103            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 12104            string _invocationId = null;
 12105            if (_shouldTrace)
 106            {
 0107                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0108                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0109                tracingParameters.Add("name", name);
 0110                tracingParameters.Add("reference", reference);
 0111                tracingParameters.Add("accept", accept);
 0112                tracingParameters.Add("cancellationToken", cancellationToken);
 0113                ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
 114            }
 115            // Construct URL
 12116            var _baseUrl = Client.BaseUri;
 12117            var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "v2/{name}/manifests/{reference}";
 12118            _url = _url.Replace("{url}", Client.LoginUri);
 12119            _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
 12120            _url = _url.Replace("{reference}", System.Uri.EscapeDataString(reference));
 12121            List<string> _queryParameters = new List<string>();
 12122            if (_queryParameters.Count > 0)
 123            {
 0124                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 125            }
 126            // Create HTTP transport objects
 12127            var _httpRequest = new HttpRequestMessage();
 12128            HttpResponseMessage _httpResponse = null;
 12129            _httpRequest.Method = new HttpMethod("GET");
 12130            _httpRequest.RequestUri = new System.Uri(_url);
 131            // Set Headers
 12132            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 133            {
 12134                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 135            }
 12136            if (accept != null)
 137            {
 10138                if (_httpRequest.Headers.Contains("accept"))
 139                {
 0140                    _httpRequest.Headers.Remove("accept");
 141                }
 10142                _httpRequest.Headers.TryAddWithoutValidation("accept", accept);
 143            }
 12144            if (Client.AcceptLanguage != null)
 145            {
 12146                if (_httpRequest.Headers.Contains("accept-language"))
 147                {
 0148                    _httpRequest.Headers.Remove("accept-language");
 149                }
 12150                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 151            }
 152
 153
 12154            if (customHeaders != null)
 155            {
 0156                foreach(var _header in customHeaders)
 157                {
 0158                    if (_httpRequest.Headers.Contains(_header.Key))
 159                    {
 0160                        _httpRequest.Headers.Remove(_header.Key);
 161                    }
 0162                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 163                }
 164            }
 165
 166            // Serialize Request
 12167            string _requestContent = null;
 168            // Set Credentials
 12169            if (Client.Credentials != null)
 170            {
 12171                cancellationToken.ThrowIfCancellationRequested();
 12172                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 173            }
 174            // Send Request
 12175            if (_shouldTrace)
 176            {
 0177                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 178            }
 12179            cancellationToken.ThrowIfCancellationRequested();
 12180            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 12181            if (_shouldTrace)
 182            {
 0183                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 184            }
 12185            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 12186            cancellationToken.ThrowIfCancellationRequested();
 12187            string _responseContent = null;
 12188            if ((int)_statusCode != 200)
 189            {
 0190                var ex = new AcrErrorsException(string.Format("Operation returned an invalid status code '{0}'", _status
 191                try
 192                {
 0193                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0194                    AcrErrors _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<AcrErrors>(_responseCon
 0195                    if (_errorBody != null)
 196                    {
 0197                        ex.Body = _errorBody;
 198                    }
 0199                }
 0200                catch (JsonException)
 201                {
 202                    // Ignore the exception
 0203                }
 0204                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0205                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0206                if (_shouldTrace)
 207                {
 0208                    ServiceClientTracing.Error(_invocationId, ex);
 209                }
 0210                _httpRequest.Dispose();
 0211                if (_httpResponse != null)
 212                {
 0213                    _httpResponse.Dispose();
 214                }
 0215                throw ex;
 216            }
 217            // Create Result
 12218            var _result = new AzureOperationResponse<ManifestWrapper>();
 12219            _result.Request = _httpRequest;
 12220            _result.Response = _httpResponse;
 12221            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 222            {
 12223                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 224            }
 225            // Deserialize Response
 12226            if ((int)_statusCode == 200)
 227            {
 12228                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 229                try
 230                {
 12231                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ManifestWrapper>(_responseConten
 12232                }
 0233                catch (JsonException ex)
 234                {
 0235                    _httpRequest.Dispose();
 0236                    if (_httpResponse != null)
 237                    {
 0238                        _httpResponse.Dispose();
 239                    }
 0240                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 241                }
 242            }
 12243            if (_shouldTrace)
 244            {
 0245                ServiceClientTracing.Exit(_invocationId, _result);
 246            }
 12247            return _result;
 12248        }
 249
 250        /// <summary>
 251        /// Put the manifest identified by `name` and `reference` where `reference` can
 252        /// be a tag or digest.
 253        /// </summary>
 254        /// <param name='name'>
 255        /// Name of the image (including the namespace)
 256        /// </param>
 257        /// <param name='reference'>
 258        /// A tag or a digest, pointing to a specific image
 259        /// </param>
 260        /// <param name='payload'>
 261        /// Manifest body, can take v1 or v2 values depending on accept header
 262        /// </param>
 263        /// <param name='customHeaders'>
 264        /// Headers that will be added to request.
 265        /// </param>
 266        /// <param name='cancellationToken'>
 267        /// The cancellation token.
 268        /// </param>
 269        /// <exception cref="AcrErrorsException">
 270        /// Thrown when the operation returned an invalid status code
 271        /// </exception>
 272        /// <exception cref="SerializationException">
 273        /// Thrown when unable to deserialize the response
 274        /// </exception>
 275        /// <exception cref="ValidationException">
 276        /// Thrown when a required parameter is null
 277        /// </exception>
 278        /// <exception cref="System.ArgumentNullException">
 279        /// Thrown when a required parameter is null
 280        /// </exception>
 281        /// <return>
 282        /// A response object containing the response body and response headers.
 283        /// </return>
 284        public async Task<AzureOperationResponse<object,ManifestsCreateHeaders>> CreateWithHttpMessagesAsync(string name
 285        {
 2286            if (Client.LoginUri == null)
 287            {
 0288                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.LoginUri");
 289            }
 2290            if (name == null)
 291            {
 0292                throw new ValidationException(ValidationRules.CannotBeNull, "name");
 293            }
 2294            if (reference == null)
 295            {
 0296                throw new ValidationException(ValidationRules.CannotBeNull, "reference");
 297            }
 2298            if (payload == null)
 299            {
 0300                throw new ValidationException(ValidationRules.CannotBeNull, "payload");
 301            }
 302            // Tracing
 2303            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 2304            string _invocationId = null;
 2305            if (_shouldTrace)
 306            {
 0307                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0308                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0309                tracingParameters.Add("name", name);
 0310                tracingParameters.Add("reference", reference);
 0311                tracingParameters.Add("payload", payload);
 0312                tracingParameters.Add("cancellationToken", cancellationToken);
 0313                ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters);
 314            }
 315            // Construct URL
 2316            var _baseUrl = Client.BaseUri;
 2317            var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "v2/{name}/manifests/{reference}";
 2318            _url = _url.Replace("{url}", Client.LoginUri);
 2319            _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
 2320            _url = _url.Replace("{reference}", System.Uri.EscapeDataString(reference));
 2321            List<string> _queryParameters = new List<string>();
 2322            if (_queryParameters.Count > 0)
 323            {
 0324                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 325            }
 326            // Create HTTP transport objects
 2327            var _httpRequest = new HttpRequestMessage();
 2328            HttpResponseMessage _httpResponse = null;
 2329            _httpRequest.Method = new HttpMethod("PUT");
 2330            _httpRequest.RequestUri = new System.Uri(_url);
 331            // Set Headers
 2332            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 333            {
 2334                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 335            }
 2336            if (Client.AcceptLanguage != null)
 337            {
 2338                if (_httpRequest.Headers.Contains("accept-language"))
 339                {
 0340                    _httpRequest.Headers.Remove("accept-language");
 341                }
 2342                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 343            }
 344
 345
 2346            if (customHeaders != null)
 347            {
 0348                foreach(var _header in customHeaders)
 349                {
 0350                    if (_httpRequest.Headers.Contains(_header.Key))
 351                    {
 0352                        _httpRequest.Headers.Remove(_header.Key);
 353                    }
 0354                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 355                }
 356            }
 357
 358            // Serialize Request
 2359            string _requestContent = null;
 2360            if(payload != null)
 361            {
 2362                _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(payload, Client.SerializationSettin
 2363                _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
 2364                _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("applicatio
 365            }
 366            // Set Credentials
 2367            if (Client.Credentials != null)
 368            {
 2369                cancellationToken.ThrowIfCancellationRequested();
 2370                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 371            }
 372            // Send Request
 2373            if (_shouldTrace)
 374            {
 0375                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 376            }
 2377            cancellationToken.ThrowIfCancellationRequested();
 2378            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 2379            if (_shouldTrace)
 380            {
 0381                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 382            }
 2383            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 2384            cancellationToken.ThrowIfCancellationRequested();
 2385            string _responseContent = null;
 2386            if ((int)_statusCode != 201)
 387            {
 0388                var ex = new AcrErrorsException(string.Format("Operation returned an invalid status code '{0}'", _status
 389                try
 390                {
 0391                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0392                    AcrErrors _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<AcrErrors>(_responseCon
 0393                    if (_errorBody != null)
 394                    {
 0395                        ex.Body = _errorBody;
 396                    }
 0397                }
 0398                catch (JsonException)
 399                {
 400                    // Ignore the exception
 0401                }
 0402                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0403                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0404                if (_shouldTrace)
 405                {
 0406                    ServiceClientTracing.Error(_invocationId, ex);
 407                }
 0408                _httpRequest.Dispose();
 0409                if (_httpResponse != null)
 410                {
 0411                    _httpResponse.Dispose();
 412                }
 0413                throw ex;
 414            }
 415            // Create Result
 2416            var _result = new AzureOperationResponse<object,ManifestsCreateHeaders>();
 2417            _result.Request = _httpRequest;
 2418            _result.Response = _httpResponse;
 2419            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 420            {
 2421                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 422            }
 423            // Deserialize Response
 2424            if ((int)_statusCode == 201)
 425            {
 2426                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 427                try
 428                {
 2429                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<object>(_responseContent, Client
 2430                }
 0431                catch (JsonException ex)
 432                {
 0433                    _httpRequest.Dispose();
 0434                    if (_httpResponse != null)
 435                    {
 0436                        _httpResponse.Dispose();
 437                    }
 0438                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 439                }
 440            }
 441            try
 442            {
 2443                _result.Headers = _httpResponse.GetHeadersAsJson().ToObject<ManifestsCreateHeaders>(JsonSerializer.Creat
 2444            }
 0445            catch (JsonException ex)
 446            {
 0447                _httpRequest.Dispose();
 0448                if (_httpResponse != null)
 449                {
 0450                    _httpResponse.Dispose();
 451                }
 0452                throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().
 453            }
 2454            if (_shouldTrace)
 455            {
 0456                ServiceClientTracing.Exit(_invocationId, _result);
 457            }
 2458            return _result;
 2459        }
 460
 461        /// <summary>
 462        /// Delete the manifest identified by `name` and `reference`. Note that a
 463        /// manifest can _only_ be deleted by `digest`.
 464        /// </summary>
 465        /// <param name='name'>
 466        /// Name of the image (including the namespace)
 467        /// </param>
 468        /// <param name='reference'>
 469        /// A tag or a digest, pointing to a specific image
 470        /// </param>
 471        /// <param name='customHeaders'>
 472        /// Headers that will be added to request.
 473        /// </param>
 474        /// <param name='cancellationToken'>
 475        /// The cancellation token.
 476        /// </param>
 477        /// <exception cref="AcrErrorsException">
 478        /// Thrown when the operation returned an invalid status code
 479        /// </exception>
 480        /// <exception cref="ValidationException">
 481        /// Thrown when a required parameter is null
 482        /// </exception>
 483        /// <exception cref="System.ArgumentNullException">
 484        /// Thrown when a required parameter is null
 485        /// </exception>
 486        /// <return>
 487        /// A response object containing the response body and response headers.
 488        /// </return>
 489        public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string name, string reference, Dictionary<
 490        {
 2491            if (Client.LoginUri == null)
 492            {
 0493                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.LoginUri");
 494            }
 2495            if (name == null)
 496            {
 0497                throw new ValidationException(ValidationRules.CannotBeNull, "name");
 498            }
 2499            if (reference == null)
 500            {
 0501                throw new ValidationException(ValidationRules.CannotBeNull, "reference");
 502            }
 503            // Tracing
 2504            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 2505            string _invocationId = null;
 2506            if (_shouldTrace)
 507            {
 0508                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0509                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0510                tracingParameters.Add("name", name);
 0511                tracingParameters.Add("reference", reference);
 0512                tracingParameters.Add("cancellationToken", cancellationToken);
 0513                ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
 514            }
 515            // Construct URL
 2516            var _baseUrl = Client.BaseUri;
 2517            var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "v2/{name}/manifests/{reference}";
 2518            _url = _url.Replace("{url}", Client.LoginUri);
 2519            _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
 2520            _url = _url.Replace("{reference}", System.Uri.EscapeDataString(reference));
 2521            List<string> _queryParameters = new List<string>();
 2522            if (_queryParameters.Count > 0)
 523            {
 0524                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 525            }
 526            // Create HTTP transport objects
 2527            var _httpRequest = new HttpRequestMessage();
 2528            HttpResponseMessage _httpResponse = null;
 2529            _httpRequest.Method = new HttpMethod("DELETE");
 2530            _httpRequest.RequestUri = new System.Uri(_url);
 531            // Set Headers
 2532            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 533            {
 2534                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 535            }
 2536            if (Client.AcceptLanguage != null)
 537            {
 2538                if (_httpRequest.Headers.Contains("accept-language"))
 539                {
 0540                    _httpRequest.Headers.Remove("accept-language");
 541                }
 2542                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 543            }
 544
 545
 2546            if (customHeaders != null)
 547            {
 0548                foreach(var _header in customHeaders)
 549                {
 0550                    if (_httpRequest.Headers.Contains(_header.Key))
 551                    {
 0552                        _httpRequest.Headers.Remove(_header.Key);
 553                    }
 0554                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 555                }
 556            }
 557
 558            // Serialize Request
 2559            string _requestContent = null;
 560            // Set Credentials
 2561            if (Client.Credentials != null)
 562            {
 2563                cancellationToken.ThrowIfCancellationRequested();
 2564                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 565            }
 566            // Send Request
 2567            if (_shouldTrace)
 568            {
 0569                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 570            }
 2571            cancellationToken.ThrowIfCancellationRequested();
 2572            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 2573            if (_shouldTrace)
 574            {
 0575                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 576            }
 2577            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 2578            cancellationToken.ThrowIfCancellationRequested();
 2579            string _responseContent = null;
 2580            if ((int)_statusCode != 202)
 581            {
 0582                var ex = new AcrErrorsException(string.Format("Operation returned an invalid status code '{0}'", _status
 583                try
 584                {
 0585                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0586                    AcrErrors _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<AcrErrors>(_responseCon
 0587                    if (_errorBody != null)
 588                    {
 0589                        ex.Body = _errorBody;
 590                    }
 0591                }
 0592                catch (JsonException)
 593                {
 594                    // Ignore the exception
 0595                }
 0596                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0597                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0598                if (_shouldTrace)
 599                {
 0600                    ServiceClientTracing.Error(_invocationId, ex);
 601                }
 0602                _httpRequest.Dispose();
 0603                if (_httpResponse != null)
 604                {
 0605                    _httpResponse.Dispose();
 606                }
 0607                throw ex;
 608            }
 609            // Create Result
 2610            var _result = new AzureOperationResponse();
 2611            _result.Request = _httpRequest;
 2612            _result.Response = _httpResponse;
 2613            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 614            {
 2615                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 616            }
 2617            if (_shouldTrace)
 618            {
 0619                ServiceClientTracing.Exit(_invocationId, _result);
 620            }
 2621            return _result;
 2622        }
 623
 624        /// <summary>
 625        /// List manifests of a repository
 626        /// </summary>
 627        /// <param name='name'>
 628        /// Name of the image (including the namespace)
 629        /// </param>
 630        /// <param name='last'>
 631        /// Query parameter for the last item in previous query. Result set will
 632        /// include values lexically after last.
 633        /// </param>
 634        /// <param name='n'>
 635        /// query parameter for max number of items
 636        /// </param>
 637        /// <param name='orderby'>
 638        /// orderby query parameter
 639        /// </param>
 640        /// <param name='customHeaders'>
 641        /// Headers that will be added to request.
 642        /// </param>
 643        /// <param name='cancellationToken'>
 644        /// The cancellation token.
 645        /// </param>
 646        /// <exception cref="AcrErrorsException">
 647        /// Thrown when the operation returned an invalid status code
 648        /// </exception>
 649        /// <exception cref="SerializationException">
 650        /// Thrown when unable to deserialize the response
 651        /// </exception>
 652        /// <exception cref="ValidationException">
 653        /// Thrown when a required parameter is null
 654        /// </exception>
 655        /// <exception cref="System.ArgumentNullException">
 656        /// Thrown when a required parameter is null
 657        /// </exception>
 658        /// <return>
 659        /// A response object containing the response body and response headers.
 660        /// </return>
 661        public async Task<AzureOperationResponse<AcrManifests>> GetListWithHttpMessagesAsync(string name, string last = 
 662        {
 2663            if (Client.LoginUri == null)
 664            {
 0665                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.LoginUri");
 666            }
 2667            if (name == null)
 668            {
 0669                throw new ValidationException(ValidationRules.CannotBeNull, "name");
 670            }
 671            // Tracing
 2672            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 2673            string _invocationId = null;
 2674            if (_shouldTrace)
 675            {
 0676                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0677                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0678                tracingParameters.Add("name", name);
 0679                tracingParameters.Add("last", last);
 0680                tracingParameters.Add("n", n);
 0681                tracingParameters.Add("orderby", orderby);
 0682                tracingParameters.Add("cancellationToken", cancellationToken);
 0683                ServiceClientTracing.Enter(_invocationId, this, "GetList", tracingParameters);
 684            }
 685            // Construct URL
 2686            var _baseUrl = Client.BaseUri;
 2687            var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "acr/v1/{name}/_manifests";
 2688            _url = _url.Replace("{url}", Client.LoginUri);
 2689            _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
 2690            List<string> _queryParameters = new List<string>();
 2691            if (last != null)
 692            {
 0693                _queryParameters.Add(string.Format("last={0}", System.Uri.EscapeDataString(last)));
 694            }
 2695            if (n != null)
 696            {
 0697                _queryParameters.Add(string.Format("n={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConve
 698            }
 2699            if (orderby != null)
 700            {
 0701                _queryParameters.Add(string.Format("orderby={0}", System.Uri.EscapeDataString(orderby)));
 702            }
 2703            if (_queryParameters.Count > 0)
 704            {
 0705                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 706            }
 707            // Create HTTP transport objects
 2708            var _httpRequest = new HttpRequestMessage();
 2709            HttpResponseMessage _httpResponse = null;
 2710            _httpRequest.Method = new HttpMethod("GET");
 2711            _httpRequest.RequestUri = new System.Uri(_url);
 712            // Set Headers
 2713            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 714            {
 2715                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 716            }
 2717            if (Client.AcceptLanguage != null)
 718            {
 2719                if (_httpRequest.Headers.Contains("accept-language"))
 720                {
 0721                    _httpRequest.Headers.Remove("accept-language");
 722                }
 2723                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 724            }
 725
 726
 2727            if (customHeaders != null)
 728            {
 0729                foreach(var _header in customHeaders)
 730                {
 0731                    if (_httpRequest.Headers.Contains(_header.Key))
 732                    {
 0733                        _httpRequest.Headers.Remove(_header.Key);
 734                    }
 0735                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 736                }
 737            }
 738
 739            // Serialize Request
 2740            string _requestContent = null;
 741            // Set Credentials
 2742            if (Client.Credentials != null)
 743            {
 2744                cancellationToken.ThrowIfCancellationRequested();
 2745                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 746            }
 747            // Send Request
 2748            if (_shouldTrace)
 749            {
 0750                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 751            }
 2752            cancellationToken.ThrowIfCancellationRequested();
 2753            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 2754            if (_shouldTrace)
 755            {
 0756                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 757            }
 2758            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 2759            cancellationToken.ThrowIfCancellationRequested();
 2760            string _responseContent = null;
 2761            if ((int)_statusCode != 200)
 762            {
 0763                var ex = new AcrErrorsException(string.Format("Operation returned an invalid status code '{0}'", _status
 764                try
 765                {
 0766                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0767                    AcrErrors _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<AcrErrors>(_responseCon
 0768                    if (_errorBody != null)
 769                    {
 0770                        ex.Body = _errorBody;
 771                    }
 0772                }
 0773                catch (JsonException)
 774                {
 775                    // Ignore the exception
 0776                }
 0777                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0778                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0779                if (_shouldTrace)
 780                {
 0781                    ServiceClientTracing.Error(_invocationId, ex);
 782                }
 0783                _httpRequest.Dispose();
 0784                if (_httpResponse != null)
 785                {
 0786                    _httpResponse.Dispose();
 787                }
 0788                throw ex;
 789            }
 790            // Create Result
 2791            var _result = new AzureOperationResponse<AcrManifests>();
 2792            _result.Request = _httpRequest;
 2793            _result.Response = _httpResponse;
 2794            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 795            {
 0796                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 797            }
 798            // Deserialize Response
 2799            if ((int)_statusCode == 200)
 800            {
 2801                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 802                try
 803                {
 2804                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<AcrManifests>(_responseContent, 
 2805                }
 0806                catch (JsonException ex)
 807                {
 0808                    _httpRequest.Dispose();
 0809                    if (_httpResponse != null)
 810                    {
 0811                        _httpResponse.Dispose();
 812                    }
 0813                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 814                }
 815            }
 2816            if (_shouldTrace)
 817            {
 0818                ServiceClientTracing.Exit(_invocationId, _result);
 819            }
 2820            return _result;
 2821        }
 822
 823        /// <summary>
 824        /// Get manifest attributes
 825        /// </summary>
 826        /// <param name='name'>
 827        /// Name of the image (including the namespace)
 828        /// </param>
 829        /// <param name='reference'>
 830        /// A tag or a digest, pointing to a specific image
 831        /// </param>
 832        /// <param name='customHeaders'>
 833        /// Headers that will be added to request.
 834        /// </param>
 835        /// <param name='cancellationToken'>
 836        /// The cancellation token.
 837        /// </param>
 838        /// <exception cref="AcrErrorsException">
 839        /// Thrown when the operation returned an invalid status code
 840        /// </exception>
 841        /// <exception cref="SerializationException">
 842        /// Thrown when unable to deserialize the response
 843        /// </exception>
 844        /// <exception cref="ValidationException">
 845        /// Thrown when a required parameter is null
 846        /// </exception>
 847        /// <exception cref="System.ArgumentNullException">
 848        /// Thrown when a required parameter is null
 849        /// </exception>
 850        /// <return>
 851        /// A response object containing the response body and response headers.
 852        /// </return>
 853        public async Task<AzureOperationResponse<ManifestAttributes>> GetAttributesWithHttpMessagesAsync(string name, st
 854        {
 6855            if (Client.LoginUri == null)
 856            {
 0857                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.LoginUri");
 858            }
 6859            if (name == null)
 860            {
 0861                throw new ValidationException(ValidationRules.CannotBeNull, "name");
 862            }
 6863            if (reference == null)
 864            {
 0865                throw new ValidationException(ValidationRules.CannotBeNull, "reference");
 866            }
 867            // Tracing
 6868            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 6869            string _invocationId = null;
 6870            if (_shouldTrace)
 871            {
 0872                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 0873                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 0874                tracingParameters.Add("name", name);
 0875                tracingParameters.Add("reference", reference);
 0876                tracingParameters.Add("cancellationToken", cancellationToken);
 0877                ServiceClientTracing.Enter(_invocationId, this, "GetAttributes", tracingParameters);
 878            }
 879            // Construct URL
 6880            var _baseUrl = Client.BaseUri;
 6881            var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "acr/v1/{name}/_manifests/{reference}";
 6882            _url = _url.Replace("{url}", Client.LoginUri);
 6883            _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
 6884            _url = _url.Replace("{reference}", System.Uri.EscapeDataString(reference));
 6885            List<string> _queryParameters = new List<string>();
 6886            if (_queryParameters.Count > 0)
 887            {
 0888                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 889            }
 890            // Create HTTP transport objects
 6891            var _httpRequest = new HttpRequestMessage();
 6892            HttpResponseMessage _httpResponse = null;
 6893            _httpRequest.Method = new HttpMethod("GET");
 6894            _httpRequest.RequestUri = new System.Uri(_url);
 895            // Set Headers
 6896            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 897            {
 6898                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 899            }
 6900            if (Client.AcceptLanguage != null)
 901            {
 6902                if (_httpRequest.Headers.Contains("accept-language"))
 903                {
 0904                    _httpRequest.Headers.Remove("accept-language");
 905                }
 6906                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 907            }
 908
 909
 6910            if (customHeaders != null)
 911            {
 0912                foreach(var _header in customHeaders)
 913                {
 0914                    if (_httpRequest.Headers.Contains(_header.Key))
 915                    {
 0916                        _httpRequest.Headers.Remove(_header.Key);
 917                    }
 0918                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 919                }
 920            }
 921
 922            // Serialize Request
 6923            string _requestContent = null;
 924            // Set Credentials
 6925            if (Client.Credentials != null)
 926            {
 6927                cancellationToken.ThrowIfCancellationRequested();
 6928                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 929            }
 930            // Send Request
 6931            if (_shouldTrace)
 932            {
 0933                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 934            }
 6935            cancellationToken.ThrowIfCancellationRequested();
 6936            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 6937            if (_shouldTrace)
 938            {
 0939                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 940            }
 6941            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 6942            cancellationToken.ThrowIfCancellationRequested();
 6943            string _responseContent = null;
 6944            if ((int)_statusCode != 200)
 945            {
 0946                var ex = new AcrErrorsException(string.Format("Operation returned an invalid status code '{0}'", _status
 947                try
 948                {
 0949                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 0950                    AcrErrors _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<AcrErrors>(_responseCon
 0951                    if (_errorBody != null)
 952                    {
 0953                        ex.Body = _errorBody;
 954                    }
 0955                }
 0956                catch (JsonException)
 957                {
 958                    // Ignore the exception
 0959                }
 0960                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 0961                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 0962                if (_shouldTrace)
 963                {
 0964                    ServiceClientTracing.Error(_invocationId, ex);
 965                }
 0966                _httpRequest.Dispose();
 0967                if (_httpResponse != null)
 968                {
 0969                    _httpResponse.Dispose();
 970                }
 0971                throw ex;
 972            }
 973            // Create Result
 6974            var _result = new AzureOperationResponse<ManifestAttributes>();
 6975            _result.Request = _httpRequest;
 6976            _result.Response = _httpResponse;
 6977            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 978            {
 0979                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 980            }
 981            // Deserialize Response
 6982            if ((int)_statusCode == 200)
 983            {
 6984                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 985                try
 986                {
 6987                    _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ManifestAttributes>(_responseCon
 6988                }
 0989                catch (JsonException ex)
 990                {
 0991                    _httpRequest.Dispose();
 0992                    if (_httpResponse != null)
 993                    {
 0994                        _httpResponse.Dispose();
 995                    }
 0996                    throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
 997                }
 998            }
 6999            if (_shouldTrace)
 1000            {
 01001                ServiceClientTracing.Exit(_invocationId, _result);
 1002            }
 61003            return _result;
 61004        }
 1005
 1006        /// <summary>
 1007        /// Update attributes of a manifest
 1008        /// </summary>
 1009        /// <param name='name'>
 1010        /// Name of the image (including the namespace)
 1011        /// </param>
 1012        /// <param name='reference'>
 1013        /// A tag or a digest, pointing to a specific image
 1014        /// </param>
 1015        /// <param name='value'>
 1016        /// Repository attribute value
 1017        /// </param>
 1018        /// <param name='customHeaders'>
 1019        /// Headers that will be added to request.
 1020        /// </param>
 1021        /// <param name='cancellationToken'>
 1022        /// The cancellation token.
 1023        /// </param>
 1024        /// <exception cref="AcrErrorsException">
 1025        /// Thrown when the operation returned an invalid status code
 1026        /// </exception>
 1027        /// <exception cref="ValidationException">
 1028        /// Thrown when a required parameter is null
 1029        /// </exception>
 1030        /// <exception cref="System.ArgumentNullException">
 1031        /// Thrown when a required parameter is null
 1032        /// </exception>
 1033        /// <return>
 1034        /// A response object containing the response body and response headers.
 1035        /// </return>
 1036        public async Task<AzureOperationResponse> UpdateAttributesWithHttpMessagesAsync(string name, string reference, C
 1037        {
 41038            if (Client.LoginUri == null)
 1039            {
 01040                throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.LoginUri");
 1041            }
 41042            if (name == null)
 1043            {
 01044                throw new ValidationException(ValidationRules.CannotBeNull, "name");
 1045            }
 41046            if (reference == null)
 1047            {
 01048                throw new ValidationException(ValidationRules.CannotBeNull, "reference");
 1049            }
 1050            // Tracing
 41051            bool _shouldTrace = ServiceClientTracing.IsEnabled;
 41052            string _invocationId = null;
 41053            if (_shouldTrace)
 1054            {
 01055                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
 01056                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
 01057                tracingParameters.Add("name", name);
 01058                tracingParameters.Add("reference", reference);
 01059                tracingParameters.Add("value", value);
 01060                tracingParameters.Add("cancellationToken", cancellationToken);
 01061                ServiceClientTracing.Enter(_invocationId, this, "UpdateAttributes", tracingParameters);
 1062            }
 1063            // Construct URL
 41064            var _baseUrl = Client.BaseUri;
 41065            var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "acr/v1/{name}/_manifests/{reference}";
 41066            _url = _url.Replace("{url}", Client.LoginUri);
 41067            _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
 41068            _url = _url.Replace("{reference}", System.Uri.EscapeDataString(reference));
 41069            List<string> _queryParameters = new List<string>();
 41070            if (_queryParameters.Count > 0)
 1071            {
 01072                _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
 1073            }
 1074            // Create HTTP transport objects
 41075            var _httpRequest = new HttpRequestMessage();
 41076            HttpResponseMessage _httpResponse = null;
 41077            _httpRequest.Method = new HttpMethod("PATCH");
 41078            _httpRequest.RequestUri = new System.Uri(_url);
 1079            // Set Headers
 41080            if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
 1081            {
 41082                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString())
 1083            }
 41084            if (Client.AcceptLanguage != null)
 1085            {
 41086                if (_httpRequest.Headers.Contains("accept-language"))
 1087                {
 01088                    _httpRequest.Headers.Remove("accept-language");
 1089                }
 41090                _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
 1091            }
 1092
 1093
 41094            if (customHeaders != null)
 1095            {
 01096                foreach(var _header in customHeaders)
 1097                {
 01098                    if (_httpRequest.Headers.Contains(_header.Key))
 1099                    {
 01100                        _httpRequest.Headers.Remove(_header.Key);
 1101                    }
 01102                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
 1103                }
 1104            }
 1105
 1106            // Serialize Request
 41107            string _requestContent = null;
 41108            if(value != null)
 1109            {
 41110                _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(value, Client.SerializationSettings
 41111                _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
 41112                _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("applicatio
 1113            }
 1114            // Set Credentials
 41115            if (Client.Credentials != null)
 1116            {
 41117                cancellationToken.ThrowIfCancellationRequested();
 41118                await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 1119            }
 1120            // Send Request
 41121            if (_shouldTrace)
 1122            {
 01123                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
 1124            }
 41125            cancellationToken.ThrowIfCancellationRequested();
 41126            _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
 41127            if (_shouldTrace)
 1128            {
 01129                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
 1130            }
 41131            HttpStatusCode _statusCode = _httpResponse.StatusCode;
 41132            cancellationToken.ThrowIfCancellationRequested();
 41133            string _responseContent = null;
 41134            if ((int)_statusCode != 200)
 1135            {
 01136                var ex = new AcrErrorsException(string.Format("Operation returned an invalid status code '{0}'", _status
 1137                try
 1138                {
 01139                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
 01140                    AcrErrors _errorBody =  Rest.Serialization.SafeJsonConvert.DeserializeObject<AcrErrors>(_responseCon
 01141                    if (_errorBody != null)
 1142                    {
 01143                        ex.Body = _errorBody;
 1144                    }
 01145                }
 01146                catch (JsonException)
 1147                {
 1148                    // Ignore the exception
 01149                }
 01150                ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
 01151                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
 01152                if (_shouldTrace)
 1153                {
 01154                    ServiceClientTracing.Error(_invocationId, ex);
 1155                }
 01156                _httpRequest.Dispose();
 01157                if (_httpResponse != null)
 1158                {
 01159                    _httpResponse.Dispose();
 1160                }
 01161                throw ex;
 1162            }
 1163            // Create Result
 41164            var _result = new AzureOperationResponse();
 41165            _result.Request = _httpRequest;
 41166            _result.Response = _httpResponse;
 41167            if (_httpResponse.Headers.Contains("x-ms-request-id"))
 1168            {
 01169                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
 1170            }
 41171            if (_shouldTrace)
 1172            {
 01173                ServiceClientTracing.Exit(_invocationId, _result);
 1174            }
 41175            return _result;
 41176        }
 1177
 1178    }
 1179}