Class: OCI::CloudGuard::Models::ResourceProfileSummary
- Inherits:
-
Object
- Object
- OCI::CloudGuard::Models::ResourceProfileSummary
- Defined in:
- lib/oci/cloud_guard/models/resource_profile_summary.rb
Overview
Summary information for a resource profile.
Instance Attribute Summary collapse
-
#display_name ⇒ String
[Required] Display name for the resource profile.
-
#id ⇒ String
[Required] Unique identifier for the resource profile.
-
#problems_count ⇒ Integer
Number of problems associated with this resource profile.
-
#resource_id ⇒ String
[Required] Unique identifier for the resource associated with the resource profile.
-
#risk_score ⇒ Float
[Required] Risk score for the resource profile.
-
#sightings_count ⇒ Integer
Number of sightings associated with the resource profile.
-
#tactics ⇒ Array<OCI::CloudGuard::Models::TacticSummary>
[Required] List of tactic summaries associated with the resource profile.
-
#time_first_detected ⇒ DateTime
[Required] The date and time the resource profile was first detected.
-
#time_last_detected ⇒ DateTime
[Required] The date and time the resource profile was last detected.
-
#type ⇒ String
[Required] Resource type for the resource profile.
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 = {}) ⇒ ResourceProfileSummary
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 = {}) ⇒ ResourceProfileSummary
Initializes the object
103 104 105 106 107 108 109 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 155 156 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 103 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.sightings_count = attributes[:'sightingsCount'] if attributes[:'sightingsCount'] raise 'You cannot provide both :sightingsCount and :sightings_count' if attributes.key?(:'sightingsCount') && attributes.key?(:'sightings_count') self.sightings_count = attributes[:'sightings_count'] if attributes[:'sightings_count'] self.id = attributes[:'id'] if attributes[:'id'] self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId'] raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id'] 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.type = attributes[:'type'] if attributes[:'type'] self.risk_score = attributes[:'riskScore'] if attributes[:'riskScore'] raise 'You cannot provide both :riskScore and :risk_score' if attributes.key?(:'riskScore') && attributes.key?(:'risk_score') self.risk_score = attributes[:'risk_score'] if attributes[:'risk_score'] self.tactics = attributes[:'tactics'] if attributes[:'tactics'] self.time_first_detected = attributes[:'timeFirstDetected'] if attributes[:'timeFirstDetected'] raise 'You cannot provide both :timeFirstDetected and :time_first_detected' if attributes.key?(:'timeFirstDetected') && attributes.key?(:'time_first_detected') self.time_first_detected = attributes[:'time_first_detected'] if attributes[:'time_first_detected'] self.time_last_detected = attributes[:'timeLastDetected'] if attributes[:'timeLastDetected'] raise 'You cannot provide both :timeLastDetected and :time_last_detected' if attributes.key?(:'timeLastDetected') && attributes.key?(:'time_last_detected') self.time_last_detected = attributes[:'time_last_detected'] if attributes[:'time_last_detected'] self.problems_count = attributes[:'problemsCount'] if attributes[:'problemsCount'] raise 'You cannot provide both :problemsCount and :problems_count' if attributes.key?(:'problemsCount') && attributes.key?(:'problems_count') self.problems_count = attributes[:'problems_count'] if attributes[:'problems_count'] end |
Instance Attribute Details
#display_name ⇒ String
[Required] Display name for the resource profile
25 26 27 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 25 def display_name @display_name end |
#id ⇒ String
[Required] Unique identifier for the resource profile
17 18 19 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 17 def id @id end |
#problems_count ⇒ Integer
Number of problems associated with this resource profile
49 50 51 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 49 def problems_count @problems_count end |
#resource_id ⇒ String
[Required] Unique identifier for the resource associated with the resource profile
21 22 23 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 21 def resource_id @resource_id end |
#risk_score ⇒ Float
[Required] Risk score for the resource profile
33 34 35 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 33 def risk_score @risk_score end |
#sightings_count ⇒ Integer
Number of sightings associated with the resource profile
13 14 15 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 13 def sightings_count @sightings_count end |
#tactics ⇒ Array<OCI::CloudGuard::Models::TacticSummary>
[Required] List of tactic summaries associated with the resource profile
37 38 39 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 37 def tactics @tactics end |
#time_first_detected ⇒ DateTime
[Required] The date and time the resource profile was first detected. Format defined by RFC3339.
41 42 43 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 41 def time_first_detected @time_first_detected end |
#time_last_detected ⇒ DateTime
[Required] The date and time the resource profile was last detected. Format defined by RFC3339.
45 46 47 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 45 def time_last_detected @time_last_detected end |
#type ⇒ String
[Required] Resource type for the resource profile
29 30 31 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 29 def type @type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 52 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'sightings_count': :'sightingsCount', 'id': :'id', 'resource_id': :'resourceId', 'display_name': :'displayName', 'type': :'type', 'risk_score': :'riskScore', 'tactics': :'tactics', 'time_first_detected': :'timeFirstDetected', 'time_last_detected': :'timeLastDetected', 'problems_count': :'problemsCount' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 70 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'sightings_count': :'Integer', 'id': :'String', 'resource_id': :'String', 'display_name': :'String', 'type': :'String', 'risk_score': :'Float', 'tactics': :'Array<OCI::CloudGuard::Models::TacticSummary>', 'time_first_detected': :'DateTime', 'time_last_detected': :'DateTime', 'problems_count': :'Integer' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 165 def ==(other) return true if equal?(other) self.class == other.class && sightings_count == other.sightings_count && id == other.id && resource_id == other.resource_id && display_name == other.display_name && type == other.type && risk_score == other.risk_score && tactics == other.tactics && time_first_detected == other.time_first_detected && time_last_detected == other.time_last_detected && problems_count == other.problems_count end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 204 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
184 185 186 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 184 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
193 194 195 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 193 def hash [sightings_count, id, resource_id, display_name, type, risk_score, tactics, time_first_detected, time_last_detected, problems_count].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
237 238 239 240 241 242 243 244 245 246 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 237 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
231 232 233 |
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 231 def to_s to_hash.to_s end |