Class: OCI::DatabaseManagement::Models::AutomaticCaptureFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/automatic_capture_filter.rb

Overview

An automatic capture filter that enables you to capture only those SQL statements that you want, and exclude noncritical statements.

Constant Summary collapse

NAME_ENUM =
[
  NAME_AUTO_CAPTURE_SQL_TEXT = 'AUTO_CAPTURE_SQL_TEXT'.freeze,
  NAME_AUTO_CAPTURE_PARSING_SCHEMA_NAME = 'AUTO_CAPTURE_PARSING_SCHEMA_NAME'.freeze,
  NAME_AUTO_CAPTURE_MODULE = 'AUTO_CAPTURE_MODULE'.freeze,
  NAME_AUTO_CAPTURE_ACTION = 'AUTO_CAPTURE_ACTION'.freeze,
  NAME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AutomaticCaptureFilter

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :values_to_include (Array<String>)

    The value to assign to the #values_to_include property

  • :values_to_exclude (Array<String>)

    The value to assign to the #values_to_exclude property

  • :time_last_modified (DateTime)

    The value to assign to the #time_last_modified property

  • :modified_by (String)

    The value to assign to the #modified_by property



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/database_management/models/automatic_capture_filter.rb', line 85

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

  self.values_to_include = attributes[:'valuesToInclude'] if attributes[:'valuesToInclude']

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

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

  self.values_to_exclude = attributes[:'valuesToExclude'] if attributes[:'valuesToExclude']

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

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

  self.time_last_modified = attributes[:'timeLastModified'] if attributes[:'timeLastModified']

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

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

  self.modified_by = attributes[:'modifiedBy'] if attributes[:'modifiedBy']

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

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

Instance Attribute Details

#modified_byString

The database user who last updated the filter value.

Returns:

  • (String)


46
47
48
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 46

def modified_by
  @modified_by
end

#nameString

The name of the automatic capture filter.

  • AUTO_CAPTURE_SQL_TEXT: Search pattern to apply to SQL text.

  • AUTO_CAPTURE_PARSING_SCHEMA_NAME: Parsing schema to include or exclude for SQL plan management auto capture.

  • AUTO_CAPTURE_MODULE: Module to include or exclude for SQL plan management auto capture.

  • AUTO_CAPTURE_ACTION: Action to include or exclude for SQL plan management automatic capture.

Returns:

  • (String)


30
31
32
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 30

def name
  @name
end

#time_last_modifiedDateTime

The time the filter value was last updated.

Returns:

  • (DateTime)


42
43
44
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 42

def time_last_modified
  @time_last_modified
end

#values_to_excludeArray<String>

A list of filter values to exclude.

Returns:

  • (Array<String>)


38
39
40
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 38

def values_to_exclude
  @values_to_exclude
end

#values_to_includeArray<String>

A list of filter values to include.

Returns:

  • (Array<String>)


34
35
36
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 34

def values_to_include
  @values_to_include
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
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'values_to_include': :'valuesToInclude',
    'values_to_exclude': :'valuesToExclude',
    'time_last_modified': :'timeLastModified',
    'modified_by': :'modifiedBy'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 62

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'values_to_include': :'Array<String>',
    'values_to_exclude': :'Array<String>',
    'time_last_modified': :'DateTime',
    'modified_by': :'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



138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 138

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

  self.class == other.class &&
    name == other.name &&
    values_to_include == other.values_to_include &&
    values_to_exclude == other.values_to_exclude &&
    time_last_modified == other.time_last_modified &&
    modified_by == other.modified_by
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



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 172

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


152
153
154
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 152

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



161
162
163
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 161

def hash
  [name, values_to_include, values_to_exclude, time_last_modified, modified_by].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 205

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



199
200
201
# File 'lib/oci/database_management/models/automatic_capture_filter.rb', line 199

def to_s
  to_hash.to_s
end