Class: OCI::DataCatalog::Models::RuleSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_catalog/models/rule_summary.rb

Overview

A list of rule resources. One or more rules can be defined for a data entity. Each rule can be defined on one or more attributes of the data entity.

Constant Summary collapse

RULE_TYPE_ENUM =
[
  RULE_TYPE_PRIMARYKEY = 'PRIMARYKEY'.freeze,
  RULE_TYPE_FOREIGNKEY = 'FOREIGNKEY'.freeze,
  RULE_TYPE_UNIQUEKEY = 'UNIQUEKEY'.freeze,
  RULE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ORIGIN_TYPE_ENUM =
[
  ORIGIN_TYPE_SOURCE = 'SOURCE'.freeze,
  ORIGIN_TYPE_USER = 'USER'.freeze,
  ORIGIN_TYPE_PROFILING = 'PROFILING'.freeze,
  ORIGIN_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_MOVING = 'MOVING'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RuleSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 189

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

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

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

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

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

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

  self.referenced_folder_key = attributes[:'referencedFolderKey'] if attributes[:'referencedFolderKey']

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

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

  self.referenced_folder_name = attributes[:'referencedFolderName'] if attributes[:'referencedFolderName']

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

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

  self.referenced_entity_key = attributes[:'referencedEntityKey'] if attributes[:'referencedEntityKey']

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

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

  self.referenced_entity_name = attributes[:'referencedEntityName'] if attributes[:'referencedEntityName']

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

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

  self.referenced_rule_key = attributes[:'referencedRuleKey'] if attributes[:'referencedRuleKey']

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

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

  self.referenced_rule_name = attributes[:'referencedRuleName'] if attributes[:'referencedRuleName']

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

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

  self.referenced_attributes = attributes[:'referencedAttributes'] if attributes[:'referencedAttributes']

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

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

  self.origin_type = attributes[:'originType'] if attributes[:'originType']

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

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

Instance Attribute Details

#attributesArray<OCI::DataCatalog::Models::RuleAttribute>

Attributes associated with a rule. A UNIQUEKEY rule would contain (at least) one attribute, for the local table column(s) on which uniqueness is defined.



66
67
68
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 66

def attributes
  @attributes
end

#descriptionString

Detailed description of a rule.

Returns:

  • (String)


51
52
53
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 51

def description
  @description
end

#display_nameString

A user-friendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


47
48
49
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 47

def display_name
  @display_name
end

#external_keyString

External URI that can be used to reference the object. Format will differ based on the type of object.

Returns:

  • (String)


60
61
62
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 60

def external_key
  @external_key
end

#keyString

[Required] Immutable unique key of a rule.

Returns:

  • (String)


41
42
43
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 41

def key
  @key
end

#lifecycle_stateString

State of the rule.

Returns:

  • (String)


114
115
116
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 114

def lifecycle_state
  @lifecycle_state
end

#origin_typeString

Origin type of the rule.

Returns:

  • (String)


100
101
102
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 100

def origin_type
  @origin_type
end

#referenced_attributesArray<OCI::DataCatalog::Models::RuleAttribute>

Attributes associated with referenced rule, applicable only when rule type is FOREIGNKEY. A FOREIGNKEY rule would contain (at least) one attribute, for the local table column(s), and (at least) one referencedAttribute for referenced table column(s).



96
97
98
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 96

def referenced_attributes
  @referenced_attributes
end

#referenced_entity_keyString

Entity key that represents the referenced entity, applicable only when rule type is FOREIGNKEY.

Returns:

  • (String)


78
79
80
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 78

def referenced_entity_key
  @referenced_entity_key
end

#referenced_entity_nameString

Entity name that represents the referenced entity, applicable only when rule type is FOREIGNKEY.

Returns:

  • (String)


82
83
84
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 82

def referenced_entity_name
  @referenced_entity_name
end

#referenced_folder_keyString

Folder key that represents the referenced folder, applicable only when rule type FOREIGNKEY.

Returns:

  • (String)


70
71
72
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 70

def referenced_folder_key
  @referenced_folder_key
end

#referenced_folder_nameString

Folder name that represents the referenced folder, applicable only when rule type FOREIGNKEY.

Returns:

  • (String)


74
75
76
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 74

def referenced_folder_name
  @referenced_folder_name
end

#referenced_rule_keyString

Rule key that represents the referenced rule, applicable only when rule type is FOREIGNKEY.

Returns:

  • (String)


86
87
88
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 86

def referenced_rule_key
  @referenced_rule_key
end

#referenced_rule_nameString

Rule name that represents the referenced rule, applicable only when rule type is FOREIGNKEY.

Returns:

  • (String)


90
91
92
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 90

def referenced_rule_name
  @referenced_rule_name
end

#rule_typeString

Type of a rule.

Returns:

  • (String)


55
56
57
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 55

def rule_type
  @rule_type
end

#time_createdDateTime

The date and time the rule was created, in the format defined by RFC3339. Example: 2019-03-25T21:10:29.600Z

Returns:

  • (DateTime)


110
111
112
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 110

def time_created
  @time_created
end

#uriString

URI to the rule instance in the API.

Returns:

  • (String)


104
105
106
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 104

def uri
  @uri
end

Class Method Details

.attribute_mapObject

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



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 117

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'display_name': :'displayName',
    'description': :'description',
    'rule_type': :'ruleType',
    'external_key': :'externalKey',
    'attributes': :'attributes',
    'referenced_folder_key': :'referencedFolderKey',
    'referenced_folder_name': :'referencedFolderName',
    'referenced_entity_key': :'referencedEntityKey',
    'referenced_entity_name': :'referencedEntityName',
    'referenced_rule_key': :'referencedRuleKey',
    'referenced_rule_name': :'referencedRuleName',
    'referenced_attributes': :'referencedAttributes',
    'origin_type': :'originType',
    'uri': :'uri',
    'time_created': :'timeCreated',
    'lifecycle_state': :'lifecycleState'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 142

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'display_name': :'String',
    'description': :'String',
    'rule_type': :'String',
    'external_key': :'String',
    'attributes': :'Array<OCI::DataCatalog::Models::RuleAttribute>',
    'referenced_folder_key': :'String',
    'referenced_folder_name': :'String',
    'referenced_entity_key': :'String',
    'referenced_entity_name': :'String',
    'referenced_rule_key': :'String',
    'referenced_rule_name': :'String',
    'referenced_attributes': :'Array<OCI::DataCatalog::Models::RuleAttribute>',
    'origin_type': :'String',
    'uri': :'String',
    'time_created': :'DateTime',
    'lifecycle_state': :'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



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 328

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

  self.class == other.class &&
    key == other.key &&
    display_name == other.display_name &&
    description == other.description &&
    rule_type == other.rule_type &&
    external_key == other.external_key &&
    attributes == other.attributes &&
    referenced_folder_key == other.referenced_folder_key &&
    referenced_folder_name == other.referenced_folder_name &&
    referenced_entity_key == other.referenced_entity_key &&
    referenced_entity_name == other.referenced_entity_name &&
    referenced_rule_key == other.referenced_rule_key &&
    referenced_rule_name == other.referenced_rule_name &&
    referenced_attributes == other.referenced_attributes &&
    origin_type == other.origin_type &&
    uri == other.uri &&
    time_created == other.time_created &&
    lifecycle_state == other.lifecycle_state
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



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 374

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


354
355
356
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 354

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



363
364
365
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 363

def hash
  [key, display_name, description, rule_type, external_key, attributes, referenced_folder_key, referenced_folder_name, referenced_entity_key, referenced_entity_name, referenced_rule_key, referenced_rule_name, referenced_attributes, origin_type, uri, time_created, lifecycle_state].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



407
408
409
410
411
412
413
414
415
416
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 407

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



401
402
403
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 401

def to_s
  to_hash.to_s
end