Class: OCI::DataIntegration::Models::NamePatternRule

Inherits:
ProjectionRule show all
Defined in:
lib/oci/data_integration/models/name_pattern_rule.rb

Overview

This rule projects fields by a name pattern, for example it may start with STR_ or end with _DATE. This is defined using a regular expression.

Constant Summary collapse

MATCHING_STRATEGY_ENUM =
[
  MATCHING_STRATEGY_NAME_OR_TAGS = 'NAME_OR_TAGS'.freeze,
  MATCHING_STRATEGY_TAGS_ONLY = 'TAGS_ONLY'.freeze,
  MATCHING_STRATEGY_NAME_ONLY = 'NAME_ONLY'.freeze,
  MATCHING_STRATEGY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RULE_TYPE_ENUM =
[
  RULE_TYPE_INCLUDE = 'INCLUDE'.freeze,
  RULE_TYPE_EXCLUDE = 'EXCLUDE'.freeze,
  RULE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from ProjectionRule

ProjectionRule::MODEL_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from ProjectionRule

#config_values, #description, #is_java_regex_syntax, #key, #model_type, #model_version, #object_status, #parent_ref

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ProjectionRule

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ NamePatternRule

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 119

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['modelType'] = 'NAME_PATTERN_RULE'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.is_skip_remaining_rules_on_match = attributes[:'isSkipRemainingRulesOnMatch'] unless attributes[:'isSkipRemainingRulesOnMatch'].nil?

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

  self.is_skip_remaining_rules_on_match = attributes[:'is_skip_remaining_rules_on_match'] unless attributes[:'is_skip_remaining_rules_on_match'].nil?

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

  self.is_cascade = attributes[:'isCascade'] unless attributes[:'isCascade'].nil?

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

  self.is_cascade = attributes[:'is_cascade'] unless attributes[:'is_cascade'].nil?

  self.matching_strategy = attributes[:'matchingStrategy'] if attributes[:'matchingStrategy']

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

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

  self.is_case_sensitive = attributes[:'isCaseSensitive'] unless attributes[:'isCaseSensitive'].nil?

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

  self.is_case_sensitive = attributes[:'is_case_sensitive'] unless attributes[:'is_case_sensitive'].nil?

  self.rule_type = attributes[:'ruleType'] if attributes[:'ruleType']

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

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

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

Instance Attribute Details

#is_cascadeBOOLEAN

Specifies whether to cascade or not.

Returns:

  • (BOOLEAN)


35
36
37
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 35

def is_cascade
  @is_cascade
end

#is_case_sensitiveBOOLEAN

Specifies if the rule is case sensitive.

Returns:

  • (BOOLEAN)


43
44
45
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 43

def is_case_sensitive
  @is_case_sensitive
end

#is_skip_remaining_rules_on_matchBOOLEAN

Specifies whether to skip remaining rules when a match is found.

Returns:

  • (BOOLEAN)


27
28
29
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 27

def is_skip_remaining_rules_on_match
  @is_skip_remaining_rules_on_match
end

#matching_strategyString

The pattern matching strategy.

Returns:

  • (String)


39
40
41
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 39

def matching_strategy
  @matching_strategy
end

#patternString

The rule pattern.

Returns:

  • (String)


51
52
53
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 51

def pattern
  @pattern
end

#rule_typeString

The rule type.

Returns:

  • (String)


47
48
49
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 47

def rule_type
  @rule_type
end

#scopeObject

Reference to a typed object. This can be either a key value to an object within the document, a shall referenced to a TypedObject, or a full TypedObject definition.

Returns:

  • (Object)


31
32
33
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 31

def scope
  @scope
end

Class Method Details

.attribute_mapObject

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



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 54

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'modelType',
    'key': :'key',
    'model_version': :'modelVersion',
    'parent_ref': :'parentRef',
    'is_java_regex_syntax': :'isJavaRegexSyntax',
    'config_values': :'configValues',
    'object_status': :'objectStatus',
    'description': :'description',
    'is_skip_remaining_rules_on_match': :'isSkipRemainingRulesOnMatch',
    'scope': :'scope',
    'is_cascade': :'isCascade',
    'matching_strategy': :'matchingStrategy',
    'is_case_sensitive': :'isCaseSensitive',
    'rule_type': :'ruleType',
    'pattern': :'pattern'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 77

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'model_type': :'String',
    'key': :'String',
    'model_version': :'String',
    'parent_ref': :'OCI::DataIntegration::Models::ParentReference',
    'is_java_regex_syntax': :'BOOLEAN',
    'config_values': :'OCI::DataIntegration::Models::ConfigValues',
    'object_status': :'Integer',
    'description': :'String',
    'is_skip_remaining_rules_on_match': :'BOOLEAN',
    'scope': :'Object',
    'is_cascade': :'BOOLEAN',
    'matching_strategy': :'String',
    'is_case_sensitive': :'BOOLEAN',
    'rule_type': :'String',
    'pattern': :'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



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 197

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

  self.class == other.class &&
    model_type == other.model_type &&
    key == other.key &&
    model_version == other.model_version &&
    parent_ref == other.parent_ref &&
    is_java_regex_syntax == other.is_java_regex_syntax &&
    config_values == other.config_values &&
    object_status == other.object_status &&
    description == other.description &&
    is_skip_remaining_rules_on_match == other.is_skip_remaining_rules_on_match &&
    scope == other.scope &&
    is_cascade == other.is_cascade &&
    matching_strategy == other.matching_strategy &&
    is_case_sensitive == other.is_case_sensitive &&
    rule_type == other.rule_type &&
    pattern == other.pattern
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



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 241

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


221
222
223
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 221

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



230
231
232
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 230

def hash
  [model_type, key, model_version, parent_ref, is_java_regex_syntax, config_values, object_status, description, is_skip_remaining_rules_on_match, scope, is_cascade, matching_strategy, is_case_sensitive, rule_type, pattern].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



274
275
276
277
278
279
280
281
282
283
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 274

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



268
269
270
# File 'lib/oci/data_integration/models/name_pattern_rule.rb', line 268

def to_s
  to_hash.to_s
end