Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
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 @@ -206,7 +206,7 @@ def get_async(resource_group_name, action_group_name, custom_headers = nil)
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200 || status_code == 404
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
Expand Down Expand Up @@ -562,7 +562,7 @@ def enable_receiver_async(resource_group_name, action_group_name, enable_request
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200 || status_code == 409 || status_code == 404
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def update_async(resource_group_name, rule_name, alert_rules_resource, custom_he
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
unless status_code == 200 || status_code == 201
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
Expand All @@ -412,6 +412,16 @@ def update_async(resource_group_name, rule_name, alert_rules_resource, custom_he
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
# Deserialize Response
if status_code == 201
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::ARM::Monitor::Models::AlertRuleResource.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end

result
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class EmailReceiver
# @return [String] The email address of this receiver.
attr_accessor :email_address

# @return [ReceiverStatus] Possible values include: 'NotSpecified',
# 'Enabled', 'Disabled'
# @return [ReceiverStatus] The receiver status of the e-mail. Possible
# values include: 'NotSpecified', 'Enabled', 'Disabled'
attr_accessor :status


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class SmsReceiver
# @return [String] The phone number of the SMS receiver.
attr_accessor :phone_number

# @return [ReceiverStatus] Possible values include: 'NotSpecified',
# 'Enabled', 'Disabled'
# @return [ReceiverStatus] The status of the receiver. Possible values
# include: 'NotSpecified', 'Enabled', 'Disabled'
attr_accessor :status


Expand Down