Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated methods from ms_rest_azure client_runtime #1236

Merged
merged 1 commit into from
Jul 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -143,6 +125,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 @@ -171,6 +154,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 @@ -191,6 +175,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 @@ -210,6 +195,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 @@ -223,6 +209,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