class OCI::DataCatalog::Models::FolderSummary

Summary of a folder. A generic term used in the data catalog for an external organization concept used for a collection of data entities or processes within a data asset. This term is an internal term which models multiple external types of folder, such as file directories, database schemas, and so on. Some data assets, such as Object Store containers, may contain many levels of folders.

Constants

LIFECYCLE_STATE_ENUM

Attributes

business_name[RW]

Optional user friendly business name of the folder. If set, this supplements the harvested display name of the object. @return [String]

data_asset_key[RW]

The unique key of the parent data asset. @return [String]

description[RW]

Detailed description of a folder. @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]

external_key[RW]

Unique external key of this object from the source systems. @return [String]

key[RW]

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

lifecycle_state[R]

State of the folder. @return [String]

parent_folder_key[RW]

The key of the containing folder or null if there is no parent. @return [String]

path[RW]

Full path of the folder. @return [String]

time_created[RW]

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

@return [DateTime]

time_external[RW]

Last modified timestamp of this object in the external system. @return [DateTime]

type_key[RW]

The type of folder object. Type keys can be found via the '/types' endpoint. @return [String]

uri[RW]

URI of the folder resource within the data catalog API. @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/folder_summary.rb, line 85
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'display_name': :'displayName',
    'business_name': :'businessName',
    'description': :'description',
    'data_asset_key': :'dataAssetKey',
    'parent_folder_key': :'parentFolderKey',
    'type_key': :'typeKey',
    'path': :'path',
    'external_key': :'externalKey',
    'time_external': :'timeExternal',
    'time_created': :'timeCreated',
    'uri': :'uri',
    '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] :business_name The value to assign to the {#business_name} property @option attributes [String] :description The value to assign to the {#description} property @option attributes [String] :data_asset_key The value to assign to the {#data_asset_key} property @option attributes [String] :parent_folder_key The value to assign to the {#parent_folder_key} property @option attributes [String] :type_key The value to assign to the {#type_key} property @option attributes [String] :path The value to assign to the {#path} property @option attributes [String] :external_key The value to assign to the {#external_key} property @option attributes [DateTime] :time_external The value to assign to the {#time_external} property @option attributes [DateTime] :time_created The value to assign to the {#time_created} property @option attributes [String] :uri The value to assign to the {#uri} property @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property

# File lib/oci/data_catalog/models/folder_summary.rb, line 145
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.business_name = attributes[:'businessName'] if attributes[:'businessName']

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

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

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

  self.data_asset_key = attributes[:'dataAssetKey'] if attributes[:'dataAssetKey']

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

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

  self.parent_folder_key = attributes[:'parentFolderKey'] if attributes[:'parentFolderKey']

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

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

  self.type_key = attributes[:'typeKey'] if attributes[:'typeKey']

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

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

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

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

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

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

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

  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/folder_summary.rb, line 106
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'display_name': :'String',
    'business_name': :'String',
    'description': :'String',
    'data_asset_key': :'String',
    'parent_folder_key': :'String',
    'type_key': :'String',
    'path': :'String',
    'external_key': :'String',
    'time_external': :'DateTime',
    'time_created': :'DateTime',
    'uri': :'String',
    '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/folder_summary.rb, line 234
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    key == other.key &&
    display_name == other.display_name &&
    business_name == other.business_name &&
    description == other.description &&
    data_asset_key == other.data_asset_key &&
    parent_folder_key == other.parent_folder_key &&
    type_key == other.type_key &&
    path == other.path &&
    external_key == other.external_key &&
    time_external == other.time_external &&
    time_created == other.time_created &&
    uri == other.uri &&
    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/folder_summary.rb, line 276
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/folder_summary.rb, line 256
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/folder_summary.rb, line 265
def hash
  [key, display_name, business_name, description, data_asset_key, parent_folder_key, type_key, path, external_key, time_external, time_created, uri, 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/folder_summary.rb, line 218
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/folder_summary.rb, line 309
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/folder_summary.rb, line 303
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_catalog/models/folder_summary.rb, line 326
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