Class: OCI::DataSafe::Models::SectionStatistics

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

Overview

Statistics showing the number of findings with a particular risk level for each category.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SectionStatistics

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
# File 'lib/oci/data_safe/models/section_statistics.rb', line 89

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

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

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

  self.authorization_control_findings_count = attributes[:'authorizationControlFindingsCount'] if attributes[:'authorizationControlFindingsCount']

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

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

  self.data_encryption_findings_count = attributes[:'dataEncryptionFindingsCount'] if attributes[:'dataEncryptionFindingsCount']

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

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

  self.db_configuration_findings_count = attributes[:'dbConfigurationFindingsCount'] if attributes[:'dbConfigurationFindingsCount']

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

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

  self.fine_grained_access_control_findings_count = attributes[:'fineGrainedAccessControlFindingsCount'] if attributes[:'fineGrainedAccessControlFindingsCount']

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

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

  self.privileges_and_roles_findings_count = attributes[:'privilegesAndRolesFindingsCount'] if attributes[:'privilegesAndRolesFindingsCount']

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

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

  self.user_accounts_findings_count = attributes[:'userAccountsFindingsCount'] if attributes[:'userAccountsFindingsCount']

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

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

Instance Attribute Details

#auditing_findings_countInteger

The number of findings in the Auditing category.

Returns:

  • (Integer)


17
18
19
# File 'lib/oci/data_safe/models/section_statistics.rb', line 17

def auditing_findings_count
  @auditing_findings_count
end

#authorization_control_findings_countInteger

The number of findings in the Authorization Control category.

Returns:

  • (Integer)


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

def authorization_control_findings_count
  @authorization_control_findings_count
end

#data_encryption_findings_countInteger

The number of findings in the Data Encryption category.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/data_safe/models/section_statistics.rb', line 25

def data_encryption_findings_count
  @data_encryption_findings_count
end

#db_configuration_findings_countInteger

The number of findings in the Database Configuration category.

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/data_safe/models/section_statistics.rb', line 29

def db_configuration_findings_count
  @db_configuration_findings_count
end

#fine_grained_access_control_findings_countInteger

The number of findings in the Fine-Grained Access Control category.

Returns:

  • (Integer)


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

def fine_grained_access_control_findings_count
  @fine_grained_access_control_findings_count
end

#privileges_and_roles_findings_countInteger

The number of findings in the Privileges and Roles category.

Returns:

  • (Integer)


37
38
39
# File 'lib/oci/data_safe/models/section_statistics.rb', line 37

def privileges_and_roles_findings_count
  @privileges_and_roles_findings_count
end

#targets_countInteger

The number of targets that contributed to the counts at this risk level.

Returns:

  • (Integer)


13
14
15
# File 'lib/oci/data_safe/models/section_statistics.rb', line 13

def targets_count
  @targets_count
end

#user_accounts_findings_countInteger

The number of findings in the User Accounts category.

Returns:

  • (Integer)


41
42
43
# File 'lib/oci/data_safe/models/section_statistics.rb', line 41

def user_accounts_findings_count
  @user_accounts_findings_count
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/data_safe/models/section_statistics.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'targets_count': :'targetsCount',
    'auditing_findings_count': :'auditingFindingsCount',
    'authorization_control_findings_count': :'authorizationControlFindingsCount',
    'data_encryption_findings_count': :'dataEncryptionFindingsCount',
    'db_configuration_findings_count': :'dbConfigurationFindingsCount',
    'fine_grained_access_control_findings_count': :'fineGrainedAccessControlFindingsCount',
    'privileges_and_roles_findings_count': :'privilegesAndRolesFindingsCount',
    'user_accounts_findings_count': :'userAccountsFindingsCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/data_safe/models/section_statistics.rb', line 60

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'targets_count': :'Integer',
    'auditing_findings_count': :'Integer',
    'authorization_control_findings_count': :'Integer',
    'data_encryption_findings_count': :'Integer',
    'db_configuration_findings_count': :'Integer',
    'fine_grained_access_control_findings_count': :'Integer',
    'privileges_and_roles_findings_count': :'Integer',
    'user_accounts_findings_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



151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/oci/data_safe/models/section_statistics.rb', line 151

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

  self.class == other.class &&
    targets_count == other.targets_count &&
    auditing_findings_count == other.auditing_findings_count &&
    authorization_control_findings_count == other.authorization_control_findings_count &&
    data_encryption_findings_count == other.data_encryption_findings_count &&
    db_configuration_findings_count == other.db_configuration_findings_count &&
    fine_grained_access_control_findings_count == other.fine_grained_access_control_findings_count &&
    privileges_and_roles_findings_count == other.privileges_and_roles_findings_count &&
    user_accounts_findings_count == other.user_accounts_findings_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



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/oci/data_safe/models/section_statistics.rb', line 188

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


168
169
170
# File 'lib/oci/data_safe/models/section_statistics.rb', line 168

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



177
178
179
# File 'lib/oci/data_safe/models/section_statistics.rb', line 177

def hash
  [targets_count, auditing_findings_count, authorization_control_findings_count, data_encryption_findings_count, db_configuration_findings_count, fine_grained_access_control_findings_count, privileges_and_roles_findings_count, user_accounts_findings_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/data_safe/models/section_statistics.rb', line 221

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



215
216
217
# File 'lib/oci/data_safe/models/section_statistics.rb', line 215

def to_s
  to_hash.to_s
end