Class: OCI::DataSafe::Models::SecurityAssessmentStatistics

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/security_assessment_statistics.rb

Overview

Statistics showing the number of findings for each category grouped by risk levels for all the targets in the specified security assessment.

The categories include Auditing, Authorization Control, Data Encryption, Database Configuration, Fine-Grained Access Control, Privileges and Roles, and User Accounts. The risk levels include High Risk, Medium Risk, Low Risk, Advisory, Evaluate, and Pass.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SecurityAssessmentStatistics

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



81
82
83
84
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
115
116
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 81

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

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

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

  self.high_risk = attributes[:'highRisk'] if attributes[:'highRisk']

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

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

  self.medium_risk = attributes[:'mediumRisk'] if attributes[:'mediumRisk']

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

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

  self.low_risk = attributes[:'lowRisk'] if attributes[:'lowRisk']

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

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

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

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

  self.pass = attributes[:'pass'] if attributes[:'pass']
end

Instance Attribute Details

#advisoryOCI::DataSafe::Models::SectionStatistics



30
31
32
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 30

def advisory
  @advisory
end

#evaluateOCI::DataSafe::Models::SectionStatistics



33
34
35
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 33

def evaluate
  @evaluate
end

#high_riskOCI::DataSafe::Models::SectionStatistics



21
22
23
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 21

def high_risk
  @high_risk
end

#low_riskOCI::DataSafe::Models::SectionStatistics



27
28
29
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 27

def low_risk
  @low_risk
end

#medium_riskOCI::DataSafe::Models::SectionStatistics



24
25
26
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 24

def medium_risk
  @medium_risk
end

#passOCI::DataSafe::Models::SectionStatistics



36
37
38
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 36

def pass
  @pass
end

#targets_countInteger

The total number of targets in this security assessment.

Returns:

  • (Integer)


18
19
20
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 18

def targets_count
  @targets_count
end

Class Method Details

.attribute_mapObject

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



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 39

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'targets_count': :'targetsCount',
    'high_risk': :'highRisk',
    'medium_risk': :'mediumRisk',
    'low_risk': :'lowRisk',
    'advisory': :'advisory',
    'evaluate': :'evaluate',
    'pass': :'pass'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 54

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'targets_count': :'Integer',
    'high_risk': :'OCI::DataSafe::Models::SectionStatistics',
    'medium_risk': :'OCI::DataSafe::Models::SectionStatistics',
    'low_risk': :'OCI::DataSafe::Models::SectionStatistics',
    'advisory': :'OCI::DataSafe::Models::SectionStatistics',
    'evaluate': :'OCI::DataSafe::Models::SectionStatistics',
    'pass': :'OCI::DataSafe::Models::SectionStatistics'
    # 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



125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 125

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    targets_count == other.targets_count &&
    high_risk == other.high_risk &&
    medium_risk == other.medium_risk &&
    low_risk == other.low_risk &&
    advisory == other.advisory &&
    evaluate == other.evaluate &&
    pass == other.pass
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



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 161

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


141
142
143
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 141

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



150
151
152
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 150

def hash
  [targets_count, high_risk, medium_risk, low_risk, advisory, evaluate, pass].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



194
195
196
197
198
199
200
201
202
203
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 194

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



188
189
190
# File 'lib/oci/data_safe/models/security_assessment_statistics.rb', line 188

def to_s
  to_hash.to_s
end