Class: OCI::DataSafe::Models::AlertPolicyRule
- Inherits:
-
Object
- Object
- OCI::DataSafe::Models::AlertPolicyRule
- Defined in:
- lib/oci/data_safe/models/alert_policy_rule.rb
Overview
A rule associated with a alert policy.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#description ⇒ String
Describes the alert policy rule.
-
#display_name ⇒ String
The display name of the alert policy rule.
-
#expression ⇒ String
[Required] The conditional expression of the alert policy rule which evaluates to boolean value.
-
#key ⇒ String
[Required] The unique key of the alert policy rule.
-
#lifecycle_state ⇒ String
The current state of the alert policy rule.
-
#time_created ⇒ DateTime
Creation date and time of the alert policy rule, in the format defined by RFC3339.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AlertPolicyRule
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ AlertPolicyRule
Initializes the object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 85 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.key = attributes[:'key'] if attributes[:'key'] self.description = attributes[:'description'] if attributes[:'description'] self.expression = attributes[:'expression'] if attributes[:'expression'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self.display_name = attributes[:'displayName'] if attributes[:'displayName'] raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name') self.display_name = attributes[:'display_name'] if attributes[:'display_name'] self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] end |
Instance Attribute Details
#description ⇒ String
Describes the alert policy rule.
27 28 29 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 27 def description @description end |
#display_name ⇒ String
The display name of the alert policy rule.
39 40 41 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 39 def display_name @display_name end |
#expression ⇒ String
[Required] The conditional expression of the alert policy rule which evaluates to boolean value.
31 32 33 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 31 def expression @expression end |
#key ⇒ String
[Required] The unique key of the alert policy rule.
23 24 25 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 23 def key @key end |
#lifecycle_state ⇒ String
The current state of the alert policy rule.
35 36 37 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 35 def lifecycle_state @lifecycle_state end |
#time_created ⇒ DateTime
Creation date and time of the alert policy rule, in the format defined by RFC3339.
43 44 45 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 43 def time_created @time_created end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 46 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'key': :'key', 'description': :'description', 'expression': :'expression', 'lifecycle_state': :'lifecycleState', 'display_name': :'displayName', 'time_created': :'timeCreated' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 60 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'key': :'String', 'description': :'String', 'expression': :'String', 'lifecycle_state': :'String', 'display_name': :'String', 'time_created': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 136 def ==(other) return true if equal?(other) self.class == other.class && key == other.key && description == other.description && expression == other.expression && lifecycle_state == other.lifecycle_state && display_name == other.display_name && time_created == other.time_created end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 171 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
151 152 153 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 151 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
160 161 162 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 160 def hash [key, description, expression, lifecycle_state, display_name, time_created].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
204 205 206 207 208 209 210 211 212 213 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 204 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
198 199 200 |
# File 'lib/oci/data_safe/models/alert_policy_rule.rb', line 198 def to_s to_hash.to_s end |