Exemple #1
0
        /// <summary>
        /// Gets operation result for DELETE and POST 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> GetPostOrDeleteOperationResultAsync(
            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.GetPostOrDeleteOperationResultAsync(
                newResponse, customHeaders, cancellationToken);

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