Skip to content

Commit

Permalink
Merge pull request Azure#917 from AzCiS/master
Browse files Browse the repository at this point in the history
A fix for the issue Azure/autorest#776
  • Loading branch information
tbombach committed Apr 12, 2016
2 parents 0e2d13a + 965e722 commit 56a20fa
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,38 @@ await UpdateStateFromGetResourceOperation(client, pollingState, getOperationUrl,
return pollingState.AzureOperationResponse;
}

/// <summary>
/// Gets operation result for PUT and PATCH 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> GetPutOrPatchOperationResultAsync(
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.GetPutOrPatchOperationResultAsync(
newResponse, customHeaders, cancellationToken);

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

/// <summary>
/// Gets operation result for DELETE and POST operations.
/// </summary>
Expand Down

0 comments on commit 56a20fa

Please sign in to comment.