Class: OCI::DatabaseMigration::Models::UserDefinedProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_migration/models/user_defined_property.rb

Overview

User Defined Property

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_TEXT = 'TEXT'.freeze,
  TYPE_PASSWORD = 'PASSWORD'.freeze,
  TYPE_RADIO = 'RADIO'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserDefinedProperty

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
155
156
157
158
159
160
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 115

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

  self.is_required = attributes[:'isRequired'] unless attributes[:'isRequired'].nil?

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

  self.is_required = attributes[:'is_required'] unless attributes[:'is_required'].nil?

  self.min_length = attributes[:'minLength'] if attributes[:'minLength']

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

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

  self.max_length = attributes[:'maxLength'] if attributes[:'maxLength']

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

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

  self.default_value = attributes[:'defaultValue'] if attributes[:'defaultValue']

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

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

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

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

Instance Attribute Details

#default_valueString

The default value of the property.

Returns:

  • (String)


53
54
55
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 53

def default_value
  @default_value
end

#descriptionString

A user-friendly description. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


33
34
35
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 33

def description
  @description
end

#display_nameString

[Required] A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


27
28
29
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 27

def display_name
  @display_name
end

#is_requiredBOOLEAN

True if the property is required, false otherwise

Returns:

  • (BOOLEAN)


41
42
43
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 41

def is_required
  @is_required
end

#max_lengthInteger

Maximum length of the text

Returns:

  • (Integer)


49
50
51
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 49

def max_length
  @max_length
end

#min_lengthInteger

Minimum length of the text

Returns:

  • (Integer)


45
46
47
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 45

def min_length
  @min_length
end

#nameString

[Required] The property name.

Returns:

  • (String)


21
22
23
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 21

def name
  @name
end

#optionsArray<OCI::DatabaseMigration::Models::UserDefinedPropertyOption>

User defined property options.



61
62
63
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 61

def options
  @options
end

#typeString

[Required] The type of the user defined property.

Returns:

  • (String)


37
38
39
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 37

def type
  @type
end

#valueString

The value of the property.

Returns:

  • (String)


57
58
59
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 57

def value
  @value
end

Class Method Details

.attribute_mapObject

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



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 64

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'display_name': :'displayName',
    'description': :'description',
    'type': :'type',
    'is_required': :'isRequired',
    'min_length': :'minLength',
    'max_length': :'maxLength',
    'default_value': :'defaultValue',
    'value': :'value',
    'options': :'options'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 82

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'display_name': :'String',
    'description': :'String',
    'type': :'String',
    'is_required': :'BOOLEAN',
    'min_length': :'Integer',
    'max_length': :'Integer',
    'default_value': :'String',
    'value': :'String',
    'options': :'Array<OCI::DatabaseMigration::Models::UserDefinedPropertyOption>'
    # 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



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 182

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

  self.class == other.class &&
    name == other.name &&
    display_name == other.display_name &&
    description == other.description &&
    type == other.type &&
    is_required == other.is_required &&
    min_length == other.min_length &&
    max_length == other.max_length &&
    default_value == other.default_value &&
    value == other.value &&
    options == other.options
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



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

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


201
202
203
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 201

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



210
211
212
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 210

def hash
  [name, display_name, description, type, is_required, min_length, max_length, default_value, value, options].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



254
255
256
257
258
259
260
261
262
263
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 254

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



248
249
250
# File 'lib/oci/database_migration/models/user_defined_property.rb', line 248

def to_s
  to_hash.to_s
end