Class: Azure::ARM::Web::Models::RecommendationRule
- Inherits:
-
Object
- Object
- Azure::ARM::Web::Models::RecommendationRule
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_web/models/recommendation_rule.rb
Overview
Represents a recommendation rule that the recommendation engine can perform
Instance Attribute Summary collapse
-
#action_name ⇒ String
string.
-
#channels ⇒ Channels
Possible values include: ‘Notification’, ‘Api’, ‘Email’, ‘All’.
-
#description ⇒ String
Localized detailed description of the rule.
-
#display_name ⇒ String
UI friendly name of the rule.
-
#enabled ⇒ Integer
or disabled.
-
#level ⇒ NotificationLevel
this rule is.
-
#message ⇒ String
Localized name of the rule (Good for UI).
-
#name ⇒ String
Unique name of the rule.
-
#recommendation_id ⇒ String
object tied to the rule, if exists.
-
#tags ⇒ Array<String>
contains.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ RecommendationRule
Deserializes given Ruby Hash into Model object.
-
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
Instance Method Summary collapse
-
#validate ⇒ Object
Validate the object.
Instance Attribute Details
#action_name ⇒ String
string
35 36 37 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 35 def action_name @action_name end |
#channels ⇒ Channels
Possible values include: ‘Notification’, ‘Api’, ‘Email’, ‘All’
48 49 50 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 48 def channels @channels end |
#description ⇒ String
Returns Localized detailed description of the rule.
31 32 33 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 31 def description @description end |
#display_name ⇒ String
Returns UI friendly name of the rule.
20 21 22 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 20 def display_name @display_name end |
#enabled ⇒ Integer
or disabled.
39 40 41 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 39 def enabled @enabled end |
#level ⇒ NotificationLevel
this rule is. Possible values include: ‘Critical’, ‘Warning’, ‘Information’, ‘NonUrgentSuggestion’
44 45 46 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 44 def level @level end |
#message ⇒ String
Returns Localized name of the rule (Good for UI).
23 24 25 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 23 def end |
#name ⇒ String
Returns Unique name of the rule.
17 18 19 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 17 def name @name end |
#recommendation_id ⇒ String
object tied to the rule, if exists. If such an object doesn’t exist, it is set to null.
28 29 30 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 28 def recommendation_id @recommendation_id end |
#tags ⇒ Array<String>
contains.
52 53 54 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 52 def end |
Class Method Details
.deserialize_object(object) ⇒ RecommendationRule
Deserializes given Ruby Hash into Model object.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 110 def self.deserialize_object(object) return if object.nil? output_object = RecommendationRule.new deserialized_property = object['level'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = NotificationLevel.constants.any? { |e| NotificationLevel.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum NotificationLevel does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.level = deserialized_property deserialized_property = object['channels'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = Channels.constants.any? { |e| Channels.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum Channels does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.channels = deserialized_property deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['displayName'] output_object.display_name = deserialized_property deserialized_property = object['message'] output_object. = deserialized_property deserialized_property = object['recommendationId'] output_object.recommendation_id = deserialized_property deserialized_property = object['description'] output_object.description = deserialized_property deserialized_property = object['actionName'] output_object.action_name = deserialized_property deserialized_property = object['enabled'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.enabled = deserialized_property deserialized_property = object['tags'] output_object. = deserialized_property output_object end |
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 68 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.level output_object['level'] = serialized_property unless serialized_property.nil? serialized_property = object.channels output_object['channels'] = serialized_property unless serialized_property.nil? serialized_property = object.name output_object['name'] = serialized_property unless serialized_property.nil? serialized_property = object.display_name output_object['displayName'] = serialized_property unless serialized_property.nil? serialized_property = object. output_object['message'] = serialized_property unless serialized_property.nil? serialized_property = object.recommendation_id output_object['recommendationId'] = serialized_property unless serialized_property.nil? serialized_property = object.description output_object['description'] = serialized_property unless serialized_property.nil? serialized_property = object.action_name output_object['actionName'] = serialized_property unless serialized_property.nil? serialized_property = object.enabled output_object['enabled'] = serialized_property unless serialized_property.nil? serialized_property = object. output_object['tags'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validate the object. Throws ValidationError if validation fails.
57 58 59 60 61 |
# File 'lib/azure_mgmt_web/models/recommendation_rule.rb', line 57 def validate fail MsRest::ValidationError, 'property level is nil' if @level.nil? fail MsRest::ValidationError, 'property channels is nil' if @channels.nil? .each{ |e| e.validate if e.respond_to?(:validate) } unless .nil? end |