Class: OCI::DataSafe::Models::SqlFirewallViolationAggregationDimensions

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

Overview

The details of the aggregation dimensions used for summarizing SQL violations.

Constant Summary collapse

SQL_LEVEL_ENUM =
[
  SQL_LEVEL_USER_ISSUED_SQL = 'USER_ISSUED_SQL'.freeze,
  SQL_LEVEL_ALL_SQL = 'ALL_SQL'.freeze,
  SQL_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SqlFirewallViolationAggregationDimensions

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :operation_time (Array<DateTime>)

    The value to assign to the #operation_time property

  • :db_user_name (Array<String>)

    The value to assign to the #db_user_name property

  • :target_id (Array<String>)

    The value to assign to the #target_id property

  • :target_name (Array<String>)

    The value to assign to the #target_name property

  • :client_program (Array<String>)

    The value to assign to the #client_program property

  • :operation (Array<String>)

    The value to assign to the #operation property

  • :client_os_user_name (Array<String>)

    The value to assign to the #client_os_user_name property

  • :violation_cause (Array<String>)

    The value to assign to the #violation_cause property

  • :client_ip (Array<String>)

    The value to assign to the #client_ip property

  • :violation_action (Array<String>)

    The value to assign to the #violation_action property

  • :sql_level (Array<String>)

    The value to assign to the #sql_level property



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
183
184
185
186
187
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 120

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

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

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

  self.db_user_name = attributes[:'dbUserName'] if attributes[:'dbUserName']

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

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

  self.target_id = attributes[:'targetId'] if attributes[:'targetId']

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

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

  self.target_name = attributes[:'targetName'] if attributes[:'targetName']

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

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

  self.client_program = attributes[:'clientProgram'] if attributes[:'clientProgram']

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

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

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

  self.client_os_user_name = attributes[:'clientOsUserName'] if attributes[:'clientOsUserName']

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

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

  self.violation_cause = attributes[:'violationCause'] if attributes[:'violationCause']

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

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

  self.client_ip = attributes[:'clientIp'] if attributes[:'clientIp']

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

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

  self.violation_action = attributes[:'violationAction'] if attributes[:'violationAction']

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

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

  self.sql_level = attributes[:'sqlLevel'] if attributes[:'sqlLevel']

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

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

Instance Attribute Details

#client_ipArray<String>

The IP address of the host from which the session was spawned.

Returns:

  • (Array<String>)


52
53
54
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 52

def client_ip
  @client_ip
end

#client_os_user_nameArray<String>

The name of the operating system user for the database session.

Returns:

  • (Array<String>)


44
45
46
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 44

def client_os_user_name
  @client_os_user_name
end

#client_programArray<String>

The application from which the SQL violation was generated. Examples SQL Plus or SQL Developer.

Returns:

  • (Array<String>)


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

def client_program
  @client_program
end

#db_user_nameArray<String>

The name of the database user.

Returns:

  • (Array<String>)


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

def db_user_name
  @db_user_name
end

#operationArray<String>

The name of the action executed by the user on the target database, for example, ALTER, CREATE, DROP.

Returns:

  • (Array<String>)


40
41
42
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 40

def operation
  @operation
end

#operation_timeArray<DateTime>

The time of the SQL violation occurrence in the target database.

Returns:

  • (Array<DateTime>)


20
21
22
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 20

def operation_time
  @operation_time
end

#sql_levelArray<String>

Specifies the level of SQL included for this SQL Firewall policy. USER_ISSUED_SQL - User issued SQL statements only. ALL_SQL - Includes all SQL statements including SQL statement issued inside PL/SQL units.

Returns:

  • (Array<String>)


63
64
65
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 63

def sql_level
  @sql_level
end

#target_idArray<String>

The OCID of the target database.

Returns:

  • (Array<String>)


28
29
30
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 28

def target_id
  @target_id
end

#target_nameArray<String>

The name of the target database.

Returns:

  • (Array<String>)


32
33
34
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 32

def target_name
  @target_name
end

#violation_actionArray<String>

The action taken for this SQL violation.

Returns:

  • (Array<String>)


56
57
58
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 56

def violation_action
  @violation_action
end

#violation_causeArray<String>

Indicates whether SQL or context violation.

Returns:

  • (Array<String>)


48
49
50
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 48

def violation_cause
  @violation_cause
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_time': :'operationTime',
    'db_user_name': :'dbUserName',
    'target_id': :'targetId',
    'target_name': :'targetName',
    'client_program': :'clientProgram',
    'operation': :'operation',
    'client_os_user_name': :'clientOsUserName',
    'violation_cause': :'violationCause',
    'client_ip': :'clientIp',
    'violation_action': :'violationAction',
    'sql_level': :'sqlLevel'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 85

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_time': :'Array<DateTime>',
    'db_user_name': :'Array<String>',
    'target_id': :'Array<String>',
    'target_name': :'Array<String>',
    'client_program': :'Array<String>',
    'operation': :'Array<String>',
    'client_os_user_name': :'Array<String>',
    'violation_cause': :'Array<String>',
    'client_ip': :'Array<String>',
    'violation_action': :'Array<String>',
    'sql_level': :'Array<String>'
    # 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



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 216

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

  self.class == other.class &&
    operation_time == other.operation_time &&
    db_user_name == other.db_user_name &&
    target_id == other.target_id &&
    target_name == other.target_name &&
    client_program == other.client_program &&
    operation == other.operation &&
    client_os_user_name == other.client_os_user_name &&
    violation_cause == other.violation_cause &&
    client_ip == other.client_ip &&
    violation_action == other.violation_action &&
    sql_level == other.sql_level
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



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 256

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


236
237
238
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 236

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



245
246
247
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 245

def hash
  [operation_time, db_user_name, target_id, target_name, client_program, operation, client_os_user_name, violation_cause, client_ip, violation_action, sql_level].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



289
290
291
292
293
294
295
296
297
298
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 289

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



283
284
285
# File 'lib/oci/data_safe/models/sql_firewall_violation_aggregation_dimensions.rb', line 283

def to_s
  to_hash.to_s
end