Class: OCI::DatabaseMigration::Models::CreateNonADBAutoCreateTablespaceDetails

Inherits:
CreateTargetTypeTablespaceDetails show all
Defined in:
lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb

Overview

Migration tablespace settings valid for NON-ADB target type using auto create feature.

Constant Summary

Constants inherited from CreateTargetTypeTablespaceDetails

OCI::DatabaseMigration::Models::CreateTargetTypeTablespaceDetails::TARGET_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from CreateTargetTypeTablespaceDetails

#target_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateTargetTypeTablespaceDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreateNonADBAutoCreateTablespaceDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :is_auto_create (BOOLEAN)

    The value to assign to the #is_auto_create property

  • :is_big_file (BOOLEAN)

    The value to assign to the #is_big_file property

  • :extend_size_in_mbs (Integer)

    The value to assign to the #extend_size_in_mbs property



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 60

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['targetType'] = 'NON_ADB_AUTOCREATE'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

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

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

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

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

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

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

  self.extend_size_in_mbs = attributes[:'extendSizeInMBs'] if attributes[:'extendSizeInMBs']

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

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

Instance Attribute Details

#extend_size_in_mbsInteger

Size of extend in MB. Can only be specified if 'isBigFile' property is set to true.

Returns:

  • (Integer)


25
26
27
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 25

def extend_size_in_mbs
  @extend_size_in_mbs
end

#is_auto_createBOOLEAN

True to auto-create tablespace in the target Database.

Returns:

  • (BOOLEAN)


15
16
17
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 15

def is_auto_create
  @is_auto_create
end

#is_big_fileBOOLEAN

True set tablespace to big file.

Returns:

  • (BOOLEAN)


20
21
22
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 20

def is_big_file
  @is_big_file
end

Class Method Details

.attribute_mapObject

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



28
29
30
31
32
33
34
35
36
37
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 28

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'target_type': :'targetType',
    'is_auto_create': :'isAutoCreate',
    'is_big_file': :'isBigFile',
    'extend_size_in_mbs': :'extendSizeInMBs'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



40
41
42
43
44
45
46
47
48
49
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 40

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'target_type': :'String',
    'is_auto_create': :'BOOLEAN',
    'is_big_file': :'BOOLEAN',
    'extend_size_in_mbs': :'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



100
101
102
103
104
105
106
107
108
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 100

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

  self.class == other.class &&
    target_type == other.target_type &&
    is_auto_create == other.is_auto_create &&
    is_big_file == other.is_big_file &&
    extend_size_in_mbs == other.extend_size_in_mbs
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



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 133

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


113
114
115
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 113

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



122
123
124
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 122

def hash
  [target_type, is_auto_create, is_big_file, extend_size_in_mbs].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



166
167
168
169
170
171
172
173
174
175
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 166

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



160
161
162
# File 'lib/oci/database_migration/models/create_non_adb_auto_create_tablespace_details.rb', line 160

def to_s
  to_hash.to_s
end