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.

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/data_safe/models/column.rb', line 68

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']
end

Instance Attribute Details

#data_typeString

Specifies the data type of the column.

Returns:

  • (String)


21
22
23
# File 'lib/oci/data_safe/models/column.rb', line 21

def data_type
  @data_type
end

#display_nameString

[Required] Name of the column displayed on UI.

Returns:

  • (String)


13
14
15
# File 'lib/oci/data_safe/models/column.rb', line 13

def display_name
  @display_name
end

#display_orderInteger

[Required] Specifies the display order of the column.

Returns:

  • (Integer)


29
30
31
# File 'lib/oci/data_safe/models/column.rb', line 29

def display_order
  @display_order
end

#field_nameString

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

Returns:

  • (String)


17
18
19
# File 'lib/oci/data_safe/models/column.rb', line 17

def field_name
  @field_name
end

#is_hiddenBOOLEAN

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

Returns:

  • (BOOLEAN)


25
26
27
# File 'lib/oci/data_safe/models/column.rb', line 25

def is_hidden
  @is_hidden
end

Class Method Details

.attribute_mapObject

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



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/oci/data_safe/models/column.rb', line 32

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

.swagger_typesObject

Attribute type mapping.



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/oci/data_safe/models/column.rb', line 45

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



114
115
116
117
118
119
120
121
122
123
# File 'lib/oci/data_safe/models/column.rb', line 114

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
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



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/data_safe/models/column.rb', line 148

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


128
129
130
# File 'lib/oci/data_safe/models/column.rb', line 128

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



137
138
139
# File 'lib/oci/data_safe/models/column.rb', line 137

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/data_safe/models/column.rb', line 181

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



175
176
177
# File 'lib/oci/data_safe/models/column.rb', line 175

def to_s
  to_hash.to_s
end