class OCI::DataIntegration::Models::ObjectMetadata

A summary type containing information about the object including its key, name and when/who created/updated it.

Attributes

aggregator[RW]

@return [OCI::DataIntegration::Models::AggregatorSummary]

aggregator_key[RW]

The owning object key for this object. @return [String]

count_statistics[RW]

@return [OCI::DataIntegration::Models::CountStatistic]

created_by[RW]

The user that created the object. @return [String]

created_by_name[RW]

The user that created the object. @return [String]

identifier_path[RW]

The full path to identify this object. @return [String]

info_fields[RW]

Information property fields. @return [Hash<String, String>]

is_favorite[RW]

Specifies whether this object is a favorite or not. @return [BOOLEAN]

labels[RW]

Labels are keywords or tags that you can add to data assets, dataflows and so on. You can define your own labels and use them to categorize content. @return [Array<String>]

registry_version[RW]

The registry version of the object. @return [Integer]

time_created[RW]

The date and time that the object was created. @return [DateTime]

time_updated[RW]

The date and time that the object was updated. @return [DateTime]

updated_by[RW]

The user that updated the object. @return [String]

updated_by_name[RW]

The user that updated the object. @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_integration/models/object_metadata.rb, line 65
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'created_by': :'createdBy',
    'created_by_name': :'createdByName',
    'updated_by': :'updatedBy',
    'updated_by_name': :'updatedByName',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'aggregator_key': :'aggregatorKey',
    'aggregator': :'aggregator',
    'identifier_path': :'identifierPath',
    'info_fields': :'infoFields',
    'registry_version': :'registryVersion',
    'labels': :'labels',
    'is_favorite': :'isFavorite',
    'count_statistics': :'countStatistics'
    # 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] :created_by The value to assign to the {#created_by} property @option attributes [String] :created_by_name The value to assign to the {#created_by_name} property @option attributes [String] :updated_by The value to assign to the {#updated_by} property @option attributes [String] :updated_by_name The value to assign to the {#updated_by_name} property @option attributes [DateTime] :time_created The value to assign to the {#time_created} property @option attributes [DateTime] :time_updated The value to assign to the {#time_updated} property @option attributes [String] :aggregator_key The value to assign to the {#aggregator_key} property @option attributes [OCI::DataIntegration::Models::AggregatorSummary] :aggregator The value to assign to the {#aggregator} property @option attributes [String] :identifier_path The value to assign to the {#identifier_path} property @option attributes [Hash<String, String>] :info_fields The value to assign to the {#info_fields} property @option attributes [Integer] :registry_version The value to assign to the {#registry_version} property @option attributes [Array<String>] :labels The value to assign to the {#labels} property @option attributes [BOOLEAN] :is_favorite The value to assign to the {#is_favorite} property @option attributes [OCI::DataIntegration::Models::CountStatistic] :count_statistics The value to assign to the {#count_statistics} property

# File lib/oci/data_integration/models/object_metadata.rb, line 128
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.created_by = attributes[:'createdBy'] if attributes[:'createdBy']

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  self.is_favorite = attributes[:'isFavorite'] unless attributes[:'isFavorite'].nil?
  self.is_favorite = false if is_favorite.nil? && !attributes.key?(:'isFavorite') # rubocop:disable Style/StringLiterals

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

  self.is_favorite = attributes[:'is_favorite'] unless attributes[:'is_favorite'].nil?
  self.is_favorite = false if is_favorite.nil? && !attributes.key?(:'isFavorite') && !attributes.key?(:'is_favorite') # rubocop:disable Style/StringLiterals

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

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

  self.count_statistics = attributes[:'count_statistics'] if attributes[:'count_statistics']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/data_integration/models/object_metadata.rb, line 87
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'created_by': :'String',
    'created_by_name': :'String',
    'updated_by': :'String',
    'updated_by_name': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'aggregator_key': :'String',
    'aggregator': :'OCI::DataIntegration::Models::AggregatorSummary',
    'identifier_path': :'String',
    'info_fields': :'Hash<String, String>',
    'registry_version': :'Integer',
    'labels': :'Array<String>',
    'is_favorite': :'BOOLEAN',
    'count_statistics': :'OCI::DataIntegration::Models::CountStatistic'
    # 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_integration/models/object_metadata.rb, line 220
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    created_by == other.created_by &&
    created_by_name == other.created_by_name &&
    updated_by == other.updated_by &&
    updated_by_name == other.updated_by_name &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    aggregator_key == other.aggregator_key &&
    aggregator == other.aggregator &&
    identifier_path == other.identifier_path &&
    info_fields == other.info_fields &&
    registry_version == other.registry_version &&
    labels == other.labels &&
    is_favorite == other.is_favorite &&
    count_statistics == other.count_statistics
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_integration/models/object_metadata.rb, line 263
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_integration/models/object_metadata.rb, line 243
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_integration/models/object_metadata.rb, line 252
def hash
  [created_by, created_by_name, updated_by, updated_by_name, time_created, time_updated, aggregator_key, aggregator, identifier_path, info_fields, registry_version, labels, is_favorite, count_statistics].hash
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_integration/models/object_metadata.rb, line 296
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_integration/models/object_metadata.rb, line 290
def to_s
  to_hash.to_s
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_integration/models/object_metadata.rb, line 313
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