< Summary

Class:Azure.Security.KeyVault.Administration.RoleAssignmentsRestClient
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\RoleAssignmentsRestClient.cs
Covered lines:139
Uncovered lines:69
Coverable lines:208
Total lines:499
Line coverage:66.8% (139 of 208)
Covered branches:35
Total branches:84
Branch coverage:41.6% (35 of 84)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-85.71%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-71.43%50%
Delete(...)-71.43%50%
CreateCreateRequest(...)-100%100%
CreateAsync()-68.75%50%
Create(...)-68.75%50%
CreateGetRequest(...)-100%100%
GetAsync()-71.43%50%
Get(...)-78.57%62.5%
CreateListForScopeRequest(...)-92.31%50%
ListForScopeAsync()-75%50%
ListForScope(...)-75%50%
CreateListForScopeNextPageRequest(...)-0%100%
ListForScopeNextPageAsync()-0%0%
ListForScopeNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\RoleAssignmentsRestClient.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Text.Json;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core;
 14using Azure.Core.Pipeline;
 15using Azure.Security.KeyVault.Administration.Models;
 16
 17namespace Azure.Security.KeyVault.Administration
 18{
 19    internal partial class RoleAssignmentsRestClient
 20    {
 21        private string apiVersion;
 22        private ClientDiagnostics _clientDiagnostics;
 23        private HttpPipeline _pipeline;
 24
 25        /// <summary> Initializes a new instance of RoleAssignmentsRestClient. </summary>
 26        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 27        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 28        /// <param name="apiVersion"> Api Version. </param>
 29        /// <exception cref="ArgumentNullException"> <paramref name="apiVersion"/> is null. </exception>
 4230        public RoleAssignmentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion =
 31        {
 4232            if (apiVersion == null)
 33            {
 034                throw new ArgumentNullException(nameof(apiVersion));
 35            }
 36
 4237            this.apiVersion = apiVersion;
 4238            _clientDiagnostics = clientDiagnostics;
 4239            _pipeline = pipeline;
 4240        }
 41
 42        internal HttpMessage CreateDeleteRequest(string vaultBaseUrl, string scope, string roleAssignmentName)
 43        {
 1044            var message = _pipeline.CreateMessage();
 1045            var request = message.Request;
 1046            request.Method = RequestMethod.Delete;
 1047            var uri = new RawRequestUriBuilder();
 1048            uri.AppendRaw(vaultBaseUrl, false);
 1049            uri.AppendPath("/", false);
 1050            uri.AppendPath(scope, false);
 1051            uri.AppendPath("/providers/Microsoft.Authorization/roleAssignments/", false);
 1052            uri.AppendPath(roleAssignmentName, true);
 1053            uri.AppendQuery("api-version", apiVersion, true);
 1054            request.Uri = uri;
 1055            return message;
 56        }
 57
 58        /// <summary> Deletes a role assignment. </summary>
 59        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 60        /// <param name="scope"> The scope of the role assignment to delete. </param>
 61        /// <param name="roleAssignmentName"> The name of the role assignment to delete. </param>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/>, <paramref name="scope"/>, or <para
 64        public async Task<Response<RoleAssignment>> DeleteAsync(string vaultBaseUrl, string scope, string roleAssignment
 65        {
 466            if (vaultBaseUrl == null)
 67            {
 068                throw new ArgumentNullException(nameof(vaultBaseUrl));
 69            }
 470            if (scope == null)
 71            {
 072                throw new ArgumentNullException(nameof(scope));
 73            }
 474            if (roleAssignmentName == null)
 75            {
 076                throw new ArgumentNullException(nameof(roleAssignmentName));
 77            }
 78
 479            using var message = CreateDeleteRequest(vaultBaseUrl, scope, roleAssignmentName);
 480            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 481            switch (message.Response.Status)
 82            {
 83                case 200:
 84                    {
 85                        RoleAssignment value = default;
 486                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 487                        value = RoleAssignment.DeserializeRoleAssignment(document.RootElement);
 488                        return Response.FromValue(value, message.Response);
 89                    }
 90                default:
 091                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 92            }
 493        }
 94
 95        /// <summary> Deletes a role assignment. </summary>
 96        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 97        /// <param name="scope"> The scope of the role assignment to delete. </param>
 98        /// <param name="roleAssignmentName"> The name of the role assignment to delete. </param>
 99        /// <param name="cancellationToken"> The cancellation token to use. </param>
 100        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/>, <paramref name="scope"/>, or <para
 101        public Response<RoleAssignment> Delete(string vaultBaseUrl, string scope, string roleAssignmentName, Cancellatio
 102        {
 6103            if (vaultBaseUrl == null)
 104            {
 0105                throw new ArgumentNullException(nameof(vaultBaseUrl));
 106            }
 6107            if (scope == null)
 108            {
 0109                throw new ArgumentNullException(nameof(scope));
 110            }
 6111            if (roleAssignmentName == null)
 112            {
 0113                throw new ArgumentNullException(nameof(roleAssignmentName));
 114            }
 115
 6116            using var message = CreateDeleteRequest(vaultBaseUrl, scope, roleAssignmentName);
 6117            _pipeline.Send(message, cancellationToken);
 6118            switch (message.Response.Status)
 119            {
 120                case 200:
 121                    {
 122                        RoleAssignment value = default;
 6123                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6124                        value = RoleAssignment.DeserializeRoleAssignment(document.RootElement);
 6125                        return Response.FromValue(value, message.Response);
 126                    }
 127                default:
 0128                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 129            }
 6130        }
 131
 132        internal HttpMessage CreateCreateRequest(string vaultBaseUrl, string scope, string roleAssignmentName, RoleAssig
 133        {
 26134            var message = _pipeline.CreateMessage();
 26135            var request = message.Request;
 26136            request.Method = RequestMethod.Put;
 26137            var uri = new RawRequestUriBuilder();
 26138            uri.AppendRaw(vaultBaseUrl, false);
 26139            uri.AppendPath("/", false);
 26140            uri.AppendPath(scope, false);
 26141            uri.AppendPath("/providers/Microsoft.Authorization/roleAssignments/", false);
 26142            uri.AppendPath(roleAssignmentName, true);
 26143            uri.AppendQuery("api-version", apiVersion, true);
 26144            request.Uri = uri;
 26145            request.Headers.Add("Content-Type", "application/json");
 26146            var content = new Utf8JsonRequestContent();
 26147            content.JsonWriter.WriteObjectValue(parameters);
 26148            request.Content = content;
 26149            return message;
 150        }
 151
 152        /// <summary> Creates a role assignment. </summary>
 153        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 154        /// <param name="scope"> The scope of the role assignment to create. </param>
 155        /// <param name="roleAssignmentName"> The name of the role assignment to create. It can be any valid GUID. </par
 156        /// <param name="parameters"> Parameters for the role assignment. </param>
 157        /// <param name="cancellationToken"> The cancellation token to use. </param>
 158        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/>, <paramref name="scope"/>, <paramre
 159        public async Task<Response<RoleAssignment>> CreateAsync(string vaultBaseUrl, string scope, string roleAssignment
 160        {
 12161            if (vaultBaseUrl == null)
 162            {
 0163                throw new ArgumentNullException(nameof(vaultBaseUrl));
 164            }
 12165            if (scope == null)
 166            {
 0167                throw new ArgumentNullException(nameof(scope));
 168            }
 12169            if (roleAssignmentName == null)
 170            {
 0171                throw new ArgumentNullException(nameof(roleAssignmentName));
 172            }
 12173            if (parameters == null)
 174            {
 0175                throw new ArgumentNullException(nameof(parameters));
 176            }
 177
 12178            using var message = CreateCreateRequest(vaultBaseUrl, scope, roleAssignmentName, parameters);
 12179            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 12180            switch (message.Response.Status)
 181            {
 182                case 201:
 183                    {
 184                        RoleAssignment value = default;
 12185                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 12186                        value = RoleAssignment.DeserializeRoleAssignment(document.RootElement);
 12187                        return Response.FromValue(value, message.Response);
 188                    }
 189                default:
 0190                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 191            }
 12192        }
 193
 194        /// <summary> Creates a role assignment. </summary>
 195        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 196        /// <param name="scope"> The scope of the role assignment to create. </param>
 197        /// <param name="roleAssignmentName"> The name of the role assignment to create. It can be any valid GUID. </par
 198        /// <param name="parameters"> Parameters for the role assignment. </param>
 199        /// <param name="cancellationToken"> The cancellation token to use. </param>
 200        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/>, <paramref name="scope"/>, <paramre
 201        public Response<RoleAssignment> Create(string vaultBaseUrl, string scope, string roleAssignmentName, RoleAssignm
 202        {
 14203            if (vaultBaseUrl == null)
 204            {
 0205                throw new ArgumentNullException(nameof(vaultBaseUrl));
 206            }
 14207            if (scope == null)
 208            {
 0209                throw new ArgumentNullException(nameof(scope));
 210            }
 14211            if (roleAssignmentName == null)
 212            {
 0213                throw new ArgumentNullException(nameof(roleAssignmentName));
 214            }
 14215            if (parameters == null)
 216            {
 0217                throw new ArgumentNullException(nameof(parameters));
 218            }
 219
 14220            using var message = CreateCreateRequest(vaultBaseUrl, scope, roleAssignmentName, parameters);
 14221            _pipeline.Send(message, cancellationToken);
 14222            switch (message.Response.Status)
 223            {
 224                case 201:
 225                    {
 226                        RoleAssignment value = default;
 14227                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 14228                        value = RoleAssignment.DeserializeRoleAssignment(document.RootElement);
 14229                        return Response.FromValue(value, message.Response);
 230                    }
 231                default:
 0232                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 233            }
 14234        }
 235
 236        internal HttpMessage CreateGetRequest(string vaultBaseUrl, string scope, string roleAssignmentName)
 237        {
 12238            var message = _pipeline.CreateMessage();
 12239            var request = message.Request;
 12240            request.Method = RequestMethod.Get;
 12241            var uri = new RawRequestUriBuilder();
 12242            uri.AppendRaw(vaultBaseUrl, false);
 12243            uri.AppendPath("/", false);
 12244            uri.AppendPath(scope, false);
 12245            uri.AppendPath("/providers/Microsoft.Authorization/roleAssignments/", false);
 12246            uri.AppendPath(roleAssignmentName, true);
 12247            uri.AppendQuery("api-version", apiVersion, true);
 12248            request.Uri = uri;
 12249            return message;
 250        }
 251
 252        /// <summary> Get the specified role assignment. </summary>
 253        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 254        /// <param name="scope"> The scope of the role assignment. </param>
 255        /// <param name="roleAssignmentName"> The name of the role assignment to get. </param>
 256        /// <param name="cancellationToken"> The cancellation token to use. </param>
 257        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/>, <paramref name="scope"/>, or <para
 258        public async Task<Response<RoleAssignment>> GetAsync(string vaultBaseUrl, string scope, string roleAssignmentNam
 259        {
 4260            if (vaultBaseUrl == null)
 261            {
 0262                throw new ArgumentNullException(nameof(vaultBaseUrl));
 263            }
 4264            if (scope == null)
 265            {
 0266                throw new ArgumentNullException(nameof(scope));
 267            }
 4268            if (roleAssignmentName == null)
 269            {
 0270                throw new ArgumentNullException(nameof(roleAssignmentName));
 271            }
 272
 4273            using var message = CreateGetRequest(vaultBaseUrl, scope, roleAssignmentName);
 4274            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4275            switch (message.Response.Status)
 276            {
 277                case 200:
 278                    {
 279                        RoleAssignment value = default;
 4280                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4281                        value = RoleAssignment.DeserializeRoleAssignment(document.RootElement);
 4282                        return Response.FromValue(value, message.Response);
 283                    }
 284                default:
 0285                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 286            }
 4287        }
 288
 289        /// <summary> Get the specified role assignment. </summary>
 290        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 291        /// <param name="scope"> The scope of the role assignment. </param>
 292        /// <param name="roleAssignmentName"> The name of the role assignment to get. </param>
 293        /// <param name="cancellationToken"> The cancellation token to use. </param>
 294        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/>, <paramref name="scope"/>, or <para
 295        public Response<RoleAssignment> Get(string vaultBaseUrl, string scope, string roleAssignmentName, CancellationTo
 296        {
 8297            if (vaultBaseUrl == null)
 298            {
 0299                throw new ArgumentNullException(nameof(vaultBaseUrl));
 300            }
 8301            if (scope == null)
 302            {
 0303                throw new ArgumentNullException(nameof(scope));
 304            }
 8305            if (roleAssignmentName == null)
 306            {
 0307                throw new ArgumentNullException(nameof(roleAssignmentName));
 308            }
 309
 8310            using var message = CreateGetRequest(vaultBaseUrl, scope, roleAssignmentName);
 8311            _pipeline.Send(message, cancellationToken);
 8312            switch (message.Response.Status)
 313            {
 314                case 200:
 315                    {
 316                        RoleAssignment value = default;
 6317                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6318                        value = RoleAssignment.DeserializeRoleAssignment(document.RootElement);
 6319                        return Response.FromValue(value, message.Response);
 320                    }
 321                default:
 2322                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 323            }
 6324        }
 325
 326        internal HttpMessage CreateListForScopeRequest(string vaultBaseUrl, string scope, string filter)
 327        {
 6328            var message = _pipeline.CreateMessage();
 6329            var request = message.Request;
 6330            request.Method = RequestMethod.Get;
 6331            var uri = new RawRequestUriBuilder();
 6332            uri.AppendRaw(vaultBaseUrl, false);
 6333            uri.AppendPath("/", false);
 6334            uri.AppendPath(scope, false);
 6335            uri.AppendPath("/providers/Microsoft.Authorization/roleAssignments", false);
 6336            if (filter != null)
 337            {
 0338                uri.AppendQuery("$filter", filter, true);
 339            }
 6340            uri.AppendQuery("api-version", apiVersion, true);
 6341            request.Uri = uri;
 6342            return message;
 343        }
 344
 345        /// <summary> Gets role assignments for a scope. </summary>
 346        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 347        /// <param name="scope"> The scope of the role assignments. </param>
 348        /// <param name="filter"> The filter to apply on the operation. Use $filter=atScope() to return all role assignm
 349        /// <param name="cancellationToken"> The cancellation token to use. </param>
 350        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/> or <paramref name="scope"/> is null
 351        public async Task<Response<RoleAssignmentListResult>> ListForScopeAsync(string vaultBaseUrl, string scope, strin
 352        {
 2353            if (vaultBaseUrl == null)
 354            {
 0355                throw new ArgumentNullException(nameof(vaultBaseUrl));
 356            }
 2357            if (scope == null)
 358            {
 0359                throw new ArgumentNullException(nameof(scope));
 360            }
 361
 2362            using var message = CreateListForScopeRequest(vaultBaseUrl, scope, filter);
 2363            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2364            switch (message.Response.Status)
 365            {
 366                case 200:
 367                    {
 368                        RoleAssignmentListResult value = default;
 2369                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2370                        value = RoleAssignmentListResult.DeserializeRoleAssignmentListResult(document.RootElement);
 2371                        return Response.FromValue(value, message.Response);
 372                    }
 373                default:
 0374                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 375            }
 2376        }
 377
 378        /// <summary> Gets role assignments for a scope. </summary>
 379        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 380        /// <param name="scope"> The scope of the role assignments. </param>
 381        /// <param name="filter"> The filter to apply on the operation. Use $filter=atScope() to return all role assignm
 382        /// <param name="cancellationToken"> The cancellation token to use. </param>
 383        /// <exception cref="ArgumentNullException"> <paramref name="vaultBaseUrl"/> or <paramref name="scope"/> is null
 384        public Response<RoleAssignmentListResult> ListForScope(string vaultBaseUrl, string scope, string filter = null, 
 385        {
 4386            if (vaultBaseUrl == null)
 387            {
 0388                throw new ArgumentNullException(nameof(vaultBaseUrl));
 389            }
 4390            if (scope == null)
 391            {
 0392                throw new ArgumentNullException(nameof(scope));
 393            }
 394
 4395            using var message = CreateListForScopeRequest(vaultBaseUrl, scope, filter);
 4396            _pipeline.Send(message, cancellationToken);
 4397            switch (message.Response.Status)
 398            {
 399                case 200:
 400                    {
 401                        RoleAssignmentListResult value = default;
 4402                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4403                        value = RoleAssignmentListResult.DeserializeRoleAssignmentListResult(document.RootElement);
 4404                        return Response.FromValue(value, message.Response);
 405                    }
 406                default:
 0407                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 408            }
 4409        }
 410
 411        internal HttpMessage CreateListForScopeNextPageRequest(string nextLink, string vaultBaseUrl, string scope, strin
 412        {
 0413            var message = _pipeline.CreateMessage();
 0414            var request = message.Request;
 0415            request.Method = RequestMethod.Get;
 0416            var uri = new RawRequestUriBuilder();
 0417            uri.AppendRaw(vaultBaseUrl, false);
 0418            uri.AppendRawNextLink(nextLink, false);
 0419            request.Uri = uri;
 0420            return message;
 421        }
 422
 423        /// <summary> Gets role assignments for a scope. </summary>
 424        /// <param name="nextLink"> The URL to the next page of results. </param>
 425        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 426        /// <param name="scope"> The scope of the role assignments. </param>
 427        /// <param name="filter"> The filter to apply on the operation. Use $filter=atScope() to return all role assignm
 428        /// <param name="cancellationToken"> The cancellation token to use. </param>
 429        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/>, <paramref name="vaultBaseUrl"/>, or <p
 430        public async Task<Response<RoleAssignmentListResult>> ListForScopeNextPageAsync(string nextLink, string vaultBas
 431        {
 0432            if (nextLink == null)
 433            {
 0434                throw new ArgumentNullException(nameof(nextLink));
 435            }
 0436            if (vaultBaseUrl == null)
 437            {
 0438                throw new ArgumentNullException(nameof(vaultBaseUrl));
 439            }
 0440            if (scope == null)
 441            {
 0442                throw new ArgumentNullException(nameof(scope));
 443            }
 444
 0445            using var message = CreateListForScopeNextPageRequest(nextLink, vaultBaseUrl, scope, filter);
 0446            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0447            switch (message.Response.Status)
 448            {
 449                case 200:
 450                    {
 451                        RoleAssignmentListResult value = default;
 0452                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0453                        value = RoleAssignmentListResult.DeserializeRoleAssignmentListResult(document.RootElement);
 0454                        return Response.FromValue(value, message.Response);
 455                    }
 456                default:
 0457                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 458            }
 0459        }
 460
 461        /// <summary> Gets role assignments for a scope. </summary>
 462        /// <param name="nextLink"> The URL to the next page of results. </param>
 463        /// <param name="vaultBaseUrl"> The vault name, for example https://myvault.vault.azure.net. </param>
 464        /// <param name="scope"> The scope of the role assignments. </param>
 465        /// <param name="filter"> The filter to apply on the operation. Use $filter=atScope() to return all role assignm
 466        /// <param name="cancellationToken"> The cancellation token to use. </param>
 467        /// <exception cref="ArgumentNullException"> <paramref name="nextLink"/>, <paramref name="vaultBaseUrl"/>, or <p
 468        public Response<RoleAssignmentListResult> ListForScopeNextPage(string nextLink, string vaultBaseUrl, string scop
 469        {
 0470            if (nextLink == null)
 471            {
 0472                throw new ArgumentNullException(nameof(nextLink));
 473            }
 0474            if (vaultBaseUrl == null)
 475            {
 0476                throw new ArgumentNullException(nameof(vaultBaseUrl));
 477            }
 0478            if (scope == null)
 479            {
 0480                throw new ArgumentNullException(nameof(scope));
 481            }
 482
 0483            using var message = CreateListForScopeNextPageRequest(nextLink, vaultBaseUrl, scope, filter);
 0484            _pipeline.Send(message, cancellationToken);
 0485            switch (message.Response.Status)
 486            {
 487                case 200:
 488                    {
 489                        RoleAssignmentListResult value = default;
 0490                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0491                        value = RoleAssignmentListResult.DeserializeRoleAssignmentListResult(document.RootElement);
 0492                        return Response.FromValue(value, message.Response);
 493                    }
 494                default:
 0495                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 496            }
 0497        }
 498    }
 499}