Class: OCI::Opsi::Models::DataObjectColumnMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opsi/models/data_object_column_metadata.rb

Overview

Metadata of a column in a data object resultset.

Constant Summary collapse

CATEGORY_ENUM =
[
  CATEGORY_DIMENSION = 'DIMENSION'.freeze,
  CATEGORY_METRIC = 'METRIC'.freeze,
  CATEGORY_TIME_DIMENSION = 'TIME_DIMENSION'.freeze,
  CATEGORY_UNKNOWN = 'UNKNOWN'.freeze,
  CATEGORY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DATA_TYPE_NAME_ENUM =
[
  DATA_TYPE_NAME_NUMBER = 'NUMBER'.freeze,
  DATA_TYPE_NAME_TIMESTAMP = 'TIMESTAMP'.freeze,
  DATA_TYPE_NAME_VARCHAR2 = 'VARCHAR2'.freeze,
  DATA_TYPE_NAME_OTHER = 'OTHER'.freeze,
  DATA_TYPE_NAME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DataObjectColumnMetadata

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 105

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

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

  self.data_type = attributes[:'dataType'] if attributes[:'dataType']

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

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

  self.data_type_name = attributes[:'dataTypeName'] if attributes[:'dataTypeName']

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

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

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

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

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

  self.unit_details = attributes[:'unitDetails'] if attributes[:'unitDetails']

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

  self.unit_details = attributes[:'unit_details'] if attributes[:'unit_details']
end

Instance Attribute Details

#categoryString

Category of the column.

Returns:

  • (String)


34
35
36
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 34

def category
  @category
end

#data_typeString

Type of a data object column.

Returns:

  • (String)


38
39
40
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 38

def data_type
  @data_type
end

#data_type_nameString

Type name of a data object column.

Returns:

  • (String)


42
43
44
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 42

def data_type_name
  @data_type_name
end

#descriptionString

Description of the column.

Returns:

  • (String)


50
51
52
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 50

def description
  @description
end

#display_nameString

Display name of the column.

Returns:

  • (String)


46
47
48
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 46

def display_name
  @display_name
end

#group_nameString

Group name of the column.

Returns:

  • (String)


54
55
56
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 54

def group_name
  @group_name
end

#nameString

[Required] Name of the column.

Returns:

  • (String)


30
31
32
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 30

def name
  @name
end

#unit_detailsOCI::Opsi::Models::DataObjectColumnUnit



57
58
59
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 57

def unit_details
  @unit_details
end

Class Method Details

.attribute_mapObject

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



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 60

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'category': :'category',
    'data_type': :'dataType',
    'data_type_name': :'dataTypeName',
    'display_name': :'displayName',
    'description': :'description',
    'group_name': :'groupName',
    'unit_details': :'unitDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 76

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'category': :'String',
    'data_type': :'String',
    'data_type_name': :'String',
    'display_name': :'String',
    'description': :'String',
    'group_name': :'String',
    'unit_details': :'OCI::Opsi::Models::DataObjectColumnUnit'
    # 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



181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 181

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

  self.class == other.class &&
    name == other.name &&
    category == other.category &&
    data_type == other.data_type &&
    data_type_name == other.data_type_name &&
    display_name == other.display_name &&
    description == other.description &&
    group_name == other.group_name &&
    unit_details == other.unit_details
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



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 218

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


198
199
200
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 198

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



207
208
209
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 207

def hash
  [name, category, data_type, data_type_name, display_name, description, group_name, unit_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 251

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



245
246
247
# File 'lib/oci/opsi/models/data_object_column_metadata.rb', line 245

def to_s
  to_hash.to_s
end