Class: OCI::CloudGuard::Models::ResourceProfileSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_guard/models/resource_profile_summary.rb

Overview

Summary information for a resource profile.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ResourceProfileSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 117

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.time_first_occurred = attributes[:'timeFirstOccurred'] if attributes[:'timeFirstOccurred']

  raise 'You cannot provide both :timeFirstOccurred and :time_first_occurred' if attributes.key?(:'timeFirstOccurred') && attributes.key?(:'time_first_occurred')

  self.time_first_occurred = attributes[:'time_first_occurred'] if attributes[:'time_first_occurred']

  self.time_last_occurred = attributes[:'timeLastOccurred'] if attributes[:'timeLastOccurred']

  raise 'You cannot provide both :timeLastOccurred and :time_last_occurred' if attributes.key?(:'timeLastOccurred') && attributes.key?(:'time_last_occurred')

  self.time_last_occurred = attributes[:'time_last_occurred'] if attributes[:'time_last_occurred']

  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_nameString

[Required] Display name for the resource profile

Returns:

  • (String)


25
26
27
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 25

def display_name
  @display_name
end

#idString

[Required] Unique identifier for the resource profile

Returns:

  • (String)


17
18
19
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 17

def id
  @id
end

#problems_countInteger

Number of problems associated with this resource profile

Returns:

  • (Integer)


57
58
59
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 57

def problems_count
  @problems_count
end

#resource_idString

[Required] Unique identifier for the resource associated with the resource profile

Returns:

  • (String)


21
22
23
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 21

def resource_id
  @resource_id
end

#risk_scoreFloat

[Required] Risk score for the resource profile

Returns:

  • (Float)


33
34
35
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 33

def risk_score
  @risk_score
end

#sightings_countInteger

Number of sightings associated with the resource profile

Returns:

  • (Integer)


13
14
15
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 13

def sightings_count
  @sightings_count
end

#tacticsArray<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_detectedDateTime

[Required] Time the activities were first detected. Format defined by RFC3339.

Returns:

  • (DateTime)


41
42
43
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 41

def time_first_detected
  @time_first_detected
end

#time_first_occurredDateTime

Time the activities were first performed. Format defined by RFC3339.

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 49

def time_first_occurred
  @time_first_occurred
end

#time_last_detectedDateTime

[Required] Time the activities were last detected. Format defined by RFC3339.

Returns:

  • (DateTime)


45
46
47
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 45

def time_last_detected
  @time_last_detected
end

#time_last_occurredDateTime

Time the activities were last performed. Format defined by RFC3339.

Returns:

  • (DateTime)


53
54
55
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 53

def time_last_occurred
  @time_last_occurred
end

#typeString

[Required] Resource type for the resource profile

Returns:

  • (String)


29
30
31
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 29

def type
  @type
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 60

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',
    'time_first_occurred': :'timeFirstOccurred',
    'time_last_occurred': :'timeLastOccurred',
    'problems_count': :'problemsCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 80

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',
    'time_first_occurred': :'DateTime',
    'time_last_occurred': :'DateTime',
    'problems_count': :'Integer'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 191

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 &&
    time_first_occurred == other.time_first_occurred &&
    time_last_occurred == other.time_last_occurred &&
    problems_count == other.problems_count
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 232

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


212
213
214
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 212

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



221
222
223
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 221

def hash
  [sightings_count, id, resource_id, display_name, type, risk_score, tactics, time_first_detected, time_last_detected, time_first_occurred, time_last_occurred, problems_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



265
266
267
268
269
270
271
272
273
274
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 265

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



259
260
261
# File 'lib/oci/cloud_guard/models/resource_profile_summary.rb', line 259

def to_s
  to_hash.to_s
end