/// <summary>
 /// Gets operation result for DELETE and POST operations. (Deprecated, please use GetLongRunningOperationResultAsync)
 /// </summary>
 /// <param name="client">IAzureClient</param>
 /// <param name="response">Response from the begin operation</param>
 /// <param name="customHeaders">Headers that will be added to request</param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns>Operation response</returns>
 public static async Task <AzureOperationResponse> GetPostOrDeleteOperationResultAsync(
     this IAzureClient client,
     AzureOperationResponse response,
     Dictionary <string, List <string> > customHeaders,
     CancellationToken cancellationToken)
 {
     return(await client.GetLongRunningOperationResultAsync(response, customHeaders, cancellationToken).ConfigureAwait(false));
 }
 /// <summary>
 /// Gets operation result for PUT and PATCH operations. (Deprecated, please use GetLongRunningOperationResultAsync)
 /// </summary>
 /// <typeparam name="TBody">Type of the resource body</typeparam>
 /// <param name="client">IAzureClient</param>
 /// <param name="response">Response from the begin operation</param>
 /// <param name="customHeaders">Headers that will be added to request</param>
 /// <param name="cancellationToken">Cancellation token</param>
 /// <returns>Response with created resource</returns>
 public static async Task <AzureOperationResponse <TBody> > GetPutOrPatchOperationResultAsync <TBody>(
     this IAzureClient client,
     AzureOperationResponse <TBody> response,
     Dictionary <string, List <string> > customHeaders,
     CancellationToken cancellationToken) where TBody : class
 {
     return(await client.GetLongRunningOperationResultAsync(
                response, customHeaders, cancellationToken).ConfigureAwait(false));
 }
        /// <summary>
        /// Gets operation result for long running operations.
        /// </summary>
        /// <param name="client">IAzureClient</param>
        /// <param name="response">Response from the begin operation</param>
        /// <param name="customHeaders">Headers that will be added to request</param>
        /// <param name="cancellationToken">Cancellation token</param>
        /// <returns>Operation response</returns>
        public static async Task <AzureOperationResponse> GetLongRunningOperationResultAsync(
            this IAzureClient client,
            AzureOperationResponse response,
            Dictionary <string, List <string> > customHeaders,
            CancellationToken cancellationToken)
        {
            var newResponse = new AzureOperationResponse <object>
            {
                Request   = response.Request,
                Response  = response.Response,
                RequestId = response.RequestId
            };

            var azureOperationResponse = await client.GetLongRunningOperationResultAsync(
                newResponse, customHeaders, cancellationToken).ConfigureAwait(false);

            return(new AzureOperationResponse
            {
                Request = azureOperationResponse.Request,
                Response = azureOperationResponse.Response,
                RequestId = azureOperationResponse.RequestId
            });
        }