Class: OCI::DataCatalog::Models::TermRelationship

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

Overview

Full term relationship definition. Business term relationship between two terms in a business glossary.

Constant Summary collapse

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 = {}) ⇒ TermRelationship

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
188
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
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 162

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  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

#descriptionString

Detailed description of the term relationship usually defined at the time of creation.

Returns:

  • (String)


36
37
38
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 36

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.This is the same as relationshipType for termRelationship

Returns:

  • (String)


32
33
34
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 32

def display_name
  @display_name
end

#keyString

[Required] Unique term relationship key that is immutable.

Returns:

  • (String)


26
27
28
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 26

def key
  @key
end

#lifecycle_stateString

State of the term relationship.

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#parent_term_descriptionString

Description of the parent term.

Returns:

  • (String)


72
73
74
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 72

def parent_term_description
  @parent_term_description
end

#parent_term_display_nameString

Name of the parent term.

Returns:

  • (String)


68
69
70
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 68

def parent_term_display_name
  @parent_term_display_name
end

#parent_term_glossary_keyString

Glossary key of the parent term.

Returns:

  • (String)


80
81
82
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 80

def parent_term_glossary_key
  @parent_term_glossary_key
end

#parent_term_keyString

This relationships parent term key.

Returns:

  • (String)


64
65
66
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 64

def parent_term_key
  @parent_term_key
end

#parent_term_pathString

Full path of the parent term.

Returns:

  • (String)


76
77
78
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 76

def parent_term_path
  @parent_term_path
end

Description of the related term.

Returns:

  • (String)


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

def related_term_description
  @related_term_description
end

Name of the related term.

Returns:

  • (String)


44
45
46
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 44

def related_term_display_name
  @related_term_display_name
end

Glossary key of the related term.

Returns:

  • (String)


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

def related_term_glossary_key
  @related_term_glossary_key
end

Unique id of the related term.

Returns:

  • (String)


40
41
42
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 40

def related_term_key
  @related_term_key
end

Full path of the related term.

Returns:

  • (String)


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

def related_term_path
  @related_term_path
end

#time_createdDateTime

The date and time the term relationship was created, in the format defined by [RFC3339](tools.ietf.org/html/rfc3339). Example: 2019-03-25T21:10:29.600Z

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

#uriString

URI to the term relationship instance in the API.

Returns:

  • (String)


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

def uri
  @uri
end

Class Method Details

.attribute_mapObject

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



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 93

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'display_name': :'displayName',
    'description': :'description',
    'related_term_key': :'relatedTermKey',
    'related_term_display_name': :'relatedTermDisplayName',
    'related_term_description': :'relatedTermDescription',
    'related_term_path': :'relatedTermPath',
    'related_term_glossary_key': :'relatedTermGlossaryKey',
    'uri': :'uri',
    'parent_term_key': :'parentTermKey',
    'parent_term_display_name': :'parentTermDisplayName',
    'parent_term_description': :'parentTermDescription',
    'parent_term_path': :'parentTermPath',
    'parent_term_glossary_key': :'parentTermGlossaryKey',
    'time_created': :'timeCreated',
    'lifecycle_state': :'lifecycleState'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'display_name': :'String',
    'description': :'String',
    'related_term_key': :'String',
    'related_term_display_name': :'String',
    'related_term_description': :'String',
    'related_term_path': :'String',
    'related_term_glossary_key': :'String',
    'uri': :'String',
    'parent_term_key': :'String',
    'parent_term_display_name': :'String',
    'parent_term_description': :'String',
    'parent_term_path': :'String',
    'parent_term_glossary_key': :'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



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 273

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

  self.class == other.class &&
    key == other.key &&
    display_name == other.display_name &&
    description == other.description &&
    related_term_key == other.related_term_key &&
    related_term_display_name == other.related_term_display_name &&
    related_term_description == other.related_term_description &&
    related_term_path == other.related_term_path &&
    related_term_glossary_key == other.related_term_glossary_key &&
    uri == other.uri &&
    parent_term_key == other.parent_term_key &&
    parent_term_display_name == other.parent_term_display_name &&
    parent_term_description == other.parent_term_description &&
    parent_term_path == other.parent_term_path &&
    parent_term_glossary_key == other.parent_term_glossary_key &&
    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



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 318

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


298
299
300
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 298

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



307
308
309
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 307

def hash
  [key, display_name, description, related_term_key, related_term_display_name, related_term_description, related_term_path, related_term_glossary_key, uri, parent_term_key, parent_term_display_name, parent_term_description, parent_term_path, parent_term_glossary_key, 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



351
352
353
354
355
356
357
358
359
360
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 351

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



345
346
347
# File 'lib/oci/data_catalog/models/term_relationship.rb', line 345

def to_s
  to_hash.to_s
end