Class: OCI::DataSafe::Models::SecurityAssessmentComparisonPerTarget

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

Overview

The results of the comparison between two security assessment resources.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SecurityAssessmentComparisonPerTarget

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
143
144
145
146
147
148
149
150
151
152
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 97

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

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

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

  self.current_target_id = attributes[:'currentTargetId'] if attributes[:'currentTargetId']

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

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

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

  self.authorization_control = attributes[:'authorizationControl'] if attributes[:'authorizationControl']

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

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

  self.data_encryption = attributes[:'dataEncryption'] if attributes[:'dataEncryption']

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

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

  self.db_configuration = attributes[:'dbConfiguration'] if attributes[:'dbConfiguration']

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

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

  self.fine_grained_access_control = attributes[:'fineGrainedAccessControl'] if attributes[:'fineGrainedAccessControl']

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

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

  self.privileges_and_roles = attributes[:'privilegesAndRoles'] if attributes[:'privilegesAndRoles']

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

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

  self.user_accounts = attributes[:'userAccounts'] if attributes[:'userAccounts']

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

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

Instance Attribute Details

#auditingArray<OCI::DataSafe::Models::Diffs>

A comparison between findings belonging to Auditing category.

Returns:



22
23
24
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 22

def auditing
  @auditing
end

#authorization_controlArray<OCI::DataSafe::Models::Diffs>

A comparison between findings belonging to Authorization Control category.

Returns:



26
27
28
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 26

def authorization_control
  @authorization_control
end

#baseline_target_idString

The OCID of the target that is used as a baseline in this comparison.

Returns:

  • (String)


14
15
16
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 14

def baseline_target_id
  @baseline_target_id
end

#current_target_idString

The OCID of the target to be compared against the baseline target.

Returns:

  • (String)


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

def current_target_id
  @current_target_id
end

#data_encryptionArray<OCI::DataSafe::Models::Diffs>

Comparison between findings belonging to Data Encryption category.

Returns:



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

def data_encryption
  @data_encryption
end

#db_configurationArray<OCI::DataSafe::Models::Diffs>

Comparison between findings belonging to Database Configuration category.

Returns:



34
35
36
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 34

def db_configuration
  @db_configuration
end

#fine_grained_access_controlArray<OCI::DataSafe::Models::Diffs>

Comparison between findings belonging to Fine-Grained Access Control category.

Returns:



38
39
40
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 38

def fine_grained_access_control
  @fine_grained_access_control
end

#privileges_and_rolesArray<OCI::DataSafe::Models::Diffs>

Comparison between findings belonging to Privileges and Roles category.

Returns:



42
43
44
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 42

def privileges_and_roles
  @privileges_and_roles
end

#user_accountsArray<OCI::DataSafe::Models::Diffs>

Comparison between findings belonging to User Accounts category.

Returns:



46
47
48
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 46

def user_accounts
  @user_accounts
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'baseline_target_id': :'baselineTargetId',
    'current_target_id': :'currentTargetId',
    'auditing': :'auditing',
    'authorization_control': :'authorizationControl',
    'data_encryption': :'dataEncryption',
    'db_configuration': :'dbConfiguration',
    'fine_grained_access_control': :'fineGrainedAccessControl',
    'privileges_and_roles': :'privilegesAndRoles',
    'user_accounts': :'userAccounts'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 66

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'baseline_target_id': :'String',
    'current_target_id': :'String',
    'auditing': :'Array<OCI::DataSafe::Models::Diffs>',
    'authorization_control': :'Array<OCI::DataSafe::Models::Diffs>',
    'data_encryption': :'Array<OCI::DataSafe::Models::Diffs>',
    'db_configuration': :'Array<OCI::DataSafe::Models::Diffs>',
    'fine_grained_access_control': :'Array<OCI::DataSafe::Models::Diffs>',
    'privileges_and_roles': :'Array<OCI::DataSafe::Models::Diffs>',
    'user_accounts': :'Array<OCI::DataSafe::Models::Diffs>'
    # 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



161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 161

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

  self.class == other.class &&
    baseline_target_id == other.baseline_target_id &&
    current_target_id == other.current_target_id &&
    auditing == other.auditing &&
    authorization_control == other.authorization_control &&
    data_encryption == other.data_encryption &&
    db_configuration == other.db_configuration &&
    fine_grained_access_control == other.fine_grained_access_control &&
    privileges_and_roles == other.privileges_and_roles &&
    user_accounts == other.user_accounts
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



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 199

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


179
180
181
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 179

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

def hash
  [baseline_target_id, current_target_id, auditing, authorization_control, data_encryption, db_configuration, fine_grained_access_control, privileges_and_roles, user_accounts].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



232
233
234
235
236
237
238
239
240
241
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 232

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



226
227
228
# File 'lib/oci/data_safe/models/security_assessment_comparison_per_target.rb', line 226

def to_s
  to_hash.to_s
end