Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
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 @@ -107,7 +107,7 @@ def create_or_update_async(resource_group_name, action_group_name, action_group,
response_content = http_response.body
unless status_code == 200 || status_code == 201
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
Expand Down Expand Up @@ -206,9 +206,9 @@ 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)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
Expand Down Expand Up @@ -298,7 +298,7 @@ def delete_async(resource_group_name, action_group_name, custom_headers = nil)
response_content = http_response.body
unless status_code == 200 || status_code == 204
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
Expand Down Expand Up @@ -371,7 +371,7 @@ def list_by_subscription_id_async(custom_headers = nil)
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
Expand Down Expand Up @@ -458,7 +458,7 @@ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
Expand Down Expand Up @@ -562,9 +562,9 @@ 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 || status_code == 409
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end

result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
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 @@ -16,7 +16,8 @@ class ActionGroupList
# @return [Array<ActionGroupResource>] The list of action groups.
attr_accessor :value

# @return [String] Provides the link to retrive the next set of elements.
# @return [String] Provides the link to retrieve the next set of
# elements.
attr_accessor :next_link


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ActionGroupResource < MsRestAzure::Resource
attr_accessor :group_short_name

# @return [Boolean] Indicates whether this action group is enabled. If an
# action group is not enabled, then none of its receviers will receive
# action group is not enabled, then none of its receivers will receive
# communications. Default value: true .
attr_accessor :enabled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class ActivityLogAlertList
# alerts.
attr_accessor :value

# @return [String] Provides the link to retrive the next set of elements.
# @return [String] Provides the link to retrieve the next set of
# elements.
attr_accessor :next_link


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ActivityLogAlertResource < MsRestAzure::Resource
# be activated. Default value: true .
attr_accessor :enabled

# @return [ActivityLogAlertAllOfCondition] The conditon that will cause
# @return [ActivityLogAlertAllOfCondition] The condition that will cause
# this alert to activate.
attr_accessor :condition

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,7 +23,8 @@ class ServiceDiagnosticSettingsResource < MsRestAzure::Resource
# ID}/authorizationrules/{key name}'.
attr_accessor :service_bus_rule_id

# @return [String] The resource Id for the event hub authorization rule.
# @return [String] The resource Id for the event hub namespace
# authorization rule.
attr_accessor :event_hub_authorization_rule_id

# @return [Array<MetricSettings>] the list of metric settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class ServiceDiagnosticSettingsResourcePatch
# ID}/authorizationrules/{key name}'.
attr_accessor :service_bus_rule_id

# @return [String] The resource Id for the event hub authorization rule.
# @return [String] The resource Id for the event hub namespace
# authorization rule.
attr_accessor :event_hub_authorization_rule_id

# @return [Array<MetricSettings>] the list of metric settings.
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