Class: OCI::DataSafe::Models::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/column.rb

Overview

The description of the column.

Constant Summary collapse

APPLICABLE_OPERATORS_ENUM =
[
  APPLICABLE_OPERATORS_IN = 'IN'.freeze,
  APPLICABLE_OPERATORS_EQ = 'EQ'.freeze,
  APPLICABLE_OPERATORS_EQ_CS = 'EQ_CS'.freeze,
  APPLICABLE_OPERATORS_GT = 'GT'.freeze,
  APPLICABLE_OPERATORS_GE = 'GE'.freeze,
  APPLICABLE_OPERATORS_LT = 'LT'.freeze,
  APPLICABLE_OPERATORS_LE = 'LE'.freeze,
  APPLICABLE_OPERATORS_AND = 'AND'.freeze,
  APPLICABLE_OPERATORS_OR = 'OR'.freeze,
  APPLICABLE_OPERATORS_NE = 'NE'.freeze,
  APPLICABLE_OPERATORS_CO = 'CO'.freeze,
  APPLICABLE_OPERATORS_CO_CS = 'CO_CS'.freeze,
  APPLICABLE_OPERATORS_NOT = 'NOT'.freeze,
  APPLICABLE_OPERATORS_NOT_IN = 'NOT_IN'.freeze,
  APPLICABLE_OPERATORS_IN_SET = 'IN_SET'.freeze,
  APPLICABLE_OPERATORS_NOT_IN_SET = 'NOT_IN_SET'.freeze,
  APPLICABLE_OPERATORS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Column

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :display_name (String)

    The value to assign to the #display_name property

  • :field_name (String)

    The value to assign to the #field_name property

  • :data_type (String)

    The value to assign to the #data_type property

  • :is_hidden (BOOLEAN)

    The value to assign to the #is_hidden property

  • :display_order (Integer)

    The value to assign to the #display_order property

  • :is_virtual (BOOLEAN)

    The value to assign to the #is_virtual property

  • :applicable_operators (Array<String>)

    The value to assign to the #applicable_operators property



103
104
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
147
148
149
150
151
152
153
154
# File 'lib/oci/data_safe/models/column.rb', line 103

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

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

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

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

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

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

  self.display_order = attributes[:'displayOrder'] if attributes[:'displayOrder']

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

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

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

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

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

  self.applicable_operators = attributes[:'applicableOperators'] if attributes[:'applicableOperators']

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

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

Instance Attribute Details

#applicable_operatorsArray<String>

An array of operators that can be supported by column fieldName.

Returns:

  • (Array<String>)


58
59
60
# File 'lib/oci/data_safe/models/column.rb', line 58

def applicable_operators
  @applicable_operators
end

#data_typeString

Specifies the data type of the column.

Returns:

  • (String)


42
43
44
# File 'lib/oci/data_safe/models/column.rb', line 42

def data_type
  @data_type
end

#display_nameString

[Required] Name of the column displayed on UI.

Returns:

  • (String)


34
35
36
# File 'lib/oci/data_safe/models/column.rb', line 34

def display_name
  @display_name
end

#display_orderInteger

[Required] Specifies the display order of the column.

Returns:

  • (Integer)


50
51
52
# File 'lib/oci/data_safe/models/column.rb', line 50

def display_order
  @display_order
end

#field_nameString

[Required] Specifies the corresponding field name in the data source.

Returns:

  • (String)


38
39
40
# File 'lib/oci/data_safe/models/column.rb', line 38

def field_name
  @field_name
end

#is_hiddenBOOLEAN

[Required] Indicates if the column is hidden. Values can either be 'true' or 'false'.

Returns:

  • (BOOLEAN)


46
47
48
# File 'lib/oci/data_safe/models/column.rb', line 46

def is_hidden
  @is_hidden
end

#is_virtualBOOLEAN

Specifies if column is virtual and can only be used as column filter.

Returns:

  • (BOOLEAN)


54
55
56
# File 'lib/oci/data_safe/models/column.rb', line 54

def is_virtual
  @is_virtual
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'field_name': :'fieldName',
    'data_type': :'dataType',
    'is_hidden': :'isHidden',
    'display_order': :'displayOrder',
    'is_virtual': :'isVirtual',
    'applicable_operators': :'applicableOperators'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'field_name': :'String',
    'data_type': :'String',
    'is_hidden': :'BOOLEAN',
    'display_order': :'Integer',
    'is_virtual': :'BOOLEAN',
    'applicable_operators': :'Array<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



183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/data_safe/models/column.rb', line 183

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

  self.class == other.class &&
    display_name == other.display_name &&
    field_name == other.field_name &&
    data_type == other.data_type &&
    is_hidden == other.is_hidden &&
    display_order == other.display_order &&
    is_virtual == other.is_virtual &&
    applicable_operators == other.applicable_operators
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



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

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


199
200
201
# File 'lib/oci/data_safe/models/column.rb', line 199

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



208
209
210
# File 'lib/oci/data_safe/models/column.rb', line 208

def hash
  [display_name, field_name, data_type, is_hidden, display_order, is_virtual, applicable_operators].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



252
253
254
255
256
257
258
259
260
261
# File 'lib/oci/data_safe/models/column.rb', line 252

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



246
247
248
# File 'lib/oci/data_safe/models/column.rb', line 246

def to_s
  to_hash.to_s
end