Class: OCI::Monitoring::Models::AlarmSuppressionCompartmentTarget
- Inherits:
-
AlarmSuppressionTarget
- Object
- AlarmSuppressionTarget
- OCI::Monitoring::Models::AlarmSuppressionCompartmentTarget
- Defined in:
- lib/oci/monitoring/models/alarm_suppression_compartment_target.rb
Overview
The compartment target of the alarm suppression.
Constant Summary
Constants inherited from AlarmSuppressionTarget
OCI::Monitoring::Models::AlarmSuppressionTarget::TARGET_TYPE_ENUM
Instance Attribute Summary collapse
-
#compartment_id ⇒ String
[Required] The OCID of the compartment or tenancy that is the target of the alarm suppression.
-
#compartment_id_in_subtree ⇒ BOOLEAN
When true, the alarm suppression targets all alarms under all compartments and subcompartments of the tenancy specified.
Attributes inherited from AlarmSuppressionTarget
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 = {}) ⇒ AlarmSuppressionCompartmentTarget
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.
Methods inherited from AlarmSuppressionTarget
Constructor Details
#initialize(attributes = {}) ⇒ AlarmSuppressionCompartmentTarget
Initializes the object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 57 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['targetType'] = 'COMPARTMENT' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.compartment_id_in_subtree = attributes[:'compartmentIdInSubtree'] unless attributes[:'compartmentIdInSubtree'].nil? raise 'You cannot provide both :compartmentIdInSubtree and :compartment_id_in_subtree' if attributes.key?(:'compartmentIdInSubtree') && attributes.key?(:'compartment_id_in_subtree') self.compartment_id_in_subtree = attributes[:'compartment_id_in_subtree'] unless attributes[:'compartment_id_in_subtree'].nil? end |
Instance Attribute Details
#compartment_id ⇒ String
[Required] The OCID of the compartment or tenancy that is the target of the alarm suppression. Example: ocid1.compartment.oc1..exampleuniqueID
17 18 19 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 17 def compartment_id @compartment_id end |
#compartment_id_in_subtree ⇒ BOOLEAN
When true, the alarm suppression targets all alarms under all compartments and subcompartments of the tenancy specified. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). When false, the alarm suppression targets only the alarms under the specified compartment.
25 26 27 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 25 def compartment_id_in_subtree @compartment_id_in_subtree end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
28 29 30 31 32 33 34 35 36 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 28 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'target_type': :'targetType', 'compartment_id': :'compartmentId', 'compartment_id_in_subtree': :'compartmentIdInSubtree' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
39 40 41 42 43 44 45 46 47 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 39 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'target_type': :'String', 'compartment_id': :'String', 'compartment_id_in_subtree': :'BOOLEAN' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
87 88 89 90 91 92 93 94 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 87 def ==(other) return true if equal?(other) self.class == other.class && target_type == other.target_type && compartment_id == other.compartment_id && compartment_id_in_subtree == other.compartment_id_in_subtree end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 119 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
99 100 101 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 99 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
108 109 110 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 108 def hash [target_type, compartment_id, compartment_id_in_subtree].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
152 153 154 155 156 157 158 159 160 161 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 152 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
146 147 148 |
# File 'lib/oci/monitoring/models/alarm_suppression_compartment_target.rb', line 146 def to_s to_hash.to_s end |