Class: OCI::DatabaseMigration::Models::MigrationJobProgressSummary

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

Overview

Summary of the progress of a Migration Job.

Constant Summary collapse

CURRENT_PHASE_ENUM =
[
  CURRENT_PHASE_ODMS_VALIDATE_TGT = 'ODMS_VALIDATE_TGT'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_SRC = 'ODMS_VALIDATE_SRC'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_PREMIGRATION_ADVISOR = 'ODMS_VALIDATE_PREMIGRATION_ADVISOR'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_GG_HUB = 'ODMS_VALIDATE_GG_HUB'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_GG_SERVICE = 'ODMS_VALIDATE_GG_SERVICE'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_DATAPUMP_SETTINGS = 'ODMS_VALIDATE_DATAPUMP_SETTINGS'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_DATAPUMP_SETTINGS_SRC = 'ODMS_VALIDATE_DATAPUMP_SETTINGS_SRC'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_DATAPUMP_SETTINGS_TGT = 'ODMS_VALIDATE_DATAPUMP_SETTINGS_TGT'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_DATAPUMP_SRC = 'ODMS_VALIDATE_DATAPUMP_SRC'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE_DATAPUMP_ESTIMATE_SRC = 'ODMS_VALIDATE_DATAPUMP_ESTIMATE_SRC'.freeze,
  CURRENT_PHASE_ODMS_INITIALIZE_GGS = 'ODMS_INITIALIZE_GGS'.freeze,
  CURRENT_PHASE_ODMS_VALIDATE = 'ODMS_VALIDATE'.freeze,
  CURRENT_PHASE_ODMS_PREPARE = 'ODMS_PREPARE'.freeze,
  CURRENT_PHASE_ODMS_INITIAL_LOAD_EXPORT = 'ODMS_INITIAL_LOAD_EXPORT'.freeze,
  CURRENT_PHASE_ODMS_DATA_UPLOAD = 'ODMS_DATA_UPLOAD'.freeze,
  CURRENT_PHASE_ODMS_INITIAL_LOAD_IMPORT = 'ODMS_INITIAL_LOAD_IMPORT'.freeze,
  CURRENT_PHASE_ODMS_POST_INITIAL_LOAD = 'ODMS_POST_INITIAL_LOAD'.freeze,
  CURRENT_PHASE_ODMS_PREPARE_REPLICATION_TARGET = 'ODMS_PREPARE_REPLICATION_TARGET'.freeze,
  CURRENT_PHASE_ODMS_MONITOR_REPLICATION_LAG = 'ODMS_MONITOR_REPLICATION_LAG'.freeze,
  CURRENT_PHASE_ODMS_SWITCHOVER = 'ODMS_SWITCHOVER'.freeze,
  CURRENT_PHASE_ODMS_CLEANUP = 'ODMS_CLEANUP'.freeze,
  CURRENT_PHASE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
CURRENT_STATUS_ENUM =
[
  CURRENT_STATUS_PENDING = 'PENDING'.freeze,
  CURRENT_STATUS_STARTED = 'STARTED'.freeze,
  CURRENT_STATUS_COMPLETED = 'COMPLETED'.freeze,
  CURRENT_STATUS_FAILED = 'FAILED'.freeze,
  CURRENT_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MigrationJobProgressSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :current_phase (String)

    The value to assign to the #current_phase property

  • :current_status (String)

    The value to assign to the #current_status property

  • :job_progress (Integer)

    The value to assign to the #job_progress property



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 92

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

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

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

  self.current_status = attributes[:'currentStatus'] if attributes[:'currentStatus']

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

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

  self.job_progress = attributes[:'jobProgress'] if attributes[:'jobProgress']

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

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

Instance Attribute Details

#current_phaseString

[Required] Current phase of the job.

Returns:

  • (String)


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

def current_phase
  @current_phase
end

#current_statusString

[Required] Current status of the job.

Returns:

  • (String)


54
55
56
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 54

def current_status
  @current_status
end

#job_progressInteger

[Required] Job progress percentage (0 - 100)

Returns:

  • (Integer)


59
60
61
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 59

def job_progress
  @job_progress
end

Class Method Details

.attribute_mapObject

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



62
63
64
65
66
67
68
69
70
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 62

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'current_phase': :'currentPhase',
    'current_status': :'currentStatus',
    'job_progress': :'jobProgress'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'current_phase': :'String',
    'current_status': :'String',
    'job_progress': :'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



150
151
152
153
154
155
156
157
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 150

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

  self.class == other.class &&
    current_phase == other.current_phase &&
    current_status == other.current_status &&
    job_progress == other.job_progress
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



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 182

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


162
163
164
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 162

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



171
172
173
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 171

def hash
  [current_phase, current_status, job_progress].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



215
216
217
218
219
220
221
222
223
224
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 215

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



209
210
211
# File 'lib/oci/database_migration/models/migration_job_progress_summary.rb', line 209

def to_s
  to_hash.to_s
end