Skip to content

Commit

Permalink
Remove deprecated methods from ms_rest_azure client_runtime. This cha…
Browse files Browse the repository at this point in the history
…nge is related to PR Azure#1011 where generalized method was introduced. (Azure#1236)
  • Loading branch information
vishrutshah authored Jul 12, 2016
1 parent fcbeb84 commit 693fdd8
Showing 1 changed file with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class AzureServiceClient < MsRest::ServiceClient
# @param custom_deserialization_block [Proc] custom logic for response deserialization.
#
# @return [MsRest::HttpOperationResponse] the response.
#
def get_long_running_operation_result(azure_response, custom_deserialization_block)
check_for_status_code_failure(azure_response)

Expand Down Expand Up @@ -75,29 +76,10 @@ def get_long_running_operation_result(azure_response, custom_deserialization_blo
polling_state.get_operation_response
end

# @TODO Update name of the method to get_put_or_patch_operation_result when introducing breaking change / updating major version of gem
# Retrieves the result of 'PUT' or 'PATCH' operation. Performs polling of required.
# @param azure_response [MsRestAzure::AzureOperationResponse] response from Azure service.
# @param custom_deserialization_block [Proc] custom logic for response deserialization.
#
# @return [MsRest::HttpOperationResponse] the response.
def get_put_operation_result(azure_response, custom_deserialization_block)
get_long_running_operation_result(azure_response, custom_deserialization_block)
end

#
# Retrieves the result of 'POST' or 'DELETE' operations. Performs polling of required.
# @param azure_response [MsRestAzure::AzureOperationResponse] response from Azure service.
# @param custom_deserialization_block [Proc] custom logic for response deserialization.
#
# @return [MsRest::HttpOperationResponse] the response.
def get_post_or_delete_operation_result(azure_response, custom_deserialization_block)
get_long_running_operation_result(azure_response, custom_deserialization_block)
end

#
# Verifies for unexpected polling status code
# @param azure_response [MsRestAzure::AzureOperationResponse] response from Azure service.
#
def check_for_status_code_failure(azure_response)
fail MsRest::ValidationError, 'Azure response cannot be nil' if azure_response.nil?
fail MsRest::ValidationError, 'Azure response cannot have empty response object' if azure_response.response.nil?
Expand Down Expand Up @@ -147,6 +129,7 @@ def update_state_from_get_resource_operation(request, polling_state, custom_dese
# @param request [MsRest::HttpOperationRequest] The url retrieve data from.
# @param polling_state [MsRestAzure::PollingState] polling state to update.
# @param custom_deserialization_block [Proc] custom deserialization method for parsing response.
#
def update_state_from_location_header(request, polling_state, custom_deserialization_block)
result = get_async_with_custom_deserialization(request, custom_deserialization_block)

Expand Down Expand Up @@ -175,6 +158,7 @@ def update_state_from_location_header(request, polling_state, custom_deserializa
#
# Updates polling state from Azure async operation header.
# @param polling_state [MsRestAzure::PollingState] polling state.
#
def update_state_from_azure_async_operation_header(request, polling_state)
result = get_async_with_async_operation_deserialization(request)

Expand All @@ -195,6 +179,7 @@ def update_state_from_azure_async_operation_header(request, polling_state)
# @param custom_deserialization_block [Proc] function to perform deserialization of the HTTP response.
#
# @return [MsRest::HttpOperationResponse] the response.
#
def get_async_with_custom_deserialization(request, custom_deserialization_block)
result = get_async_common(request)

Expand All @@ -214,6 +199,7 @@ def get_async_with_custom_deserialization(request, custom_deserialization_block)
# @param request [MsRest::HttpOperationRequest] the URL.
#
# @return [MsRest::HttpOperationResponse] the response.
#
def get_async_with_async_operation_deserialization(request)
result = get_async_common(request)

Expand All @@ -227,6 +213,7 @@ def get_async_with_async_operation_deserialization(request)
# @param request [MsRest::HttpOperationRequest] the URL.
#
# @return [MsRest::HttpOperationResponse] the response.
#
def get_async_common(request)
fail ValidationError, 'Request cannot be nil' if request.nil?

Expand Down

0 comments on commit 693fdd8

Please sign in to comment.