Class: OCI::CloudMigrations::Models::ReplicationProgress

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_migrations/models/replication_progress.rb

Overview

Progress of a migration asset's replication process.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_NONE = 'NONE'.freeze,
  STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LAST_REPLICATION_STATUS_ENUM =
[
  LAST_REPLICATION_STATUS_NONE = 'NONE'.freeze,
  LAST_REPLICATION_STATUS_COMPLETED = 'COMPLETED'.freeze,
  LAST_REPLICATION_STATUS_FAILED = 'FAILED'.freeze,
  LAST_REPLICATION_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 = {}) ⇒ ReplicationProgress

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/cloud_migrations/models/replication_progress.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.percentage = attributes[:'percentage'] if attributes[:'percentage']

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

  self.time_started = attributes[:'timeStarted'] if attributes[:'timeStarted']

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

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

  self.time_oflast_replication_start = attributes[:'timeOflastReplicationStart'] if attributes[:'timeOflastReplicationStart']

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

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

  self.time_of_last_replication_end = attributes[:'timeOfLastReplicationEnd'] if attributes[:'timeOfLastReplicationEnd']

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

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

  self.time_of_last_replication_success = attributes[:'timeOfLastReplicationSuccess'] if attributes[:'timeOfLastReplicationSuccess']

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

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

  self.last_replication_status = attributes[:'lastReplicationStatus'] if attributes[:'lastReplicationStatus']

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

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

  self.last_replication_error = attributes[:'lastReplicationError'] if attributes[:'lastReplicationError']

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

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

Instance Attribute Details

#last_replication_errorString

Error message if the last finished replication failed.

Returns:

  • (String)


55
56
57
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 55

def last_replication_error
  @last_replication_error
end

#last_replication_statusString

Status of the last replication task. It can be Completed or Failed.

Returns:

  • (String)


51
52
53
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 51

def last_replication_status
  @last_replication_status
end

#percentageInteger

[Required] Percentage of the current replication progress from 0 to 100.

Returns:

  • (Integer)


27
28
29
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 27

def percentage
  @percentage
end

#statusString

Status of the current replication progress. It can be None or InProgress.

Returns:

  • (String)


31
32
33
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 31

def status
  @status
end

#time_of_last_replication_endDateTime

End time of the last replication process. It can be Completed or Failed.

Returns:

  • (DateTime)


43
44
45
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 43

def time_of_last_replication_end
  @time_of_last_replication_end
end

#time_of_last_replication_successDateTime

End time of the last successful replication process, which has been completed.

Returns:

  • (DateTime)


47
48
49
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 47

def time_of_last_replication_success
  @time_of_last_replication_success
end

#time_oflast_replication_startDateTime

Start time of the last replication process. It can be Completed or Failed.

Returns:

  • (DateTime)


39
40
41
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 39

def time_oflast_replication_start
  @time_oflast_replication_start
end

#time_startedDateTime

Start time of the current replication process

Returns:

  • (DateTime)


35
36
37
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 35

def time_started
  @time_started
end

Class Method Details

.attribute_mapObject

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



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 58

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'percentage': :'percentage',
    'status': :'status',
    'time_started': :'timeStarted',
    'time_oflast_replication_start': :'timeOflastReplicationStart',
    'time_of_last_replication_end': :'timeOfLastReplicationEnd',
    'time_of_last_replication_success': :'timeOfLastReplicationSuccess',
    'last_replication_status': :'lastReplicationStatus',
    'last_replication_error': :'lastReplicationError'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 74

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'percentage': :'Integer',
    'status': :'String',
    'time_started': :'DateTime',
    'time_oflast_replication_start': :'DateTime',
    'time_of_last_replication_end': :'DateTime',
    'time_of_last_replication_success': :'DateTime',
    'last_replication_status': :'String',
    'last_replication_error': :'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
195
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 183

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

  self.class == other.class &&
    percentage == other.percentage &&
    status == other.status &&
    time_started == other.time_started &&
    time_oflast_replication_start == other.time_oflast_replication_start &&
    time_of_last_replication_end == other.time_of_last_replication_end &&
    time_of_last_replication_success == other.time_of_last_replication_success &&
    last_replication_status == other.last_replication_status &&
    last_replication_error == other.last_replication_error
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



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

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


200
201
202
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 200

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



209
210
211
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 209

def hash
  [percentage, status, time_started, time_oflast_replication_start, time_of_last_replication_end, time_of_last_replication_success, last_replication_status, last_replication_error].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



253
254
255
256
257
258
259
260
261
262
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 253

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



247
248
249
# File 'lib/oci/cloud_migrations/models/replication_progress.rb', line 247

def to_s
  to_hash.to_s
end