Class: OCI::DataCatalog::Models::TermRelationshipSummary

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

Overview

Summary of a term relationship. Business term relationship between two terms in a business glossary.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TermRelationshipSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :key (String)

    The value to assign to the #key property

  • :display_name (String)

    The value to assign to the #display_name property

  • :description (String)

    The value to assign to the #description property

  • :related_term_key (String)

    The value to assign to the #related_term_key property

  • :related_term_display_name (String)

    The value to assign to the #related_term_display_name property

  • :related_term_description (String)

    The value to assign to the #related_term_description property

  • :uri (String)

    The value to assign to the #uri property

  • :parent_term_key (String)

    The value to assign to the #parent_term_key property

  • :parent_term_display_name (String)

    The value to assign to the #parent_term_display_name property

  • :parent_term_description (String)

    The value to assign to the #parent_term_description property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property



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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 121

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


23
24
25
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 23

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)


19
20
21
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 19

def display_name
  @display_name
end

#keyString

[Required] Unique term relationship key that is immutable.

Returns:

  • (String)


13
14
15
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 13

def key
  @key
end

#lifecycle_stateString

State of the term relationship.

Returns:

  • (String)


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

def lifecycle_state
  @lifecycle_state
end

#parent_term_descriptionString

Description of the parent term.

Returns:

  • (String)


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

def parent_term_description
  @parent_term_description
end

#parent_term_display_nameString

Name of the parent term.

Returns:

  • (String)


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

def parent_term_display_name
  @parent_term_display_name
end

#parent_term_keyString

This relationships parent term key.

Returns:

  • (String)


43
44
45
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 43

def parent_term_key
  @parent_term_key
end

Description of the related term.

Returns:

  • (String)


35
36
37
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 35

def related_term_description
  @related_term_description
end

Name of the related term.

Returns:

  • (String)


31
32
33
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 31

def related_term_display_name
  @related_term_display_name
end

Unique id of the related term.

Returns:

  • (String)


27
28
29
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 27

def related_term_key
  @related_term_key
end

#time_createdDateTime

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

Returns:

  • (DateTime)


57
58
59
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 57

def time_created
  @time_created
end

#uriString

URI to the term relationship instance in the API.

Returns:

  • (String)


39
40
41
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 39

def uri
  @uri
end

Class Method Details

.attribute_mapObject

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



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 64

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',
    'uri': :'uri',
    'parent_term_key': :'parentTermKey',
    'parent_term_display_name': :'parentTermDisplayName',
    'parent_term_description': :'parentTermDescription',
    'time_created': :'timeCreated',
    'lifecycle_state': :'lifecycleState'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 84

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',
    'uri': :'String',
    'parent_term_key': :'String',
    'parent_term_display_name': :'String',
    'parent_term_description': :'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



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 195

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 &&
    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 &&
    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



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 236

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


216
217
218
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 216

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



225
226
227
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 225

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



269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 269

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



263
264
265
# File 'lib/oci/data_catalog/models/term_relationship_summary.rb', line 263

def to_s
  to_hash.to_s
end