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):



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
281
# File 'lib/oci/data_catalog/models/rule_summary.rb', line 190

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.



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

def attributes
  @attributes
end

#descriptionString

Detailed description of a rule.

Returns:

  • (String)


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

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)


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

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)


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

def external_key
  @external_key
end

#keyString

[Required] Immutable unique key of a rule.

Returns:

  • (String)


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

def key
  @key
end

#lifecycle_stateString

State of the rule.

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#origin_typeString

Origin type of the rule.

Returns:

  • (String)


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

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).



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

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)


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

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)


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

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)


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

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)


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

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)


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

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)


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

def referenced_rule_name
  @referenced_rule_name
end

#rule_typeString

Type of a rule.

Returns:

  • (String)


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

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)


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

def time_created
  @time_created
end

#uriString

URI to the rule instance in the API.

Returns:

  • (String)


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

def uri
  @uri
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

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



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

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



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

def to_s
  to_hash.to_s
end