class OCI::DataCatalog::Models::TermSummary

Summary of a term. A defined business term in a business glossary. As well as a term definition, simple format rules for attributes mapping to the term (for example, the expected data type and length restrictions) may be stated at the term level.

Constants

LIFECYCLE_STATE_ENUM
WORKFLOW_STATUS_ENUM

Attributes

associated_object_count[RW]

The number of objects tagged with this term. @return [Integer]

description[RW]

Detailed description of the term. @return [String]

display_name[RW]

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

@return [String]

glossary_key[RW]

Unique id of the parent glossary. @return [String]

is_allowed_to_have_child_terms[RW]

Indicates whether a term may contain child terms. @return [BOOLEAN]

key[RW]

[Required] Unique term key that is immutable. @return [String]

lifecycle_state[R]

State of the term. @return [String]

parent_term_key[RW]

This terms parent term key. Will be null if the term has no parent term. @return [String]

path[RW]

Absolute path of the term. @return [String]

time_created[RW]

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

@return [DateTime]

uri[RW]

URI to the term instance in the API. @return [String]

workflow_status[R]

Status of the approval process workflow for this business term in the glossary. @return [String]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/data_catalog/models/term_summary.rb, line 87
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'display_name': :'displayName',
    'description': :'description',
    'glossary_key': :'glossaryKey',
    'uri': :'uri',
    'parent_term_key': :'parentTermKey',
    'is_allowed_to_have_child_terms': :'isAllowedToHaveChildTerms',
    'path': :'path',
    'time_created': :'timeCreated',
    'workflow_status': :'workflowStatus',
    'associated_object_count': :'associatedObjectCount',
    'lifecycle_state': :'lifecycleState'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :key The value to assign to the {#key} property @option attributes [String] :display_name The value to assign to the {#display_name} property @option attributes [String] :description The value to assign to the {#description} property @option attributes [String] :glossary_key The value to assign to the {#glossary_key} property @option attributes [String] :uri The value to assign to the {#uri} property @option attributes [String] :parent_term_key The value to assign to the {#parent_term_key} property @option attributes [BOOLEAN] :is_allowed_to_have_child_terms The value to assign to the {#is_allowed_to_have_child_terms} property @option attributes [String] :path The value to assign to the {#path} property @option attributes [DateTime] :time_created The value to assign to the {#time_created} property @option attributes [String] :workflow_status The value to assign to the {#workflow_status} property @option attributes [Integer] :associated_object_count The value to assign to the {#associated_object_count} property @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property

# File lib/oci/data_catalog/models/term_summary.rb, line 144
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.glossary_key = attributes[:'glossaryKey'] if attributes[:'glossaryKey']

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

  self.glossary_key = attributes[:'glossary_key'] if attributes[:'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.is_allowed_to_have_child_terms = attributes[:'isAllowedToHaveChildTerms'] unless attributes[:'isAllowedToHaveChildTerms'].nil?
  self.is_allowed_to_have_child_terms = true if is_allowed_to_have_child_terms.nil? && !attributes.key?(:'isAllowedToHaveChildTerms') # rubocop:disable Style/StringLiterals

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

  self.is_allowed_to_have_child_terms = attributes[:'is_allowed_to_have_child_terms'] unless attributes[:'is_allowed_to_have_child_terms'].nil?
  self.is_allowed_to_have_child_terms = true if is_allowed_to_have_child_terms.nil? && !attributes.key?(:'isAllowedToHaveChildTerms') && !attributes.key?(:'is_allowed_to_have_child_terms') # rubocop:disable Style/StringLiterals

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

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

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

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

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

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

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

  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
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/data_catalog/models/term_summary.rb, line 107
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'display_name': :'String',
    'description': :'String',
    'glossary_key': :'String',
    'uri': :'String',
    'parent_term_key': :'String',
    'is_allowed_to_have_child_terms': :'BOOLEAN',
    'path': :'String',
    'time_created': :'DateTime',
    'workflow_status': :'String',
    'associated_object_count': :'Integer',
    'lifecycle_state': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/data_catalog/models/term_summary.rb, line 242
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    key == other.key &&
    display_name == other.display_name &&
    description == other.description &&
    glossary_key == other.glossary_key &&
    uri == other.uri &&
    parent_term_key == other.parent_term_key &&
    is_allowed_to_have_child_terms == other.is_allowed_to_have_child_terms &&
    path == other.path &&
    time_created == other.time_created &&
    workflow_status == other.workflow_status &&
    associated_object_count == other.associated_object_count &&
    lifecycle_state == other.lifecycle_state
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/data_catalog/models/term_summary.rb, line 283
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/data_catalog/models/term_summary.rb, line 263
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/data_catalog/models/term_summary.rb, line 272
def hash
  [key, display_name, description, glossary_key, uri, parent_term_key, is_allowed_to_have_child_terms, path, time_created, workflow_status, associated_object_count, lifecycle_state].hash
end
lifecycle_state=(lifecycle_state) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] lifecycle_state Object to be assigned

# File lib/oci/data_catalog/models/term_summary.rb, line 226
def lifecycle_state=(lifecycle_state)
  # rubocop:disable Style/ConditionalAssignment
  if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
    OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
  else
    @lifecycle_state = lifecycle_state
  end
  # rubocop:enable Style/ConditionalAssignment
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/data_catalog/models/term_summary.rb, line 316
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_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/data_catalog/models/term_summary.rb, line 310
def to_s
  to_hash.to_s
end
workflow_status=(workflow_status) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] workflow_status Object to be assigned

# File lib/oci/data_catalog/models/term_summary.rb, line 213
def workflow_status=(workflow_status)
  # rubocop:disable Style/ConditionalAssignment
  if workflow_status && !WORKFLOW_STATUS_ENUM.include?(workflow_status)
    OCI.logger.debug("Unknown value for 'workflow_status' [" + workflow_status + "]. Mapping to 'WORKFLOW_STATUS_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @workflow_status = WORKFLOW_STATUS_UNKNOWN_ENUM_VALUE
  else
    @workflow_status = workflow_status
  end
  # rubocop:enable Style/ConditionalAssignment
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/data_catalog/models/term_summary.rb, line 333
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end